I went through the issues of goorgeous and picked a few that seemed easy enough to add (and added some fore as todos for later). That helped a lot and showed some bugs / edge cases that required changes. - the org writer wrote a lot of eol spaces and just removed it whenever String() was actually called. That worked until now but did not bode with rendering an empty headline - by removing ALL eol space we would render "* " back as just "*" -> not a headline anymore. - the html writer had some special handling for line spacing inside paragraphs and list items - with the introduction of more blocks we need that handling everywhere. As browsers / html renderers are nice enough to collapse whitespace (and especially collapse "\s*\n" into " ") we can just write out the newlines and let the renderer take care of the rest.
30 lines
1.7 KiB
Org Mode
30 lines
1.7 KiB
Org Mode
A basic org-mode parser in go
|
|
* motivation
|
|
- have a org-mode AST to play around with building an org-mode language server
|
|
- hopefully add reasonable org-mode support to hugo - sadly [[https://github.com/chaseadamsio/goorgeous][goorgeous]] is broken & abandoned
|
|
* next
|
|
- handle #+RESULTS: raw and stuff
|
|
- hugo frontmatter - see https://gohugo.io/content-management/front-matter/
|
|
- captions: images, tables & blocks
|
|
*** TODO [[https://github.com/chaseadamsio/goorgeous/issues/72][#72:]] Support for #+ATTR_HTML
|
|
*** TODO [[https://github.com/chaseadamsio/goorgeous/issues/46][#46]]: Support for symbols like ndash and mdash
|
|
- see org-entities replacement: see org-entities-help
|
|
*** TODO [[https://github.com/chaseadamsio/goorgeous/issues/10][#10]]: Support noexport
|
|
*** TODO [[https://github.com/chaseadamsio/goorgeous/issues/19][#19]]: Support #+HTML
|
|
*** TODO [[https://github.com/chaseadamsio/goorgeous/issues/31][#31]]: Support #+INCLUDE
|
|
- see https://orgmode.org/manual/Include-files.html
|
|
*** TODO [[https://github.com/chaseadamsio/goorgeous/issues/33][#33]]: Wrong output when mixing html with org-mode
|
|
* later
|
|
- affiliated keywords: see org-element.el - org-element-affiliated-keywords
|
|
- keywords: support both multi (e.g. LINK, TODO) & normal (e.g. AUTHOR, TITLE) keywords
|
|
- links based on #+LINK
|
|
- table colgroups https://orgmode.org/worg/org-tutorials/tables.html
|
|
- table pretty printing
|
|
* resources
|
|
- syntax
|
|
- https://orgmode.org/worg/dev/org-syntax.html
|
|
- https://github.com/abo-abo/org-mode/blob/mirror/lisp/org.el
|
|
- https://github.com/abo-abo/org-mode/blob/mirror/lisp/org-element.el
|
|
- test cases
|
|
- [[https://github.com/bdewey/org-ruby/blob/master/spec/html_examples][org-ruby]]
|
|
- pandoc, goorgeous
|