need include for div

This commit is contained in:
Yu Cong 2025-04-20 21:27:40 +08:00
parent 887ff7b069
commit 8e8ac86037
4 changed files with 30 additions and 9 deletions

View File

@ -1,7 +1,6 @@
#!/usr/bin/env runhaskell
-- filter.hs
import Text.Pandoc.JSON
( Block(CodeBlock), ToJSONFilter(toJSONFilter) )
import qualified Data.Text.IO as TIO
import qualified Data.Text as T

View File

@ -1,5 +1,17 @@
Here's the pandoc README:
~~~~ {include="input.md"}
this will be replaced by contents of README
~~~~
:::{include="filter.hs"}
:::
::: Theorem
test thm1
:::
:::{.Theorem #thm2}
test thm2
:::
:::{class="Theorem" id="thm3"}
test thm3
:::

View File

@ -1,5 +1,8 @@
.PHONY: filter showAST
.PHONY: filter showAST nofilter
nofilter:
pandoc -fmarkdown -thtml input.md > output.html
filter:
pandoc -fmarkdown -thtml input.md --filter ./filter.hs > output.html

View File

@ -1,6 +1,13 @@
<p>Heres the pandoc README:</p>
<pre data-include="input.md"><code>Here&#39;s the pandoc README:
<div data-include="filter.hs">
~~~~ {include=&quot;input.md&quot;}
this will be replaced by contents of README
~~~~</code></pre>
</div>
<div class="Theorem">
<p>test thm1</p>
</div>
<div id="thm2" class="Theorem">
<p>test thm2</p>
</div>
<div id="thm3" class="Theorem">
<p>test thm3</p>
</div>