Syntax Highlighter with prims js
- This topic has 4 replies, 2 voices, and was last updated 4 years, 1 month ago by .
-
AuthorPosts
-
October 11, 2019 at 2:32 pm #440
[anonymous]
Hi Bob,
I am trying to use Prism js in theme. I am following this docs:
https://getpublii.com/docs/highlight-your-code-syntax-with-prism-js.html
As suggested in the doc, I downloaded js and css files and put that in the respective folders.
head.hbs
` {{/checkIf}}`` `` {{{@headCustomCode}}}`` `` `` {{{@bodyCustomCode}}}`and in footer.hbs
`{{#if @renderer.previewMode}}``Could you please help me out here.
Thanks,
Ajeet
October 11, 2019 at 3:18 pm #443Bob
Hi Ajjet,
Just follow the instructions, everything is described in detail https://getpublii.com/docs/highlight-your-code-syntax-with-prism-js.html
Your example does not contain the prism.js file, this one must be added to the footer section. To have a popup with a list of coding languages you have to add them to the config.json file.
The” dark layout” was created by me and is available and delivered only with the following themes: Documentation and ProDocs.
--
Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!October 11, 2019 at 4:44 pm #445[anonymous]
Sorry,
I did add the code in footer, pasted it wrongly.
I did not add the languages in the config file. I have added now
But the pop is still not there.
AM I missing something ????
TIA.
Ajeet
October 11, 2019 at 4:46 pm #446Bob
Use FORMATS select, not the Code.
--
Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!October 11, 2019 at 4:55 pm #449[anonymous]
Yes, I added the labels at the wrong place in config file. I had to add under here :
“customElements”: [ ]It works.Thanks so muchAuthorPostsViewing 5 posts - 1 through 5 (of 5 total)- The topic ‘Syntax Highlighter with prims js’ is closed to new replies.