4 ms·
Came here just to say that. I had a static blog written in org-mode and converted it over to markdown a couple of weeks ago because there's no good way of conve
by terhechte 8y ago
Came here just to say that. I had a static blog written in org-mode and converted it over to markdown a couple of weeks ago because there's no good way of converting org-mode to html except by running emacs. So for each article, getting a html representation requires firing up emacs. That's insane.
If there were good (and fast!) js, c, python, etc libraries to fully support parsing org-mode to AST and HTML, only then would it be a viable solution for markup.
- rakoo 8y agoIf you're turning markup formatted files into html there is pandoc (https://pandoc.org/ https://pandoc.org/) for that
- Naac 8y agoDid pandoc not convert org files to HTML correctly?
- ekns 8y agoPandoc only handles a subset of org-mode markup. IIRC last time I tried this (long ago) there were a number of gaps in things like org-mode tables. At the limiting case, the (common or uncommon) elisp extensions (e.g. org-babel) will likely never be processed by third-party tools.
- disgruntledphd2 8y agoIf you put the results of org-babel into the buffer, then pandoc handles everything OK. The one problem I have with pandoc is that when using word export, it loses the table and figure numbers. Mind you, at least I only have to put those in outside emacs :)
- otikik 8y ago> Pandoc only handles a subset of org-mode markup. To me that's got the same drawbacks as "not standardized". If not all of the existing tools support the standard then there are several de facto standards.
- s7atic 8y agoEmacs can run as an elisp interpreter, check out the '--script' switch. This makes it possible to run org-export without starting an emacs session.
- kqr 8y agoI was just about to say. The GP sounds like they're saying > there's no good way of converting <markup language> to html except by running <preferred converter>. So for each article, getting a html representation requires firing up <preferred converter>. That's insane.
- terhechte 8y agoAnd how do I use that when I want to interactively convert org-mode to html in javascript? Like countless pure-javascript markdown libraries allow me to do? not to mention the security hazards of running emacs with any user input from a website.
- kqr 8y agoThat you don't – much like you don't get Pandoc Markdown in JavaScript, because Pandoc is not written in JS. But if you are content with a less featured variation of the markup language (but still more featureful than Markdown), you can get that for JavaScript too: https://xiaoxinghu.github.io/orgajs/syntax https://xiaoxinghu.github.io/orgajs/syntax
- terhechte 8y agoAnd how do I use that when I want to interactively convert org-mode to html in javascript? Like countless pure-javascript markdown libraries allow me to do? not to mention the security hazards of running emacs with any user input from a website.
- yepguy 8y agoOK, but you just switched use cases from a "static blog" to interactive web page with untrusted inputs.
- TeMPOraL 8y agoThat's a fair point. My own blog runs a two-step process: I export org-mode posts to HTML with Emacs/Org-Mode exporter, and then rewrite the result in my static generator.
- sondr3 8y agoDo you have a public repo for your blog? I couldn't find anything on GitHub.
- TeMPOraL 8y agoNah, 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/c401f12d50d4e1d4f94492e3d0f6a126 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.
- db48x 8y agoThat eight megs of memory is a pretty terrible price.
- melling 8y ago8MB fits in L3 cache these days.
- nambit 8y agoYeah. I use markdown hosted file and do the markdown -> html conversion entirely clientside via http://dynalon.github.io/mdwiki/#!index.md http://dynalon.github.io/mdwiki/#!index.md. I don't think it's possible to do that at all with orgmode?
- singingfish 8y agoPandoc makes me extremely happy. My consultant wanted a .doc file the other day: `pandoc -f org -t support_brief.org -o support_brief.docx` Of course the canonical format for pandoc is markdown.
- zeckalpha 8y agoAnd Hakyll is a static site generator based on Pandoc, letting you leave your site source in whichever markup you choose.
- omaranto 8y agoTo be specific, the canonical format for Pandoc is Pandoc Markdown, which is still my favorite flavor of Markdown (I guess Github-falvored is my second favorite). But Org Mode is even nicer than Pandoc Markdown, so I used Pandoc to convert all my files to Org Mode.
- BeetleB 8y agoI use Pelican for my static blog, and it takes both markdown and rst. I've automated the process: I convert org to rst using pandoc, and let Pelican take it from there. I literally made a Pelican plugin to do it - so my content directory now just has org files. So far, I've not seen any major issues.
- omaranto 8y agoFirst, pandoc does a pretty decent job of converting Org Mode to HTML or several other formats. Second, "firing" up Emacs sounds odd to Org Mode's target audience. :) We already have Emacs open! (I typed this comment in Emacs). I don't know how hard it is to make a nice looking website in Org Mode, but to make bland websites for academics (like this schmuck's page: https://www.matem.unam.mx/~omar/ https://www.matem.unam.mx/~omar/), I think Org Mode and org-publish are great. And probably it's not harder to make a nice website with org-publish than with anything else: the trick is being willing to learn CSS. :)
- mruts 8y agoWhat’s wrong with pandoc? I use org-mode but only export with pandoc because it works better.
- zaiste 8y agoKulfon [1] is a static site generator that compiles Org Mode to HTML without using Emacs. You can just drop `.org` files in a directory and run a one-command tool to make this work. I use it for my website, mostly to write blog posts. It is also possible to mix Markdown and Org Mode files in a single project/directory. Kulfon is my own project, so take it with a grain of salt. I've decided to focus on Org Mode as I also believe this format doesn't get the recognition it deserves. It doesn't mean Markdown is bad, au contraire, it is almost perfect. In Org Mode, for instance, I still cannot get used to the source code blocks. It is, however, good to have a choice. The Org Mode support in Kulfon is not perfect yet, but good enough for most situations. It is based on a JavaScript plugin by Xiaoxing Hu called orgajs [2]. You can use it directly in your project. One of the motivations for building a SSG with Org Mode was Org Brain [3]. I have a plenty of interconnected notes that I would like to publish on my website « as-is ». This would be rather difficult to do using Markdown format. [1]: https://kulfon.org/ https://kulfon.org/ [2]: https://github.com/xiaoxinghu/orgajs https://github.com/xiaoxinghu/orgajs [3]: https://github.com/Kungsgeten/org-brain https://github.com/Kungsgeten/org-brain