From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/24446 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Lucas Escot Newsgroups: gmane.text.pandoc Subject: Adding the highlight directive to the rST reader Date: Thu, 13 Feb 2020 02:30:40 -0800 (PST) Message-ID: <9e025799-6d50-40a9-b8ab-a075437cb2b9@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_2746_254535191.1581589840359" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="103863"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDZ7ZA4N5AOBBUOKSTZAKGQEFFCO6WQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Feb 13 11:30:45 2020 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-ot1-f56.google.com ([209.85.210.56]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1j2Bld-000Quq-Ec for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 13 Feb 2020 11:30:45 +0100 Original-Received: by mail-ot1-f56.google.com with SMTP id n22sf2848481otr.23 for ; Thu, 13 Feb 2020 02:30:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:date:from:to:message-id:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=qXyhmmC1xZZd0U8g4EUFlIBH7rwZ8yOn7M2fjrim2c0=; b=CTJJQN/crP1XPjFdxuVeG8ibOe30meKQdixwPnHxcgCkhvBzFzyfUX2rfEod8Cmrqh Bij3pEghMo+LU561m+Qp1koq4mK3RJJqCigQKoVZIvXZUWSFLonpfKpTqdDXSOQvE0Nm DreacaMh+0fXecF71aGefLOBfQwyEfXRF5sVoXR342/rSN/Zg+DMH2pENd+jgrQgCRwL 0J286c+G7D/XOb7a/aZiEYFR/pDSngnloaoe6V9UPJa0H3qPZ70fJ3Izh2Wd0iYUMxL2 lCDUoBBaxtsHug6TjVvoArHd8qP12bEtL3W/slbZhoe0QjXe2jct7Zax5b6KltOc+Iqt BV3g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:message-id:subject:mime-version:x-original-sender :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:list-subscribe:list-unsubscribe; bh=qXyhmmC1xZZd0U8g4EUFlIBH7rwZ8yOn7M2fjrim2c0=; b=J0DxX95u2HsA2ImkmAvJt7VYPj3tMK2aXzkvT9kCLbYesCb+3Va+G6yxTGM3FCw05z 4OXbhs9VGawK7qRbvm0crj8yiwBtWCV7XIoUPIvwV7GzxuaNf5Jp9oeA+KE5nNjjQ2Dv cyvKfa4NZcq4jvPeIDIti9SeXCtyenKGwKOz4sC+W9uQ7qQPGGiA0vgpcLWRfIzxnR1p RzHWw8vdgzzjVLzb0vY3LGNwGnE26hReJZJuducG7EJeelfH/bIo+84qofTviV8XQ4CE 0GWpK3J+IZGS2/kqfPlR/85tjTxELvUcuIBubT16jidTbXhZIBKUGNQxuRQmN1qMzP2x 8Izw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:date:from:to:message-id:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=qXyhmmC1xZZd0U8g4EUFlIBH7rwZ8yOn7M2fjrim2c0=; b=Ka/3trB5IpcZHamH7YCAPBycmIMRkZXQdhr/8bqas1Op6QyYdOsPSAnNXVoywZpF/F 4ivxSuzisR2qi7lS9OZhV/ykgFzysCh9+EUy1xdkTibFyvVYZklFAlq0dNLUrU56R2MU SV46gLsJ8TCshiXtwAlvavuYwXbQqDqVKbJFprxpLFNuXL0Lnhuf3KP166ZZSMWGdhWN OeJsofK0gSaenr5vEJHJDl1gkA6MOZus8qw9zafHvQwoz9XkSSMoqIQlkQp+qwjqx6P4 eOI3UwLxonZqu/YYuZV+rcGVyCg+IqRR+2q/dAi6unExTDCk48JdWqjkV+mg7tbQ8591 znbg== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: APjAAAU494/T0BLZIn7xiT1tGsyNC/KejAe8DdthGd+nScIlOhRdGWqZ s68hg3rv+0S63783EZC1m/A= X-Google-Smtp-Source: APXvYqxpw6Lrd58a7scgYxYTVR0aTlTeMOkYWlCCFuJn384upqYrXHT+frCmsHm6qo2Qs+K6DBuCwQ== X-Received: by 2002:a9d:6e05:: with SMTP id e5mr12912182otr.46.1581589844413; Thu, 13 Feb 2020 02:30:44 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a9d:7dd6:: with SMTP id k22ls5373204otn.5.gmail; Thu, 13 Feb 2020 02:30:41 -0800 (PST) X-Received: by 2002:a9d:12a2:: with SMTP id g31mr6006752otg.283.1581589840865; Thu, 13 Feb 2020 02:30:40 -0800 (PST) X-Original-Sender: lucas.escot-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:24446 Archived-At: ------=_Part_2746_254535191.1581589840359 Content-Type: multipart/alternative; boundary="----=_Part_2747_155840062.1581589840359" ------=_Part_2747_155840062.1581589840359 Content-Type: text/plain; charset="UTF-8" Hello everyone, I just implemented the highlight directive to the pandoc rST reader. This allows one to specify the default language to use when highlighting literal blocks. It is especially useful when writing rST in a literate agda or literate haskell file, where it is undesirable to have to specify the language at every code block. .. highlight:: haskell >From now on code will be highlighted as haskell:: data Tree = Leaf | Node Tree Tree An other exemple too show how terse using literal blocks becomes:: main :: IO () main = putStrLn "Hello World!" We can change the language at any point in the document. .. highlight:: python So this block contains python code:: def main(): print("OK") An we can still disable having a default language: .. highlight:: This directive comes from the Sphinx extended rST (which argueably is one of the most popular use case of rST out here, see readthedocs.io), this is why I am wondering *what is your stance on adding directives to the pandoc reader?* (which are not specified in the docutils reference) My opinion is that such an addition is quite reasonable, and most people use rST with sphinx and are therefore accustomed with said directive already. You can see my implementation here: https://github.com/flupe/pandoc If you all agree it can be merged, what is the process? Should I create an issue mentionning the problem or just make a PR? Best, Lucas -- 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/9e025799-6d50-40a9-b8ab-a075437cb2b9%40googlegroups.com. ------=_Part_2747_155840062.1581589840359 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello everyone,

I just imple= mented the highlight directive to the = pandoc rST reader.
This allows one to specify the default languag= e to use when highlighting literal blocks.
It is especially usefu= l when writing rST in a literate agda or literate haskell file, where it is= undesirable to have to specify the language at every code block.

.. high= light:: haskell
<= br>
From now on code = will be highlighted as haskell= ::

= =C2=A0 data
Tree =3D Leaf | Node = Tree Tree

An other exemple too show how ter= se using literal blo= cks becomes::
=C2=A0 main
:: IO <= /span>()
=C2=A0 main
=3D putStrLn
"Hello World!&q= uot;

We can change the = language at any point in the document.
.. highlight:: python

So this block contains python code::


=C2=A0
def main():
=C2=A0 =C2=A0
print("OK")

An we can still disable having a default language:

.. highlight::

This directive comes from th= e Sphinx extended rST (which argueably is one of the most popular use case = of rST out here, see readthedocs.io),
this is why I am wondering = what is your stance on adding directives to the pandoc reader? (whic= h are not specified in the docutils reference)

My = opinion is that such an addition is quite reasonable, and most people use r= ST with sphinx and are therefore accustomed with said directive already.

You can see my implementation here: https://github.com/flupe/pandoc
<= br>
If you all agree it can be merged, what is the process? Shoul= d I create an issue mentionning the problem or just make a PR?
Best,
Lucas

--
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/9e025799-6d50-40a9-b8ab-a075437cb2b9%40googlegroups.co= m.
------=_Part_2747_155840062.1581589840359-- ------=_Part_2746_254535191.1581589840359--