Open h7kanna opened 1 month ago
I am not able to include a JavaScript module in the additional_js option.
additional_js
Example:
<!-- Custom JS scripts --> <script src="custom-js/index.js" type="module" async></script>
Currently, the configuration is only a list of file name strings. Also the custom head.hbs cannot be used as additional_js is only for local files.
head.hbs
Provide new additional-js-attributes option augmenting the existing additional-js option.
additional-js-attributes
additional-js
[output.html] additional-js = ["custom-js/index.js", "custom-js/xtermjs"] additional-js-attributes = [ [ { type = "module" }, { async = true }, ], [ { type = "module" }, { async = true }, ], ]
Demo implementation is here https://github.com/rust-lang/mdBook/compare/master...h7kanna:mdBook:additional-js-attributes
@rustbot claim
Problem
I am not able to include a JavaScript module in the
additional_js
option.Example:
Currently, the configuration is only a list of file name strings. Also the custom
head.hbs
cannot be used as additional_js is only for local files.Proposed Solution
Provide new
additional-js-attributes
option augmenting the existingadditional-js
option.Example:
Notes
Demo implementation is here https://github.com/rust-lang/mdBook/compare/master...h7kanna:mdBook:additional-js-attributes