A trick I have been using is to include custom bits as code/raw spans/blocks with classes/'formats' and parse and convert them to an AST fragment in a filter, which is way easier than writing a custom parser for whole files (and used to be the only viable option.) TBH I have mostly done so in JSON filters written in Perl, but now that lpeg and re are available in Lua filters they are a serious contender too.

A tip: if custom bits in syntax X are much more common than actual code elements it makes sense to leave the former unmarked and give the latter a pseudo-class `.code` if you don't want them highlighted.

/bpj

Den tis 21 dec. 2021 09:52 <denis.maier-NSENcxR/0n0@public.gmane.org> skrev:
That's maybe true. So what's your take on that? Do you think including a Haskell interpreter would be a good idea?

> -----Ursprüngliche Nachricht-----
> Von: John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>
> Gesendet: Samstag, 18. Dezember 2021 20:46
> An: Maier, Denis Christian (UB) <denis.maier-NSENcxR/0n0@public.gmane.org>; pandoc-
> discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> Betreff: Re: AW: custom writer with haskell
>
>
> <denis.maier-NSENcxR/0n0@public.gmane.org> writes:
>
> > Does that have to be included? Can't one rely on Haskell being available? I
> mean, just like with Haskell filters....
>
> By the time you've got your environment set up with ghc and all the libraries
> installed properly, which you'd need to run interpreted writers, you might as
> well just recompile pandoc with the revised module.  I don't see a big
> advantage.

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/c8f145c9d80f470f9adea4e3df82aab4%40unibe.ch.

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CADAJKhCa0EuqdOvnnrhC18N5RemA5KVdFmqQRajw8ZsMdfQeAA%40mail.gmail.com.