I'm writing notes in Markdown which I want to convert to HTML using Pandoc, so that they're prettier when I look back over them. I am aware that CSS styling can be applied to documents converted with Pandoc by using the -c option, like so:
pandoc "ExamPrep.md" -c style.css -o "ExamPrep.html"
But this just doesn't seem to be working for me. For example, style.css includes the styling in this SO answer to add borders to tables, but my tables in the outputted HTML have no borders.
As noted by this comment on a gist with CSS for lovely Pandoc HTML styling, the --standalone flag has to be included for CSS styling to work, i.e.,
pandoc --standalone "ExamPrep.md" -c style.css -o "ExamPrep.html"
The Pandoc documentation for --standalone says that it:
Produce[s] output with an appropriate header and footer (e.g. a standalone HTML, LaTeX, TEI, or RTF file, not a fragment).
Without it, the resulting HTML has no header, and hence, no way of referencing the CSS file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With