patched https://github.com/niklasfasching/go-org for orgwiki
The actual parameter parsing logic in emacs org mode is quite complex [1]. All we want for now is to handle parameter values containing spaces [2]. Splitting on ` :` gets us close enough for now. As I'm very opposed to copying 100 lines of parameter parsing logic just to get exports right let's wait for use cases - no hurt in gathering requirements as we go. [1] https://github.com/bzg/org-mode/blob/master/lisp/ob-core.el#L1481 [2] I never ran into such parameters before and wrongly assumed that splitting on spaces would be enough. boy was i wrong - just look at that massive function [1]! that's why we can't have nice things! |
||
---|---|---|
.github/workflows | ||
blorg | ||
etc | ||
org | ||
.gitignore | ||
go.mod | ||
go.sum | ||
LICENSE | ||
main.go | ||
Makefile | ||
README.org |
go-org
An Org mode parser and static site generator in go. Take a look at github pages
- for org to html conversion examples
- for a static site generated by blorg
- to try it out live in your browser
Please note
- the goal for the html export is to produce sensible html output, not to exactly reproduce the output of
org-html-export
. - the goal for the parser is to support a reasonable subset of Org mode. Org mode is huge and I like to follow the 80/20 rule.
usage
command line
$ go-org
USAGE: org COMMAND [ARGS]
- org render FILE OUTPUT_FORMAT
OUTPUT_FORMAT: org, html, html-chroma
- org blorg init
- org blorg build
- org blorg serve
as a library
see main.go and hugo org/convert.go
development
make setup install
- change things
make preview
(regenerates fixtures & shows output in a browser)
in general, have a look at the Makefile - it's short enough.
resources
-
test files
- https://orgmode.org/manual/
- https://orgmode.org/worg/dev/org-syntax.html
-
https://code.orgmode.org/bzg/org-mode/src/master/lisp/org.el
- 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: org, org-ruby, goorgeous, pandoc