Re:Org-Mode Is One of the Most Reasonable Markup Languages t...
by sondr3 on Wednesday April 10, 2019 @09:07AM
(#19624220)
Do you have a public repo for your blog? I couldn't find anything on GitHub.
[ Parent
| on HN ]
Re:Org-Mode Is One of the Most Reasonable Markup Languages t...
by TeMPOraL on Wednesday April 10, 2019 @05:26PM
(#19628951)
Nah, the generator is so full of garbage code that I keep it as a private repo. The generator handles both new posts (org-exported to HTML) and old posts (Wordpress exports I dumped to org mode).
A partial snippet of the code that handles new posts:
https://gist.github.com/TeMPOraL/c401f12d50d4e1d4f94492e3d0f...
What's happening is that I take the HTML generated by Emacs Org Mode exporter, deserialize it to DOM, select a block corresponding to contents (to cut out superfluous stuff I don't need), and then run a bunch of tree-walkers that massages the DOM until it becomes something I can wrap with my site's scaffolding and dump into a file. It's really ugly, but gets the job done.