public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: BPJ <bpj-J3H7GcXPSITLoDKTGw+V6w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: AW: custom writer with haskell
Date: Tue, 21 Dec 2021 15:18:39 +0100	[thread overview]
Message-ID: <CADAJKhCa0EuqdOvnnrhC18N5RemA5KVdFmqQRajw8ZsMdfQeAA@mail.gmail.com> (raw)
In-Reply-To: <c8f145c9d80f470f9adea4e3df82aab4-NSENcxR/0n0@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 2519 bytes --]

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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CADAJKhCa0EuqdOvnnrhC18N5RemA5KVdFmqQRajw8ZsMdfQeAA%40mail.gmail.com.

[-- Attachment #2: Type: text/html, Size: 3927 bytes --]

      parent reply	other threads:[~2021-12-21 14:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-17 14:05 denis.maier-NSENcxR/0n0
     [not found] ` <51f4c7e7b63344adb5967a8bfe3e50c8-NSENcxR/0n0@public.gmane.org>
2021-12-17 22:35   ` John MacFarlane
     [not found]     ` <yh480kfsqq2735.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2021-12-18 12:06       ` AW: " denis.maier-NSENcxR/0n0
     [not found]         ` <ee9cbe9414d947799907c62bce1408a8-NSENcxR/0n0@public.gmane.org>
2021-12-18 12:32           ` denis.maier-NSENcxR/0n0
     [not found]             ` <4eb30ae54aea41cd9fdb2aa207f4b96e-NSENcxR/0n0@public.gmane.org>
2021-12-18 19:45               ` John MacFarlane
     [not found]                 ` <m21r297l3x.fsf-d8241O7hbXoP5tpWdHSM3tPlBySK3R6THiGdP5j34PU@public.gmane.org>
2021-12-21  8:51                   ` AW: " denis.maier-NSENcxR/0n0
     [not found]                     ` <c8f145c9d80f470f9adea4e3df82aab4-NSENcxR/0n0@public.gmane.org>
2021-12-21 14:18                       ` BPJ [this message]

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=CADAJKhCa0EuqdOvnnrhC18N5RemA5KVdFmqQRajw8ZsMdfQeAA@mail.gmail.com \
    --to=bpj-j3h7gcxpsitlodktgw+v6w@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).