From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/29826 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: BPJ Newsgroups: gmane.text.pandoc Subject: Re: AW: custom writer with haskell Date: Tue, 21 Dec 2021 15:18:39 +0100 Message-ID: References: <51f4c7e7b63344adb5967a8bfe3e50c8@unibe.ch> <4eb30ae54aea41cd9fdb2aa207f4b96e@unibe.ch> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000eb45e505d3a8ae58" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33624"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCWMVYEK54FRBR6EQ6HAMGQEALL2ZJI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Tue Dec 21 15:18:50 2021 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-wr1-f64.google.com ([209.85.221.64]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mzfyc-0008Vf-6l for gtp-pandoc-discuss@m.gmane-mx.org; Tue, 21 Dec 2021 15:18:50 +0100 Original-Received: by mail-wr1-f64.google.com with SMTP id v18-20020a5d5912000000b001815910d2c0sf4749998wrd.1 for ; Tue, 21 Dec 2021 06:18:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1640096329; cv=pass; d=google.com; s=arc-20160816; b=n8joNVpsIJ2ucJhWp0W1OlNR5pWjSvdjiculwdnO6TVwDiBRSAWwrpXPRrtCZnMSZW rvgfbrsmxBXeiypC/ZX6xtSggYUFlUNhLg6ymYqMhe8f/go4Dsslor3ItPtl5/ZiIgDE XDDdH4emmXYlyrdsGWrw6rboSzMMjdvJ2IhhN8CwwjIqATRLB2X6/1XD61Bk0ExRLr+w ybNhKvg8k2QUPI/T3Ljsxn7epTPGMoKMPshvyJ4A2lR5VxckZKqvEtr0DVLrNrLmDc82 BhZnoD2gGvsGukb34RNYdF+KhRPveuFwKoYYUWKy3Sqqx+43Qrm2bbIwMA0NbHkVuL9I LH0g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:to:subject:message-id:date:from :reply-to:in-reply-to:references:mime-version:sender:dkim-signature; bh=LTPvmrwT3nYNUxshHoK2vGtNxajZdbkjQGTxG7LUYbE=; b=wc62J3L2oRkxxtd9WFT0cph3uGLMdpJrD7bdgiFR4vH/C0oDlDWuk8NgJNjIoxMv+G cdn3JgHDr5jTCtHhJSn8PN6LB/J6n39aOlCOEeOUFjrXICSnN4nbrx1+WavXPzgF6DGB RVJvRYuYtOfhLNXOw2yM+JBEFJ6C+pHRnFkPwfGGywMAtMsjtZ6acF9lFBRB12q+b6b8 JjlzxZW5WOUr6jz9dLpT1uT7kdIjE7bjme3w8O3045I1TyZedzJmXjsIwUlMDQ0MTJsd HlHD03rU8wYwptxCfrRl1RwU1G/CHsH9KOLWKDzazSsZloP/WhH6EalDUJvCo5HZgLHt 9mHA== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 209.85.167.42 as permitted sender) smtp.mailfrom=melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:mime-version:references:in-reply-to:reply-to:from:date :message-id:subject:to:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=LTPvmrwT3nYNUxshHoK2vGtNxajZdbkjQGTxG7LUYbE=; b=A12LX7jRftteE/7aDlKvJ7GZ5ryktBracew2HmLaOrWblqqEkGHnLX4s9kqIhhsFDe 593iHM6hRyWrAV1Ir85951119/m01OulnI/50paSQVN877y1+ue3+XA+3BNy+4PRmNIk nN+yxmMAi0GhcExdpYl0oe5OzizHfLAiaEeFSBxREKxtP8mh90seLgOzC0UY7hWC1RNl bAxwjX9QVZX4mIj+jvXfw+f0yHSaNzKfbX5KzxdEsaoGOyJN2MY6yRwAzRJw9q7RXFZv Q3nfk+5/l1GssAeESBjY2aDxWituQC35xs1dTQ9AFvI2SYH9PGaBIsfg5LzzKfmSgojB sRRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:mime-version:references:in-reply-to :reply-to:from:date:message-id:subject:to:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=LTPvmrwT3nYNUxshHoK2vGtNxajZdbkjQGTxG7LUYbE=; b=lj7d271kTZy5DmkJzuC3kkfKo3mKTP1mrOLqjpb7zUOt5WyAUkU9Me2g4uRYPrNlQr vJz6uAduV6hkjhr2jkib9dDcCxVU2LPrNsMGuZ9LyuzcpQv5W5AkomW6tuz37fW/RUpH vEsCDMNRv4yeU1UAOmo86zmDtAhY0eKsCOzb46aUTjwYvalxi5bRUWY+qH2PkT5XXFLV d09nuHvS/FnonxXEAT1SjrqJlQcRSFk2V99Tn6ycrV+VxpHNqRJAVsMwmCb2pUXu7eo0 FlWRAUyeWg+ejnzpyTRGSIASgNyWQQWMwtcqe4lfsmWoNiDMskaUQ1GCyMsgYDuBBzbe AeRA== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM531L/8Mp6sW/kVUOk/dNi36WGtSBXbIpXlrNihwGmORCaeQWnTVl s7zqw5Jr8w8Rd/n+aDRFeB8= X-Google-Smtp-Source: ABdhPJwzjdICxsTPgH3O+2djIazjyXBd27ZaRfec0S4/VI5YCj4b4R0loM9T7rdJUxkJ9ru0tg1gpQ== X-Received: by 2002:a05:6000:2ce:: with SMTP id o14mr2890514wry.70.1640096329513; Tue, 21 Dec 2021 06:18:49 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a5d:522c:: with SMTP id i12ls9722277wra.0.gmail; Tue, 21 Dec 2021 06:18:47 -0800 (PST) X-Received: by 2002:adf:aac7:: with SMTP id i7mr2917181wrc.537.1640096326939; Tue, 21 Dec 2021 06:18:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1640096326; cv=none; d=google.com; s=arc-20160816; b=BrIscwfzTF3jjI125YXNVlTYcpTzaH+JB2iCNcoEHmwhBVMAavpUwjQvHWmL7z6gLH dU3Eh2NQPSYzZk2IMwyu2CbEseSP/O6NdOzi3qzgHENUWVoR9w+eMbYNGuP0hW6oq8p3 IOZHcC2Rx1/4FYtpK1+bnwdQfJL+KGgjzpDsJO3C88WJ4sZ871BbtOc6HcxKkL8G3nBP nADJ6pS+Hy8BF33wwlFmOKWDvvYyc6JzOn1etKZtv57w3l758/iI2SakLFPfrsZRT3nc w/C+/F/QNGyvZ8Af/AAPhle6RSFUBNJIDGYHCUtkdkeX5S4zB1Yj3vmSnMgR5TnVtXM1 629g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version; bh=Tgt2ZJC3qJUxMp5f+r4+h+dvdSelqAtXcaQHHoZqsd4=; b=QXQMiOciLTzHdozclIAt062cmAEV5JyEIHNxAQWEkJ5Ugn8+zdsvxbtWUz3XDs24uV rpDALUhrX3RMJmFDPZe95f0AUGqiFZZSaI63t0Q77INWOQfWtzhf9hNJ18v7EbExExUm 9d2RNcvh9EI84caE9AERNv1bJ+tDE34to9CGwEZkl4CIRoTb3gskHjCEBld4PhJkBCdP Df8zZmJ8DI3lGoQelzpNdpKGoYEIAUzHdRUU6CDkYU5cwKpKBWu/9DaF6SIoOPgj/Vpn 4BCBgGGdDzdGsrc2jdNHqgYSEFJsBdWDc+ubsQSCfrVE4Ha8f+Znd9Sm6GXZhcKbH/yK 7lMw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 209.85.167.42 as permitted sender) smtp.mailfrom=melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Original-Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com. [209.85.167.42]) by gmr-mx.google.com with ESMTPS id j23si234171wms.4.2021.12.21.06.18.46 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 21 Dec 2021 06:18:46 -0800 (PST) Received-SPF: pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 209.85.167.42 as permitted sender) client-ip=209.85.167.42; Original-Received: by mail-lf1-f42.google.com with SMTP id k37so29726490lfv.3 for ; Tue, 21 Dec 2021 06:18:46 -0800 (PST) X-Received: by 2002:a05:6512:261b:: with SMTP id bt27mr3134350lfb.68.1640096326173; Tue, 21 Dec 2021 06:18:46 -0800 (PST) In-Reply-To: X-Original-Sender: melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 209.85.167.42 as permitted sender) smtp.mailfrom=melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.io gmane.text.pandoc:29826 Archived-At: --000000000000eb45e505d3a8ae58 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 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=C3=BCngliche Nachricht----- > > Von: John MacFarlane > > Gesendet: Samstag, 18. Dezember 2021 20:46 > > An: Maier, Denis Christian (UB) ; pandoc- > > discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > > Betreff: Re: AW: custom writer with haskell > > > > > > 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/c8f145c9d80f470f9adea4e3= df82aab4%40unibe.ch > . > --=20 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 e= mail 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.g= mail.com. --000000000000eb45e505d3a8ae58 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
A trick I have been using is to include custom bits as co= de/raw spans/blocks with classes/'formats' and parse and convert th= em to an AST fragment in a filter, which is way easier than writing a custo= m parser for whole files (and used to be the only viable option.) TBH I hav= e 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 u= nmarked and give the latter a pseudo-class `.code` if you don't want th= em highlighted.

/bpj

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

> -----Urspr=C3=BCngliche 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>; pa= ndoc-
> 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 bein= g available? I
> mean, just like with Haskell filters....
>
> By the time you've got your environment set up with ghc and all th= e libraries
> installed properly, which you'd need to run interpreted writers, y= ou might as
> well just recompile pandoc with the revised module.=C2=A0 I don't = see a big
> advantage.

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

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.= google.com/d/msgid/pandoc-discuss/CADAJKhCa0EuqdOvnnrhC18N5RemA5KVdFmqQRajw= 8ZsMdfQeAA%40mail.gmail.com.
--000000000000eb45e505d3a8ae58--