-
Notifications
You must be signed in to change notification settings - Fork 5
Adding Syntax Highlighting for a New Language
Peter Ernst edited this page May 21, 2020
·
1 revision
To add support for a language which is not already supported out-of-the box you would:
- navigate to Getting highlight.js
- scroll down to Custom Package section and select one or more of the languages you want. E.g. PHP and PHP Template
- click on download. This will download a ZIP file with the required resources including all highlighting themes.
- if you want to use the new styles on a conversion project created by New-StaticHTMLSiteProject, copy
highlight.pack.jsfrom the ZIP file over to theTemplate/jsdirectory of your project. If you are not using conversion projects, create a new custom template with New-HTMLTemplate and copyhighlight.pack.jsfrom the ZIP file over to thejsdirectory of the custom template. - mission accomplished. Enjoy the new highlighting styles.
Now, if you want to use any of the highlighting themes that came with the download package, do this:
- Copy the theme from the ZIP file's
stylesdirectory to thestylesdirectory of the template you are going to use. - Edit
md-template.htmlin the template directory and load the theme in the head section like so:
<link rel="stylesheet" type="text/css" href="styles/my-favorite-theme.css" />