patched https://github.com/niklasfasching/go-org for orgwiki
Go does not support inheritance, just composition. While composition with type embedding (i.e. forwarding method calls to the embedded type) can replace inheritance for most use cases this is not one of them. We really want to overwrite methods so that method calls from inside the base writer also use the custom methods ouf our extending writer - naive embedding does not work here as the this in this.WriteText refers to the embedded type rather than the outer extending type (see open recursion). A simple solution is to make a reference of the extending type available from the extended type and use that for nested method calls. We'll go with that one as it does not require huge code changes. Another solution would be to flatten the writing process and not use nested method calls - this is what blackfriday does. Assuming the current solution works I feel it's cleaner and keeps the ugliness of simulating inheritance with composition contained to a small portion of the code while blackfridays approach requires all write methods to be written in a flat style (i.e. not do nested calls to write by being called twice with entering / leaving). The current solution becomes ugly if we want to do multiple levels of extending but i don't expect that to be a valid use case - if it turns out to be one we can always adapt to it later. YAGNI. |
||
---|---|---|
etc | ||
org | ||
.gitignore | ||
.travis.yml | ||
LICENSE | ||
main.go | ||
Makefile | ||
README.org |
- go-org https://travis-ci.org/niklasfasching/go-org.svg?branch=master
- development
- not yet implemented
- resources
go-org https://travis-ci.org/niklasfasching/go-org.svg?branch=master
An Org mode parser in go.
Take a look at github pages for some examples and an online org -> html demo (wasm based).
Please note that the goal for the html export is to produce sensible html output, not to exactly reproduce output the output of
org-html-export
.
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.
not yet implemented
deadlines and scheduling
more types of links
see https://orgmode.org/manual/External-links.html & https://orgmode.org/manual/Internal-links.html
- radio target <<<MyTarget>>>
- link target: <<go-org>>
- link: /OrgWiki/go-org-orgwiki/src/commit/14900e97e20d41070e4d9a2918857e9b4e1c4032/go-org
- link to headline
- links with image as description
- MyTarget <- this will automatically become a link - not sure i want this…
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