-
Notifications
You must be signed in to change notification settings - Fork 0
pandoc
holzkohlengrill edited this page Dec 15, 2023
·
2 revisions
Does only work with fenced code.
iconv -f latin1 -t utf-8 meeting-notes.md | pandoc -f markdown -t html5 --highlight-style=pygments --standalone -o test.html
# ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^ ^^
# from format to ~ synthax highlighting style produce output file
# standalone
# document
# (incl. header + footer)
Needed for proper synthax highlighning in f.ex. in html documents. The default will create only fragments (just "translates" the segments wihtout header and footer)
Your code block would look like this:
``` {.python .numberLines startFrom="100"}
import blah
print("yay")
```
This can also be achieved (depending on renderer) by:
:::markdown
import blah
print("yay")
pandoc -s example30.docx --no-wrap --reference-links -t markdown -o example35.md
Best results so far for me but this needs some manual clean-up afterwards:
- Replace:
-
>
by>
-
<
by<
-
\_
by_
-
- Fix
\n
's and trailing spaces - Add newlines before (unordered) lists if needed (check rendering for idientification)
- Fix headings to
#
-style (depending on personal preference) - Remove / manually replace html tags if existing
E.g. pandoc.exe: Cannot decode byte '\xe4': Data.Text.Internal.Encoding.Fusion.streamUtf8: Invalid UTF-8 stream
.
Pipe through iconv
:
iconv -f latin1 -t utf-8 inputFile.md | pandoc ....
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License *.
Code (snippets) are licensed under a MIT License *.
* Unless stated otherwise