This project has moved. For the latest updates, please go here.

How to add external Javascript to generated html

Topics: User Forum
Sep 15, 2014 at 10:13 PM
What is the easiest way to add an external Javascript library to the head of the generated html output without modifying the template?
I want to include mathjax for latex formula support.
Sep 16, 2014 at 1:29 AM
There isn't currently a way to do it without cloning or modifying the presentation style. The VS2010 and VS2013 SHFBConceptual.config and SHFBReference.config files contain an instance of the "Additional Header Resources Component" which handles adding references to additional resources such as metadata, style sheets, and scripts files. Those files are assumed to be part of the website content. If you wanted to make it more generic, you could create a plug-in that allowed definition of the extra content to add and then have it copy the additional files and update the configuration files accordingly.

Sep 16, 2014 at 9:36 PM
Hi Eric

Thanks for pointing to the config files. That helps me a lot.
Would be great if there will be plugin in the future that allows adding extra content without modifying the existing presentation style. I think it's a common use case for the generated html documentation to add some extra styles or javascript to customize some behavior or design.

Kind regards,