From: Gregory Weber <spottedmetal-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Two treatments of same input file
Date: Wed, 8 Dec 2021 18:52:34 -0800 (PST) [thread overview]
Message-ID: <736c254f-44fe-49f8-9556-2f4c83c4e5a0n@googlegroups.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 2269 bytes --]
I'm work on creating a set of examples of HTML, JavaScript, and SVG code.
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.
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.
I'm wondering if there's any better way?
Here's a small example:
(1) Original source file:
<form>
<input id="b1" type="button" value="Apply" title="Button"/>
</form>
(2) Intermediate file 1:
```{=html5}
<form>
<input id="b1" type="button" value="Apply" title="Button"/>
</form>
```
(3) Intermediate file 2:
~~~~{.html}
<form>
<input id="b1" type="button" value="Apply" title="Button"/>
</form>
~~~~
(4) Desired final output would be something like this:
...
<h2>A Form with a Button</h2>
<form>
<input id="b1" type="button" value="Apply" title="Button"/>
</form>
<h2>Code to Produce a Form with a Button</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode html"><code
class="sourceCode html"><a class="sourceLine" id="cb1-1" title="1"><span
class="kw"><form></span></a>
<a class="sourceLine" id="cb1-2" title="2"><span
class="kw"><input</span><span class="ot"> id=</span><span
class="st">"b1"</span><span class="ot"> type=</span><span
class="st">"button"</span><span class="ot"> value=</span><span
class="st">"Apply"</span><span class="ot"> title=</span><span
class="st">"Button"</span><span class="kw">/></span></a>
<a class="sourceLine" id="cb1-3" title="3"><span
class="kw"></form></span></a></code></pre></div>
...
--
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/736c254f-44fe-49f8-9556-2f4c83c4e5a0n%40googlegroups.com.
[-- Attachment #1.2: Type: text/html, Size: 3087 bytes --]
next reply other threads:[~2021-12-09 2:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-09 2:52 Gregory Weber [this message]
[not found] ` <736c254f-44fe-49f8-9556-2f4c83c4e5a0n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-12-09 9:48 ` Bastien DUMONT
2021-12-09 20:29 ` Gregory D. Weber
2021-12-10 15:39 ` Sébastien Boisgérault
[not found] ` <84047109-8502-490c-82fe-0104c3dfcfbdn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-12-11 0:08 ` Gregory D. Weber
[not found] ` <fe5098cf12d71f2224fe6416f351e39c23a3fd26.camel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2021-12-11 22:23 ` Sébastien Boisgérault
[not found] ` <b7669818-66ed-4336-af6e-f41eec4cd6f5n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-12-16 1:16 ` Gregory Weber
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=736c254f-44fe-49f8-9556-2f4c83c4e5a0n@googlegroups.com \
--to=spottedmetal-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).