From: "Dr. Arne Babenhauserheide" <arne_bab@web.de>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: "Juan Manuel Macías" <maciaschain@posteo.net>, emacs-orgmode@gnu.org
Subject: Re: Docstrings and literate programming (good practices?)
Date: Wed, 02 Nov 2022 08:53:48 +0100 [thread overview]
Message-ID: <87r0ylvlh9.fsf@web.de> (raw)
In-Reply-To: <87v8nxkewc.fsf@localhost>
[-- Attachment #1: Type: text/plain, Size: 1396 bytes --]
Ihor Radchenko <yantar92@posteo.net> writes:
> Juan Manuel Macías <maciaschain@posteo.net> 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 nisl, tincidunt et, mattis eget, convallis nec, purus. Cum sociis
>> natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
>> #+end_src
>
> You can also have
>
> #+name: docstring1
> : Lorem ipsum dolor sit amet.
>
> :
> : Consectetuer adipiscing elit. "Donec hendrerit tempor tellus". Donec pretium posuere
> : tellus. Proin quam nisl, tincidunt et, mattis eget, convallis nec, purus. Cum sociis
> : natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
>
>> #+begin_src emacs-lisp :noweb strip-export :exports code
>> (defun foo ()
>> <<docstring1()>>
>> (message "hello world"))
>> #+end_src
Both of these options look awesome! Thank you for sharing!
The first (org-block) for long-form text (like official javadoc), the
second (just verbatim) for shorter docstrings.
They finally solve a long-standing problem for me.
Best wishes,
Arne
--
Unpolitisch sein
heißt politisch sein,
ohne es zu merken.
draketo.de
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 1125 bytes --]
next prev parent reply other threads:[~2022-11-02 7:56 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-01 14:07 Docstrings and literate programming (good practices?) Juan Manuel Macías
2022-11-02 7:13 ` Ihor Radchenko
2022-11-02 7:53 ` Dr. Arne Babenhauserheide [this message]
2022-11-02 10:43 ` Ihor Radchenko
2022-11-02 12:49 ` Juan Manuel Macías
2022-11-02 13:05 ` Ihor Radchenko
2022-11-02 15:20 ` Juan Manuel Macías
2022-11-03 7:38 ` Ihor Radchenko
2022-11-03 20:54 ` Rudolf Adamkovič
2022-11-04 3:03 ` Samuel Wales
2022-11-04 5:45 ` tomas
2022-11-04 6:39 ` Marcin Borkowski
2022-11-04 7:13 ` Samuel Wales
2022-11-04 8:08 ` tomas
2022-11-04 8:06 ` tomas
2022-11-04 8:49 ` Ihor Radchenko
2022-11-05 2:07 ` Samuel Wales
2022-11-08 4:10 ` Samuel Wales
2022-11-04 11:45 ` Max Nikulin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r0ylvlh9.fsf@web.de \
--to=arne_bab@web.de \
--cc=emacs-orgmode@gnu.org \
--cc=maciaschain@posteo.net \
--cc=yantar92@posteo.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).