From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/29761 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Gregory D. Weber" Newsgroups: gmane.text.pandoc Subject: Re: Two treatments of same input file Date: Fri, 10 Dec 2021 19:08:41 -0500 Message-ID: References: <736c254f-44fe-49f8-9556-2f4c83c4e5a0n@googlegroups.com> <84047109-8502-490c-82fe-0104c3dfcfbdn@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="blaine.gmane.org:116.202.254.214"; logging-data="24208"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.36.5-0ubuntu1 To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBDVM5VNNVUEBBDGYZ6GQMGQEVGHBK3Y-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sat Dec 11 01:08:48 2021 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-pj1-f59.google.com ([209.85.216.59]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mvpwV-00068l-Mv for gtp-pandoc-discuss@m.gmane-mx.org; Sat, 11 Dec 2021 01:08:47 +0100 Original-Received: by mail-pj1-f59.google.com with SMTP id b11-20020a17090acc0b00b001a9179dc89fsf9158609pju.6 for ; Fri, 10 Dec 2021 16:08:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1639181326; cv=pass; d=google.com; s=arc-20160816; b=acypdi5tPuTvY0iUciwGbsovkrKE/1ImWiuS9CQr6MHjWrvT539X712/ymzpRvobNm 684VcfN/ytOI/aqOxiTrnAEdRH8QZMcsjsisMAYj6T8An0wxgcVPRzdGKV35Lm8oLtAx QuoDTGazanhRWPlP5LYTSYWrqGSYJI+EWrhkfT6YxLnqMwYXStdfYjSxSJgpOkBlf4Ib GMTJ91BXtdKvjYzNgi/UVuLHglqI6PleS05Jev8q17MmQjYb8R7DWRifXM7robvWknhz lfXI7xQZWot4lxmP13lF1jGKUOWWOU05zi0/iOGyl8Lee3nmVEzcYR5zOzweE4rJi7o4 NTMg== 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:user-agent:references:in-reply-to:date:to:from:subject :message-id:sender:dkim-signature:dkim-signature; bh=fw/7FVv7d9k+a7QPE+yPT/8jmyH0K2BQYzlVrAwExmM=; b=KjA4+Cm/trS7aVjQ3ExmfangI+DHBXBcNWrVVyLBWpHpi6Pxy5xTVSuaJUWPwtLRcN 27sO4CGdvdfiZ/aKa5/zL6y90DwSRffglrZI1o5aNpqbIoyTUmnKiXoLrLiDVN/vaHKj 1IUZf9e0+KFdsSN84dETyRkVRbXuCKZKsn8p44okRMOe1g6PDk606VHA5l+B3RUXXrA+ KX2yegTdErKDzwUpoEk6BYeTsmMapdnU79uow8qz0ta8jTrf33jzVyTruFYIkdOApyn2 5H1BcJWY3YhXkw0y7bived5mvRiJE5+CqtZInZm98a1cOmROChJJ8NrNfLFR13bdRXSu kiZg== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="WTL5ipd/"; spf=pass (google.com: domain of spottedmetal-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::730 as permitted sender) smtp.mailfrom=spottedmetal-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:message-id:subject:from:to:date:in-reply-to:references :user-agent: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=fw/7FVv7d9k+a7QPE+yPT/8jmyH0K2BQYzlVrAwExmM=; b=DqfY56DB9KXtH/jRT0eBEwGDVB9irpsCEgV0gThXYNpKVamD4rhWbWy4GlGfLaT4nP oytZc2UWcdnsfR8zr2lUjmfLMahfLd7UqXjpqPvk8PeFAAm66TTtBghpMeEHLuNtZXjJ FWjKEss2Wsnj/oWVt8hRJ7PmOGJ9oJ1bEV24rsI4y8jwicMFKTt8e+eUuvXBmKPq8f6h 4jh1Ea2jp1aopqnjp1hNijJaUhYnJxF43brIABmq0hetsCV0DCw2iI+VT/lfrU4jcjOB 2HlnOWwPzg3L4zK6cE2XQSNdZwA97UVKrnJnG6X4ioFASHNsTt/7aYFQZeteU3afby6W /9pA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :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=fw/7FVv7d9k+a7QPE+yPT/8jmyH0K2BQYzlVrAwExmM=; b=E+SWmDzAmLwlY/Dskw9Pw6D1Njc1WsNodsHL99a4Bk50/6XGuZuVNstSigE3k5yGJx 42EoIvpGd+SjsP5hBeYaptuajUM/v6tZ0XSYmyfN13TmLGVKMBznD+3OOJb9AJScLWFV NR/YeHQjYXrEmOW5oyK2FeHlt3Jem0FVzeSvJ+PN55VH8hibia2blHp4FB9z3NYFfGDK ydeE3P7Z9LKxIyd92DRFwNj/eGbfLNf+KJciu/qwhI/PwJ3yt2NxZOrM2MoYD6qFY7Ca U+w6CtfOhERvvYeFJOV9B8jw7TJs8tQtBAOYhdDuKVrWG+EMJGLbw9BGmcu2QVdm0YLl rAjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:message-id:subject:from:to:date :in-reply-to:references:user-agent: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=fw/7FVv7d9k+a7QPE+yPT/8jmyH0K2BQYzlVrAwExmM=; b=LqKPvWBnYHWYZgPXq6zHYw3A4km24zqk1WEttJt4BF8TlszcqE5HYH8VYSs5/tC+yG PamQpNHDlLyJarqUWxyEP6XEnDfsWPJDLx7zXJz/Ldvfh5AFeJBm4eW1l+8RcFP5cMvH 3T86TYoS5s9sFjSBdcwhnp6zN+jOxHjwRAfFIeGkhI6hB0ZrNSuUYmp3YCSdPgSuQ/90 9Y4FrxnfFERL0i+78/pIl5dhdubtppeVEYogIb0BvU53Jpoowmuq2eBi9SyrHfkgjA/Y /bFQrJVqkgzkYCavb0UVdPyqGryThbkbKTs9KEDFDpWJriXQ0DhZX Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM532g4MQj//wYzi6sUGtC+4uX4hqhHANz6dM8rKXHol+zVjNh29I6 6j3Dy68jPgJcuXof7vcZBEY= X-Google-Smtp-Source: ABdhPJwRyyGMkPE75KZmUIL+M5NDIEhKARqOCeRD4A0ipSu/mayJ4Rc5uIqguwe5NWvI9Hjg6r6WJw== X-Received: by 2002:a17:90a:6e0c:: with SMTP id b12mr27120549pjk.41.1639181325905; Fri, 10 Dec 2021 16:08:45 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a63:3501:: with SMTP id c1ls39211pga.3.gmail; Fri, 10 Dec 2021 16:08:44 -0800 (PST) X-Received: by 2002:a05:6a00:1248:b0:4a2:5cba:89cb with SMTP id u8-20020a056a00124800b004a25cba89cbmr21268837pfi.12.1639181324038; Fri, 10 Dec 2021 16:08:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639181324; cv=none; d=google.com; s=arc-20160816; b=R8eYPUFx2SIbyxYnD5U6cTDMy0VCRBrRrlgYjN6juFrpJ1EGKLQ5TYraXX7kpM3OwS hsKVZu/T/dImnr53v3BEYrLZcjc9IeOr2FHgmxh9UvE71yWjaMmg7XVrYD8DrQNnXMEz o6iZogNqLUOvlh0knuS6Crz4kwcvdbKo67KnPvgZsp2PoiLMz5kK1IgZhh5Ryp4yLEW3 /WxcNB7ACvcuhBNkH1t/wtUsoYngVcS2ojA+2/57FUtjZSulxLKX+W4J0vapj8YyIuj1 sEn827rhjf4w2dB30Qjq6ZxqSpt6syZER+qmkBlvJnTRT1QaSlBVQEI78opLVeA8TN8W Fj9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:to:from:subject:message-id:dkim-signature; bh=4sFTOp+tZRkUrSt7yYLA2j+4ak4/BK77vukpsrFnDSc=; b=vGlL4+wTE8xSLLoqL6XzUaeuFIz2saM2Ts+dZmJH34xO2Z+yMxpKHQJ8wMktcox1Ho ihYdM56j+FkhG3lQD/j2ITVJ4ro0nRjlEwBHg3Ody5iwR7ppqTkp7wxfDDipgdg3vbsa 4zZdetJRYW5CMBbyhsZMTS3/AsZPLeo1A+4Cza1xHMMaBphUYaOsipXSRfYVz6vQZqtg bt0PM/JTpFySJdFA4/enIutLR5YKI1OBTxRWp1UEtHWA543JYh/IyjJiFhtRpz0oISvv b87uOp9mvCm/eyb9hGMOPuQQ8+2V32j6NvJk+f7Nqs6O2KJ9jHav+MNLVNYD2+jYCS0E lz9g== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="WTL5ipd/"; spf=pass (google.com: domain of spottedmetal-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::730 as permitted sender) smtp.mailfrom=spottedmetal-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Original-Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com. [2607:f8b0:4864:20::730]) by gmr-mx.google.com with ESMTPS id a14si147285plh.0.2021.12.10.16.08.44 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 Dec 2021 16:08:44 -0800 (PST) Received-SPF: pass (google.com: domain of spottedmetal-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::730 as permitted sender) client-ip=2607:f8b0:4864:20::730; Original-Received: by mail-qk1-x730.google.com with SMTP id d21so1992188qkl.3 for ; Fri, 10 Dec 2021 16:08:43 -0800 (PST) X-Received: by 2002:ae9:ef0e:: with SMTP id d14mr23523599qkg.773.1639181322967; Fri, 10 Dec 2021 16:08:42 -0800 (PST) Original-Received: from sparrow ([192.182.185.234]) by smtp.googlemail.com with ESMTPSA id x13sm2381376qkp.102.2021.12.10.16.08.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Dec 2021 16:08:42 -0800 (PST) In-Reply-To: <84047109-8502-490c-82fe-0104c3dfcfbdn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Original-Sender: spottedMetal-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="WTL5ipd/"; spf=pass (google.com: domain of spottedmetal-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::730 as permitted sender) smtp.mailfrom=spottedmetal-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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:29761 Archived-At: This might work better for me since I am much more familiar with Python tha= n Lua. I didn't know there was a Pandoc library for Python! Thanks very muc= h. On Fri, 2021-12-10 at 07:39 -0800, S=C3=A9bastien Boisg=C3=A9rault wrote: >=20 >=20 > Le jeudi 9 d=C3=A9cembre 2021 =C3=A0 03:52:34 UTC+1, spotte...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org = a =C3=A9crit : > > I'm work on creating a set of examples of HTML, JavaScript, and SVG cod= e. > > Each comes from a single source file, from which I want to produce a > > web page showing > > (a) the result of rendering the HTML or SVG or executing the JavaScript= ; > > (b) the code itself, viewed as if in a text editor, and (ideally) with > > syntax highlighting. > >=20 > > The best way I can think of doing this involves making two > > transformations of the source file, running pandoc on each of them, > > and the combining the outputs, probably by running pandoc a third time > > with a custom template. > >=20 > > I'm wondering if there's any better way? >=20 > IMHO, you only need one call to pandoc: if you're ok with Python and with= the > pandoc python library (https://pypi.org/project/pandoc/), you could use t= he > following showcase.py script : >=20 > # file: showcase.py > import sys > import pandoc > from pandoc.types import Pandoc, Meta, CodeBlock, RawBlock >=20 > if __name__ =3D=3D "__main__": > filename =3D sys.argv[1] > with open(filename) as html_file: > html =3D html_file.read() > html_block =3D RawBlock("html", html) > attr =3D ("", ["html"], []) > code_block =3D CodeBlock(attr, html) > doc =3D Pandoc(Meta({}), [html_block, code_block]) > with open("out.html", "bw") as output: > pandoc.write(doc, file=3Doutput, format=3D"html", options=3D[= " > --standalone"]) >=20 > Then, if you call >=20 > $ python -m showcase.py form.html >=20 > where form.html is the HTML file >=20 >
> >
>=20 > you will end up with the desired output in the file "out.html". >=20 > Cheers, >=20 > SB > =20 > > Here's a small example: > >=20 > > (1) Original source file: > >=20 > >
> > > >
> >=20 > >=20 > > (2) Intermediate file 1: > >=20 > > ```{=3Dhtml5} > >
> > > >
> > ``` > >=20 > > (3) Intermediate file 2: > >=20 > > ~~~~{.html} > >
> > > >
> > ~~~~ > >=20 > > (4) Desired final output would be something like this: > >=20 > > ... > >=20 > >

A Form with a Button

> >=20 > >
> > > >
> >=20 > >

Code to Produce a Form with a Button

> >=20 > > > >=20 > > ... > >=20 >=20 > --=20 > You received this message because you are subscribed to a topic in the Go= ogle > Groups "pandoc-discuss" group. > To unsubscribe from this topic, visit=20 > https://groups.google.com/d/topic/pandoc-discuss/mfaEmeNEx7o/unsubscribe. > To unsubscribe from this group and all its topics, send an email to=20 > pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit=20 > https://groups.google.com/d/msgid/pandoc-discuss/84047109-8502-490c-82fe-= 0104c3dfcfbdn%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/fe5098cf12d71f2224fe6416f351e39c23a3fd26.camel%40gmail.com.