Re: Docstrings and literate programming (good practices?)

2022-11-07 Thread Samuel Wales
another option that might work for many users [at least would work for myself buyt needs are modest here] is unbreakable multi-directinal links such that you can link from a docstring to the manual or from the manual to the docstring. by multidirectional i mean you can have the same link, which

Re: Docstrings and literate programming (good practices?)

2022-11-04 Thread Samuel Wales
On 11/4/22, Ihor Radchenko wrote: > 1. We need to convert from Elisp docstring format to Org markup not sure what is needed here as it is just a brainstorm. but i have a manual i am loath to copy docstrings into when they are already in the code. i could adumbrate a bit i the manual but i

Re: Docstrings and literate programming (good practices?)

2022-11-04 Thread Max Nikulin
On 04/11/2022 10:03, Samuel Wales wrote: for example, you have a body of non-literate elisp code, and you have a manual. it could be redundant to describe commands and what they do and their options, if the docstrings are good. There is Sphinx in Python world that allows to combine guide

Re: Docstrings and literate programming (good practices?)

2022-11-04 Thread Ihor Radchenko
Samuel Wales writes: > why not include the docstrings of all commands in some nice format in > the .org manual via some mechanism? > > would that be a good practice? seems useful abstractly. There are two problems: 1. We need to convert from Elisp docstring format to Org markup 2. More

Re: Docstrings and literate programming (good practices?)

2022-11-04 Thread tomas
On Fri, Nov 04, 2022 at 12:13:30AM -0700, Samuel Wales wrote: > my dry sensibilities say don't write ht same thing in the manual that > is well written in the docstring. idk the issues however, other than > that once you do it in two places murphy's law says they will get out > of sync.

Re: Docstrings and literate programming (good practices?)

2022-11-04 Thread tomas
On Fri, Nov 04, 2022 at 07:39:04AM +0100, Marcin Borkowski wrote: > > On 2022-11-04, at 06:45, to...@tuxteam.de wrote: [...] > > Ah. Javadoc and their descendants. I tend to call that "illiterate > > programming"... > > I spat my tea. :-) Thanks, that's a nice one! Sorry to hear that ;-P >

Re: Docstrings and literate programming (good practices?)

2022-11-04 Thread Samuel Wales
my dry sensibilities say don't write ht same thing in the manual that is well written in the docstring. idk the issues however, other than that once you do it in two places murphy's law says they will get out of sync. but surely an extractor could look for an interactive spec and things like

Re: Docstrings and literate programming (good practices?)

2022-11-04 Thread Marcin Borkowski
On 2022-11-04, at 06:45, to...@tuxteam.de wrote: > On Thu, Nov 03, 2022 at 08:03:05PM -0700, Samuel Wales wrote: >> i wonder if emacs or org has what you might call semi-literate or >> etaretil docstring functions? >> >> for example, you have a body of non-literate elisp code, and you have >>

Re: Docstrings and literate programming (good practices?)

2022-11-03 Thread tomas
On Thu, Nov 03, 2022 at 08:03:05PM -0700, Samuel Wales wrote: > i wonder if emacs or org has what you might call semi-literate or > etaretil docstring functions? > > for example, you have a body of non-literate elisp code, and you have > a manual. it could be redundant to describe commands and

Re: Docstrings and literate programming (good practices?)

2022-11-03 Thread Samuel Wales
i wonder if emacs or org has what you might call semi-literate or etaretil docstring functions? for example, you have a body of non-literate elisp code, and you have a manual. it could be redundant to describe commands and what they do and their options, if the docstrings are good. why not

Re: Docstrings and literate programming (good practices?)

2022-11-03 Thread Rudolf Adamkovič
Juan Manuel Macías writes: Hello Juan! > I can duplicate the text, but it seems to be a bit redundant, right? > So what is the best way to proceed when doing literate programming > with any language that supports docstrings? Apologies in advance if > the question is a bit silly, but I'm not a

Re: Docstrings and literate programming (good practices?)

2022-11-03 Thread Ihor Radchenko
Juan Manuel Macías writes: >> Can you elaborate about "paragraph is exported as verbatim"? > > Sorry for the conciseness in my previous explanation. I meant something > like this: > > : foo > > is exported to LaTeX as > > \begin{verbatim} > foo > \end{verbatim} > > (and what i want is for it to

Re: Docstrings and literate programming (good practices?)

2022-11-02 Thread Juan Manuel Macías
Ihor Radchenko writes: > Can you elaborate about "paragraph is exported as verbatim"? Sorry for the conciseness in my previous explanation. I meant something like this: : foo is exported to LaTeX as \begin{verbatim} foo \end{verbatim} (and what i want is for it to be exported as 'normal

Re: Docstrings and literate programming (good practices?)

2022-11-02 Thread Ihor Radchenko
Juan Manuel Macías writes: > Ihor Radchenko writes: > >> Why do you need to strip docstring on export? > > Thanks for the suggestion. The problem with doing it this way is that > the paragraph is exported as verbatim, and I want it to be exported as a > normal part of the text. For example, in a

Re: Docstrings and literate programming (good practices?)

2022-11-02 Thread Juan Manuel Macías
Ihor Radchenko writes: > Why do you need to strip docstring on export? Hi Ihor, Thanks for the suggestion. The problem with doing it this way is that the paragraph is exported as verbatim, and I want it to be exported as a normal part of the text. For example, in a PDF or HTML it would say

Re: Docstrings and literate programming (good practices?)

2022-11-02 Thread Ihor Radchenko
"Dr. Arne Babenhauserheide" writes: > The first (org-block) for long-form text (like official javadoc), the > second (just verbatim) for shorter docstrings. For even shorter docstrings, you can just #+name a paragraph. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org

Re: Docstrings and literate programming (good practices?)

2022-11-02 Thread Dr. Arne Babenhauserheide
Ihor Radchenko writes: > Juan Manuel Macías writes: > >> #+NAME: docstring1 >> #+begin_src org :post format-docstring(*this*) :results replace :exports >> results :tangle no >> Lorem ipsum dolor sit amet. >> >> Consectetuer adipiscing elit. "Donec hendrerit tempor tellus". Donec >>

Re: Docstrings and literate programming (good practices?)

2022-11-02 Thread Ihor Radchenko
Juan Manuel Macías writes: > #+NAME: docstring1 > #+begin_src org :post format-docstring(*this*) :results replace :exports > results :tangle no > Lorem ipsum dolor sit amet. > > Consectetuer adipiscing elit. "Donec hendrerit tempor tellus". Donec > pretium posuere > tellus. Proin quam