mandolyte / mdtopdf

Markdown to PDF
MIT License
135 stars 33 forks source link

Syntax highlight codeblocks #30

Closed jessp01 closed 1 year ago

jessp01 commented 1 year ago
jessp01 commented 1 year ago

Hi @mandolyte ,

Glad you like it:) I created a pull with a small adjustment, see https://github.com/mandolyte/mdtopdf/pull/31.

As to adding another example, of course, feel free to add whatever you feel is right but I should note that the current ./cmd/convert.go can also be altered such that the default creation of pf becomes:

            pf = mdtopdf.NewPdfRenderer("", "", *output, "trace.log",
                    mdtopdf.SetSyntaxHighlightBaseDir("../highlight/syntax_files"))

This will work correctly because I added gohighlight as a submodule.

jessp01 commented 1 year ago

Also, following your comments in this commit: https://github.com/mandolyte/mdtopdf/commit/e361b3dcca804a186209fea1b28db96e300f5d1a, see my commit here: https://github.com/jessp01/gohighlight/commit/8bad7b78d45adec360c9d1d838724ca32b6bafd3

With this symlink in place

console.log("hello work")

Will also work.

It might be worth adding a note in README about cloning with the submodule:

$ git clone --recursive  https://github.com/mandolyte/mdtopdf

To update the submodule, just run git submodule update --remote from your clone and push:)