First, I wanted to express my gratitude for this list.
To recap, I am trying to find ways to optionally include text. The document I
am writing is mostly the same for all of the variations. I need to be able to
include or exclude text easily. Most of my needs have been met by people
responding on this list. I have one more need and that is with a description
list. I need to optionally include items in a description list.
For whatever reason, I started testing with unnumbered lists and I discovered
this.
> #+OPTIONS: d:("drawer")
>
> Some test blah blah blah
>
> * A list
> 1. Indented list
> * item 1 line 1 is before the drawer \\
> item 1 line 2
> :drawer:
> * item 2 inside the drawer \\
> item 2 line 2
> * item 3 inside the drawer \\
> item 3 line 2
> :end:
> * item 4 is after the drawer \\
> item 4 line 2
> 1. go out.
> 1. out here.
> * B list
> 1. and on and on
>
>
> Some test blah blah blah
>
> * A list
> 1. Indented list
> * item 1 line 1 is before the drawer \\
> item 1 line 2
> * item 2 inside the drawer \\
> item 2 line 2
> * item 3 inside the drawer \\
> item 3 line 2
> * item 4 is after the drawer \\
> item 4 line 2
> 1. go out.
> 1. out here.
> * B list
> 1. and on and on
>
When exported to HTML, the first list looks different from the second; this is
true whether the drawer is included or not. The top “Indented list” is wrapped
in a <p> tag which is why it has the extra space around it. The indent of the
:drawer: and :end: can be changed but the way I have it produce results which
is closest to what I’m trying to achieve. I have no idea if this might be a
bug or not.
Likewise, description lists has issues. When this is exported to HTML:
>
> * description heading 1 :: text for heading 1
> :drawer:
> * description heading 2 :: text for heading 2
> :end:
> * description heading 3 :: text for heading 3
> * description heading 4 :: text for heading 4
it ends up being three separate description lists.
But this seems to work:
> #+NAME: one-line
> #+HEADER: :var flag=0
> #+HEADER: :var string=""
> #+BEGIN_SRC elisp :exports none
> (if (eq flag 1)
> (string-replace "\n" "" string))
> #+END_SRC
>
> * description heading 1 :: text for heading 1
> call_one-line(0, "* description heading 2 ::
> text for heading 2")
> * description heading 3 :: text for heading 3
> call_one-line(1, "* description heading 4 ::
> text for heading 4")
> * description heading 5 :: text for heading 5
with the first call not producing anything in the export but the second one
does. The result of the babel call must be a single line but that is easy
enough by simply removing extra “\n” characters from the string when multiple
lines are used to make the text more legible.