dangom / writefreely.el

*Frictionless* blogging with Org Mode. No setup required.
90 stars 7 forks source link

Perhaps a better fit as an org-export backend? #3

Open nikclayton opened 5 years ago

nikclayton commented 5 years ago

Have you looked in to writing this as an org-export backend?

The thread you mention in the post has some useful examples in http://lists.gnu.org/archive/html/emacs-orgmode/2018-11/msg00122.html, and there's a link to https://github.com/zzamboni/dot-emacs/blob/master/init.org#publishing-to-leanpub which might be helpful too.

Best.

dangom commented 5 years ago

Again, thanks a lot for your suggestions and comments. I appreciate it.

I thought about org-export-backend, but there were two issues that made me decide against it:

  1. I'm not truly creating an export backend, but simply calling (org-gfm-export-as-markdown).
  2. Publishing has file-local side-effects, which affect how subsequent publishing calls work (publish or update).

Not having this library as an export backend means I can benefit for any improvements in ox-gfm, or change to another backend at will, if a better one comes along. Also there's the obvious issue that I never wrote a backend, although I'd be open to learn how to do that.

I'll have a look at the leanpub export for inspiration. Maybe there's a better way to deal with side effects that does not involve tweaking file-local variables.