public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: Albert Krewinkel <albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: Open Discussion: Features of Templating
Date: Tue, 09 May 2023 21:37:02 +0200	[thread overview]
Message-ID: <875y91s2ni.fsf@zeitkraut.de> (raw)
In-Reply-To: <0297ad79-799e-4ed4-aa5b-943c124f7f55n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>


Stephan Meijer <me-nPKYAObcRdo6Blr+0TYHagC/G2K4zDHf@public.gmane.org> writes:

> Maybe at this stage it'd even be easier to be able to decouple the
> templating engine from Pandoc, so people can use their own templating
> engine.

It's almost possible to do that already, custom writers get us something
like 80 % of the way there: any Lua template engine with a compatible
interface could be used in theory. The limitations are:

- The pandoc.template.meta_to_context function is difficult to use with
  built-in writers.

- The custom writers cannot access the template variables that are
  auto-generated by a built-in writer.

Both limitations could be fixed by exporting more of the writer
internals from the respective Haskell modules, and then in turn to
expose those to Lua. Not difficult, but a good bit of typing, API
changes, and the need to break-down abstractions (making writers less
opaque). Could be nice to have, but I'm not sure if the result would
justify the effort and downsides.


-- 
Albert Krewinkel
GPG: 8eed e3e2 e8c5 6f18 81fe  e836 388d c0b2 1f63 1124


  parent reply	other threads:[~2023-05-09 19:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-09 14:08 Stephan Meijer
     [not found] ` <dbe4c60c-1178-406f-b794-ce8c9807c2c1n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-05-09 17:35   ` BPJ
     [not found]     ` <CADAJKhC=5P-rTeCFbuuVE+5YG7b2ND7r+0v7vQGoEzFOyAjsDw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2023-05-09 19:16       ` Stephan Meijer
     [not found]         ` <0297ad79-799e-4ed4-aa5b-943c124f7f55n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-05-09 19:37           ` Albert Krewinkel [this message]
     [not found]             ` <875y91s2ni.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
2023-05-09 20:51               ` John MacFarlane

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875y91s2ni.fsf@zeitkraut.de \
    --to=albert+pandoc-9eawchwdxg8hfhg+jk9f0w@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).