From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/24456 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Lucas Escot Newsgroups: gmane.text.pandoc Subject: Re: Adding the highlight directive to the rST reader Date: Fri, 14 Feb 2020 11:44:57 -0800 (PST) Message-ID: References: <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_3476_1667756052.1581709498037" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="24717"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDZ7ZA4N5AOBBO7RTPZAKGQENLAZZ7A-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Feb 14 20:45:02 2020 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-ot1-f57.google.com ([209.85.210.57]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1j2gta-0006KC-FG for gtp-pandoc-discuss@m.gmane-mx.org; Fri, 14 Feb 2020 20:45:02 +0100 Original-Received: by mail-ot1-f57.google.com with SMTP id z62sf5779601otb.0 for ; Fri, 14 Feb 2020 11:45:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:date:from:to:message-id:in-reply-to:references:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=xQW6sYW0KGLq8UdkRnJ3lWfip3QixOokS4AT/A47LtU=; b=nm1+NvM5WtVk9sQS2sJGlqMLUB1uXLfzfsxzpgWSbw0fuxw47eh2iOo7uIm0tyZZFi IFy5CIIPA4EZLuXu3T4QMI9a1ecpzHau0Q96rBiOf+qVY56yura1b506q0iq9RgmE0d3 x39tbY/of/GlDOnQSp+gop29Z6o4bK+ZyH4zYmszrudtrWfdq3esxdWIct6PN91iDU3W IS20GZ9XMJmpDA8jrt0Qn9E2JpWi3CD4izrT32PlFqXlPzsSQfPSXkMLIuCrq+tTRh9d rOA23Qh2FOnq6Qj80L57SqnXCkGe2HkdbWlfPa5HEeg/SEyuS4P8fWcDcJgU8s7xueeT gAjA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=xQW6sYW0KGLq8UdkRnJ3lWfip3QixOokS4AT/A47LtU=; b=o+RO0WKkOeZRTxOxuVflVmPNnRXjF2JsrySAr85GeavlN8QeqWOdCfzRj7u+iBTj0X RCW/SXlZgBjETnTZ0YYgZRNG141dEQk41GfTTsifkt25pI5ukVU9xILAEgM6yTko8Y+k Qs6/L7qP41dcbGhTQqngllKzfs8yb+YYAJY/n4T299J7wIOQpKWz7ymVcxosTWxMJQdZ 2H75W1SUeVU4yK8dSLvzVR9/55Hk8VL0OTFFth/tF1OsA/sBdr8u5OadMhCFZ+PTlJYf YurAlnHzuattj1B6Uz8TxGsSlr1cOEUIqjFWxMKhlhLvx+I26f46DFpFuEzB4q6RpGw1 RLAA== 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:in-reply-to :references: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=xQW6sYW0KGLq8UdkRnJ3lWfip3QixOokS4AT/A47LtU=; b=gMTWltNKsVyszD+cWXsHXVNUNnQEiF33coKPxBthqjF6/jZ8qIH49HQIuv2yDr1Yfs PcAUzWS+60dUCq8C1cgkK8GYjRq1UP9yTNlZIN0AHo0JJ24dyR0jJPHI4dwY9l4mGwb8 4Gy63nq65b6RsAWPZ1ZnratO9o8ldATWIkvrMTCDgbLiDUPSQ5GHaWKOTUaMh9VWZFFv cCM7q/1Xdz0H8rjElkMwAy5X9ZlISDbjE5WfZc+LQa4ROj0Qq0+hS9Muawptm3iMNmuj Ond2EOokFRC951hxPwB1APQQ1XLdrRCWIdllO9Oyt06OL5E3/10nS/hJWzEIvbCZsaL+ xqJw== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: APjAAAX1UsQX5kJ7I1Y+5GhJKWr08h96DfT0az3Mq71eH9ydlrQKKmmd 38EYYdmyqNOSN8AeDPGePJU= X-Google-Smtp-Source: APXvYqzwbnS7DQjoS22sBpFd1uzBxUCf7QsbRbS6bKdlgVBA2uFjg6P7BcAGWG/88Y5dwf5ntMWTNw== X-Received: by 2002:aca:1b11:: with SMTP id b17mr3012638oib.45.1581709501404; Fri, 14 Feb 2020 11:45:01 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:aca:7282:: with SMTP id p124ls887462oic.4.gmail; Fri, 14 Feb 2020 11:44:59 -0800 (PST) X-Received: by 2002:aca:2806:: with SMTP id 6mr2838304oix.64.1581709498745; Fri, 14 Feb 2020 11:44:58 -0800 (PST) In-Reply-To: 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:24456 Archived-At: ------=_Part_3476_1667756052.1581709498037 Content-Type: multipart/alternative; boundary="----=_Part_3477_1810733719.1581709498037" ------=_Part_3477_1810733719.1581709498037 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thank you very much for such a quick merge. For the rest of Sphinx directives, should I go ahead and make an extension= =20 or would you feel comfortable having them under vanilla rST too? Le jeudi 13 f=C3=A9vrier 2020 17:29:36 UTC+1, John MacFarlane a =C3=A9crit = : > > > Yeah, even though it's a sphinx extension, I think I'd be=20 > comfortable merging that. Does anyone disagree? The procedure=20 > would be to submit a PR.=20 > > Lucas Escot > writes:=20 > > > Hello everyone,=20 > >=20 > > I just implemented the highlight directive=20 > > < > https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.ht= ml#directive-highlight>=20 > > > to the pandoc rST reader.=20 > > This allows one to specify the default language to use when highlightin= g=20 > > literal blocks.=20 > > It is especially useful when writing rST in a literate agda or literate= =20 > > haskell file, where it is undesirable to have to specify the language a= t=20 > > every code block.=20 > >=20 > > .. highlight:: haskell=20 > >=20 > > From now on code will be highlighted as haskell::=20 > >=20 > > data Tree =3D Leaf | Node Tree Tree=20 > >=20 > > An other exemple too show how terse using literal blocks becomes::=20 > >=20 > > main :: IO ()=20 > > main =3D putStrLn "Hello World!"=20 > >=20 > > We can change the language at any point in the document.=20 > >=20 > > .. highlight:: python=20 > >=20 > > So this block contains python code::=20 > >=20 > > def main():=20 > > print("OK")=20 > >=20 > > An we can still disable having a default language:=20 > >=20 > > .. highlight::=20 > >=20 > > This directive comes from the Sphinx extended rST (which argueably is= =20 > one=20 > > of the most popular use case of rST out here, see readthedocs.io),=20 > > this is why I am wondering *what is your stance on adding directives to= =20 > the=20 > > pandoc reader?* (which are not specified in the docutils reference)=20 > >=20 > > My opinion is that such an addition is quite reasonable, and most peopl= e=20 > > use rST with sphinx and are therefore accustomed with said directive=20 > > already.=20 > >=20 > > You can see my implementation here: https://github.com/flupe/pandoc=20 > >=20 > > If you all agree it can be merged, what is the process? Should I create= =20 > an=20 > > issue mentionning the problem or just make a PR?=20 > >=20 > > Best,=20 > > Lucas=20 > >=20 > > --=20 > > You received this message because you are subscribed to the Google=20 > Groups "pandoc-discuss" group.=20 > > To unsubscribe from this group and stop receiving emails from it, send= =20 > an email to pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org .=20 > > To view this discussion on the web visit=20 > https://groups.google.com/d/msgid/pandoc-discuss/9e025799-6d50-40a9-b8ab-= a075437cb2b9%40googlegroups.com.=20 > > --=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/a6188c4b-d574-4fa3-b0ec-a5f1fd6e03f9%40googlegroups.com. ------=_Part_3477_1810733719.1581709498037 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thank you very much for such a quick merge.

For the rest of Sphinx directives, should I go ahead and ma= ke an extension or would you feel comfortable having them under vanilla rST= too?

Le jeudi 13 f=C3=A9vrier 2020 17:29:36 UTC+1, John MacFa= rlane a =C3=A9crit=C2=A0:

Yeah, even though it's a sphinx extension, I think I'd be
comfortable merging that. Does anyone disagree? =C2=A0The procedure
would be to submit a PR.

Lucas Escot <lucas...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> Hello everyone,
>
> I just implemented the highlight directive=20
> <https://www.sphinx-doc.org/en/master/usage/restructuredt= ext/directives.html#directive-highlight>=20
> to the pandoc rST reader.
> This allows one to specify the default language to use when highli= ghting=20
> literal blocks.
> It is especially useful when writing rST in a literate agda or lit= erate=20
> haskell file, where it is undesirable to have to specify the langu= age at=20
> every code block.
>
> .. highlight:: haskell
>
> From now on code will be highlighted as haskell::
>
> =C2=A0 data Tree =3D Leaf | Node Tree Tree
>
> An other exemple too show how terse using literal blocks becomes::
>
> =C2=A0 main :: IO ()
> =C2=A0 main =3D putStrLn "Hello World!"
>
> 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 the Sphinx extended rST (which argueably= is one=20
> 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 directiv= es to the=20
> pandoc reader?* (which are not specified in the docutils reference= )
>
> My opinion is that such an addition is quite reasonable, and most = people=20
> use rST with sphinx and are therefore accustomed with said directi= ve=20
> 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 c= reate an=20
> issue mentionning the problem or just make a PR?
>
> Best,
> Lucas
>
> --=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 email to pandoc-...@googlegroups.com.
> To view this discussion on the web visit https://groups.= google.com/d/msgid/pandoc-discuss/9e025799-6d50-40a9-b8ab-a075437= cb2b9%40googlegroups.com.

--
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/a6188c4b-d574-4fa3-b0ec-a5f1fd6e03f9%40googlegroups.co= m.
------=_Part_3477_1810733719.1581709498037-- ------=_Part_3476_1667756052.1581709498037--