Add support for Table of Contents

This commit is contained in:
Niklas Fasching 2018-12-26 16:00:27 +01:00
parent eb7db9b968
commit d921a68a55
7 changed files with 218 additions and 41 deletions

View file

@ -4,12 +4,14 @@ Take a look at [[https://niklasfasching.github.io/go-org/][github pages]] for so
* next
- more keywords: https://orgmode.org/manual/In_002dbuffer-settings.html
- table of contents
- see hugo ExtractTOC
- loop the headlines and print an hX for each headline, ul for children
- rethink frontmatter
- keyword customizable mapping. e.g. #+ARRAY_KWS: list kws that should become []string
- json/yaml values.
- +lisp syntax from [[https://github.com/kaushalmodi/ox-hugo/blob/master/ox-hugo.el#L2791][ox-hugo]]+
- too much complexity and not native to Org mode, i.e. does not even increase compatibility
- use toml/yaml/json frontmatter from hugo (see [[https://github.com/gohugoio/hugo/issues/5436][hugo #5436]])
- use toml/yaml/json frontmatter from hugo (see [[https://github.com/gohugoio/hugo/issues/5436][hugo #5436]]):
- complex values are a requirement of hugo, not Org mode
- by giving up on the ability to mix front matter in org keyword (=#+=) and other formats we save a lot of complexity (that has little benefit)
- Maybe allow for []string via KEYWORD[]: Tag Foo Bar - can be done in hugo
-> the other problem is that org mode normally allows markup in the title - but we would have to render - and to what format
** headlines
- auto-generate unique ids: see [[https://github.com/kaushalmodi/ox-hugo/blob/8472cf2d8667754c9da3728255634e8001a1da6d/ox-hugo.el#L1785-L1850][ox-hugo]]
- what about name conflicts?
@ -41,3 +43,4 @@ Nonetheless, the html output can be compared by taking a look in the developer c
- https://code.orgmode.org/bzg/org-mode/src/master/lisp/org-element.el
- mostly those & ox-html.el, but yeah, all of [[https://code.orgmode.org/bzg/org-mode/src/master/lisp/]]
- existing Org mode implementations: [[https://github.com/emacsmirror/org][org]], [[https://github.com/bdewey/org-ruby/blob/master/spec/html_examples][org-ruby]], [[https://github.com/chaseadamsio/goorgeous/][goorgeous]], [[https://github.com/jgm/pandoc/][pandoc]]