novoid / lazyblorg

Blogging with Org-mode for very lazy people
GNU General Public License v3.0
397 stars 33 forks source link

Rewrite orgparser.py with a proper parser for Org-mode syntax #63

Open novoid opened 2 years ago

novoid commented 2 years ago

The initial and current parser is a naïve linear parser. It comes with some drawbacks:

With switching to a really good Org-mode (orgdown?) parser, the lazyblorg syntax possibilities as well as the maintenance could be improved.

xeruf commented 1 year ago

If I understand it correctly the current parser is there to allow running some syntax-bound features. Why not separate these functions from the export, i.e. run them first and then simply use native org mode html export?

novoid commented 1 year ago

If I understand it correctly the current parser is there to allow running some syntax-bound features.

The current parser parses some lazyblorg-specific things such as support for tsfile links and so forth, yes.

Why not separate these functions from the export, i.e. run them first and then simply use native org mode html export?

Which export? There is not export involved yet. So you must have a totally different workflow in mind which I can not follow.

You suggest to use "native org mode html export". I guess you would assume to use the Elisp functionality to export single orgdown headings to separate HTML files, right? If so, this would require massive pre- (tsfile links, ...) and postprocessing (side-bar, header, footer, ...) steps as well as an efficient way of using Emacs functionality which I don't see at this point. The whole templating mechanism and all of its built-in features would not work any more.

This would most probably require the whole lazyblorg functionality moved to Elisp which is a total new rewrite which I can not accomplish due to lack of Elisp and lack of time/motivation to do so. Unfortunately, lazyblorg works perfectly fine for my now.

xeruf commented 1 year ago

One can call elisp from the CLI, and I thought it is possible to add HTML templates in for export. I was just thinking that with this lots of idiosyncracies like missing italics and required empty lines could be fixed though native emacs functionality.

novoid commented 1 year ago

One can call elisp from the CLI, and I thought it is possible to add HTML templates in for export.

That's possible, yes. In my opinion only with a completely rewrite in Elisp because hundreds or thousands of Emacs invocations most certainly does not scale at all for re-building a blog. You don't have to forget that lazyblorg re-generates everyting with each invocation. It's not just build the new articles. Any new article can have massive influence on all the others such as "most frequently used tags", links, and so forth.

I was just thinking that with this lots of idiosyncracies like missing italics and required empty lines could be fixed though native emacs functionality.

It works for me without italics. Certainly good enough for not changing the architecture of the parser for it.

Although replacing the naïve parser with a "proper" one would have lots of advantages, the current one does the job with the current known limitations which is OK to me. The only thing that could happen to make me think of going into that direction is a proven OrgDown Python parser from the community so that lazyblorg is pushing the idea of OD.

xeruf commented 1 year ago

See also https://github.com/novoid/lazyblorg/issues/2

I am all for pushing OD, btw :)