Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Including a javascript file with pandoc when going from markdown to html

I am using pandoc to convert a markdown file to standalone html file. I have css file that I include with the -c command-line option. I would like to do the same thing with a javascript file, but I have not found an option to include script files similar to the -c option.

Is there such an option? If not, what is the most efficient way to do the inclusion?

like image 835
equaeghe Avatar asked May 10 '26 21:05

equaeghe


1 Answers

Use the header-includes variable in the YAML metadata header (and run pandoc -s):

---
header-includes: <script src="foo"></script>
---

my markdown document
like image 181
mb21 Avatar answered May 12 '26 10:05

mb21



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!