From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/24458 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Re: Adding the highlight directive to the rST reader Date: Fri, 14 Feb 2020 14:40:59 -0800 Message-ID: References: <9e025799-6d50-40a9-b8ab-a075437cb2b9@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="36856"; mail-complaints-to="usenet@ciao.gmane.io" To: Lucas Escot , pandoc-discuss Original-X-From: pandoc-discuss+bncBCJZJHG45QDBBCOETTZAKGQEX6XXBTQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Feb 14 23:41:18 2020 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-qk1-f186.google.com ([209.85.222.186]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1j2je8-0009Tn-Tm for gtp-pandoc-discuss@m.gmane-mx.org; Fri, 14 Feb 2020 23:41:17 +0100 Original-Received: by mail-qk1-f186.google.com with SMTP id q2sf7240705qkq.19 for ; Fri, 14 Feb 2020 14:41:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1581720076; cv=pass; d=google.com; s=arc-20160816; b=R0SLNt0ZVCCTlsnb6wLc4IIwDLY5yohThjG+4TgqNFSQWNyxf5CyxAjqQ1EFyd/U8t j/fi9uLfalpl7zQirKbYxzlhy9yp18D4ORoKacEpG2g+rDLWBqwdkCOl7hzWVTO/M3sj xHzdt9UIn+lg/OvUMnXn7cIMGX1nnFoOAxxvcsyFKPjNq0rXHW/CDBy36i2kgxX4M2kg 74RJvXT8vuOzOfMqAzJ4mDn7m+tJ1hyjRN2pmg/8Az0vOCJzB09ieWBwDxSLeNR6nteZ 5IlWns9TnpQ75uS66SOtTX2YEK7erARK2JC32BnhNgQaBuPsfXC0c9q8atPf5ah7JAEp h8vg== 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:reply-to:content-transfer-encoding :mime-version:message-id:date:references:in-reply-to:subject:to:from :sender:dkim-signature; bh=kNqNgjxd8htwmpkZDvoVlrVycYDk7NodM9fGl+akKto=; b=WnaSuVabNr/NQ0KN0fUYYnvtyqhaT4itvJu86+xGeOU4pWKlgFpQ0pOFTbHDnxDcmI bsEDBzi2oYxIsDqJN3b7jp6fl60zonK5yoYWZdt29jzXdyXtEiB647W7s6Nrr4cP0CTM mthvkFN8kk9Zh2uHM+jvz/XGfT7KRFnaxN1keeb/EO+dUQWA2AQMRwPXQFqPuuwVpKaw 5Oa3US+vhlSbnLrAFYT5edk1p9hYNfFDDRPYgQlX1ozG8FLJeS+vJsxnNsnPKXsTnr/Y fIEY6aehMSHJPOSi8718WO2z/UEbq+ctMs8HJiAa+/zG3MjbdmwKZJDDNSdzWq1qfic/ 4dhQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=wqyIGDVX; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::42e as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:to:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=kNqNgjxd8htwmpkZDvoVlrVycYDk7NodM9fGl+akKto=; b=dRrus05C/CMul33v7pfSBSgORoX9UCjq9W22y9gSmPG31Swq+ydEv+idjuvDNi4UyZ 2PXx2+bGQUI6xrLC2a7mQD+/gxOxwl7XpjR/7ujmwpgVCuNoMOrlIJFp+AXVbFMQM8nb zex1XHd0HwCIZVBRvGJ6jTsr1zYSDqSM92o/ijeksNKPd1gwDuJBPOif/EQ/DL+g3J+9 xSzxbz2UGUoIjBy8efuguh43Lb5AQn6d9J9ps8QMZUOs1BIpygyLZMGYann1B5ICoRxE RLIdW3Km5feL9IQNeJa8Td859kFqlwoLtTQpCESFyHFnMhF0wh9R/+4iw4MOP5hAeuW+ UBIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:to:subject:in-reply-to:references :date:message-id:mime-version:content-transfer-encoding :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=kNqNgjxd8htwmpkZDvoVlrVycYDk7NodM9fGl+akKto=; b=GfN+GXG5FK4f64IYwntT17OtU+ztPQ2Ssat2SUzbTX/sOvtWNUlKQ3DRUjrD9vZUWZ F1SzX8Gjv6Fq7aDm7wu9INzi3OxanbULWXbTpGxRbHVfGDOP2hBW/wmkoJTUKSrj9h7O K//4Xsla6rwW5t8TZ5WBVZFvJQDUk3ZUjVzIGSaKCetgfDoAY7LFbLAf8XomGf2+yUpH l8Os7PpOkQAgs7iIxa2mQMypMv9htYdqNdh2e367ifFoSC5TRgS4QfnlrtfamPfUvh/f Gj89o1HzaaXxXcEHtJRMZLkN5/QeuNOnnvKoNNOjEJORLIhko+jZJOIRqGiS92IwuE9z Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: APjAAAWtjMyNga3FzP7hxhARBc37NNIqsp6lLknqTPDqqN3/RgOH7Ys+ +3K1hrWPUdFIyV7QXxUYtkE= X-Google-Smtp-Source: APXvYqxCsTZhT6fCb0sSQ2Ib/7aBUDbnoNwJdbHgB0NS6lLgqOrEKXR4ABdpXHDxX7NzrvoW1Raq0w== X-Received: by 2002:a05:620a:63b:: with SMTP id 27mr4123888qkv.159.1581720076057; Fri, 14 Feb 2020 14:41:16 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:ac8:38e3:: with SMTP id g32ls1337461qtc.5.gmail; Fri, 14 Feb 2020 14:41:13 -0800 (PST) X-Received: by 2002:ac8:4798:: with SMTP id k24mr4497546qtq.16.1581720073220; Fri, 14 Feb 2020 14:41:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581720073; cv=none; d=google.com; s=arc-20160816; b=d0Ut75DPLXzABZIon37bFnNdL1IfZhGhkCU4lPpnP72GE3aqpqT59addhhwRvTcYnv cmqgeZNn2Udt/W4QsFewESjViPL/UXOjVspAcskcY5n1237cOxui77j9ohMQlPiFxFGx vjF6Gt6dvfkATkjfpsQBrw4CF0hvpsCkEThWuXS6qHjZZxuNoGRjiuBCG5L+PbX5LUMZ l8U7qt3xHcJYwc1JxGM3WogYsfnsa01zlaUZUxb4Mpvc+4MbGq1mIAtH7osMHks1JduY HvRJtTUk1yC18yZtT1cCSaiOhkxey5sg5dmj8dr9rC+bjpUZDvgXuPySEmtjnJq5uXnH zKTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:to:from:dkim-signature; bh=ENRX83rC5lSGZqAwImECM/eQxUuZfQThNXrtRi7d+yg=; b=XjDkUYvjBTyhUGM4adqS+HUStvUJQxtJprY67ei0YUuFfKNA/dz9S1CSEpW/HNMxta mpz1HLcokAEArc43Czd4IZpXB+06mrMnLf8lxENRZ1scDejG5w/VSvXBuC34ADrcvr7X VmPZQHlzoX4rJldiFSBs2swFDeChsza4SRijy24yrshMkax4HQkatzPY/0eEfDpo2yiF 4Y4H+Bwir/lK1N96kvi9EugKqlmjKxSODODvhEuvTjBFVWcOjObxz8QJ89mI3maCPi7z Nmen0upacgDzwls+uoRj6HzbrYNTgjrGWCqZpMkHwpefWMd7C3Fk7Oz8Itm7EykglzXT 6dfw== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=wqyIGDVX; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::42e as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org Original-Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com. [2607:f8b0:4864:20::42e]) by gmr-mx.google.com with ESMTPS id r62si311450qkc.6.2020.02.14.14.41.13 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 14 Feb 2020 14:41:13 -0800 (PST) Received-SPF: pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::42e as permitted sender) client-ip=2607:f8b0:4864:20::42e; Original-Received: by mail-pf1-x42e.google.com with SMTP id s1so5541725pfh.10 for ; Fri, 14 Feb 2020 14:41:13 -0800 (PST) X-Received: by 2002:a63:7019:: with SMTP id l25mr5727286pgc.132.1581720072125; Fri, 14 Feb 2020 14:41:12 -0800 (PST) Original-Received: from johnmacfarlane.net (li55-134.members.linode.com. [74.82.3.134]) by smtp.gmail.com with ESMTPSA id y127sm8166945pfg.22.2020.02.14.14.41.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Feb 2020 14:41:11 -0800 (PST) Original-Received: by johnmacfarlane.net (Postfix, from userid 1000) id D3C5AA231; Fri, 14 Feb 2020 17:40:59 -0500 (EST) In-Reply-To: X-Original-Sender: jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=wqyIGDVX; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::42e as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@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:24458 Archived-At: I don't know what they all look like: can you link to a list? Maybe it would be a good idea to add a sphinx extension. Lucas Escot writes: > Thank you very much for such a quick merge. > > For the rest of Sphinx directives, should I go ahead and make an extensio= n=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=A9cri= t : >> >> >> 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.h= tml#directive-highlight>=20 >> >> > to the pandoc rST reader.=20 >> > This allows one to specify the default language to use when highlighti= ng=20 >> > literal blocks.=20 >> > It is especially useful when writing rST in a literate agda or literat= e=20 >> > haskell file, where it is undesirable to have to specify the language = at=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 t= o=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 peop= le=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 creat= e=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= email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit https://groups.google.com/d/msgi= d/pandoc-discuss/a6188c4b-d574-4fa3-b0ec-a5f1fd6e03f9%40googlegroups.com. --=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/yh480kh7zskd1g.fsf%40johnmacfarlane.net.