问题描述
我正在使用asciidoctor-maven-plugin将.adoc文件转换为html文件...
想在生成的html文件中包含javascript链接...
基本上想要在.adoc文件生成的html文件中看到类似下面的内容
I'm using asciidoctor-maven-plugin to convert .adoc files to html file...Would want to include a link to javascript in the generated html file...Basically would like to see something like below in the html file that is generated from the .adoc file
<script src="custom.js"></script>
尝试过设置属性,比如linkcss scriptsdir等...但是没有运气......
Tried setting attributes like linkcss scriptsdir etc..but of no luck...
任何帮助?
一种方式就像
但是必须在每个.adoc文件中添加它...有没有办法让它像CSS一样自动添加(使用样式表)
But then have to add it in every .adoc file...is there a way to get it automatically added just like the CSS (using stylesheet)
推荐答案
你可以使用 ++++
来使用passthrough块:
You can use the passthrough block for that using ++++
:
++++
<p>
Content in a passthrough block is passed to the output unprocessed.
That means you can include raw HTML, like this embedded Gist:
</p>
<script src="http://gist.github.com/mojavelinux/5333524.js">
</script>
++++
资料来源:
这篇关于如何在Asciidoc中包含一个javascript?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!