最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin1浏览0评论

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?

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?

Share Improve this question asked Feb 21, 2017 at 10:19 equaegheequaeghe 1,78420 silver badges39 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 15

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

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

my markdown document

More convenient could be to use the flag

`-H FILE, --include-in-header=FILE|URL`

as described here in the pandoc call. It implies --standalone.

发布评论

评论列表(0)

  1. 暂无评论