go-org-orgwiki/org/testdata/keywords.pretty_org
Niklas Fasching 7c239a7aeb html: Add support for #+TOC keyword
org mode allows rendering the toc anywhere in the html document using the `TOC`
keyword [1]. There's more options but `#+TOC: headlines $n` should be enough
for starters. Note that org mode still requires setting `#+OPTIONS: toc:nil` to
disable the default toc

[1] https://orgmode.org/manual/Table-of-Contents.html
2021-03-28 17:12:25 +02:00

34 lines
928 B
Text

#+OPTIONS: toc:nil
* captions, custom attributes and more
#+CAPTION: and _multiple_
#+CAPTION: lines of *captions*!
#+ATTR_HTML: :class a b
#+ATTR_HTML: :id it :class c d
#+BEGIN_SRC sh
echo "a bash source block with custom html attributes"
#+END_SRC
and an image with custom html attributes and a caption
#+CAPTION: kittens!
#+ATTR_HTML: :style height: 100%; :id overwritten
#+ATTR_HTML: :style border: 10px solid black; :id kittens
[[https://placekitten.com/200/200#.png]]
#+NAME: foo
named paragraph
#+NAME: bar
#+BEGIN_SRC
named block
#+END_SRC
# comments must have whitespace after the hashtag
#not a comment because there's no space after the hashtag
* table of contents
A table of contents can be rendered anywhere in the document by using
#+BEGIN_SRC org
,#+TOC: headlines $n
#+END_SRC
Where =$n= is the max headline lvl that will be included. You can use =headlines 0= to include all headlines.
#+TOC: headlines 0