Skip to content
holzkohlengrill edited this page Dec 15, 2023 · 2 revisions

Synthax highlightning

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)

--standalone

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)

Code line numbering in markdown

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")

.docx >> .md

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:

  1. Replace:
    • > by >
    • &lt by <
    • \_ by _
  2. Fix \n's and trailing spaces
  3. Add newlines before (unordered) lists if needed (check rendering for idientification)
  4. Fix headings to #-style (depending on personal preference)
  5. Remove / manually replace html tags if existing

Decoding error

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 ....
Clone this wiki locally