tlienart / FranklinTemplates.jl

Simple website templates for Franklin.jl
https://tlienart.github.io/FranklinTemplates.jl/
MIT License
76 stars 24 forks source link

Update to highlight.js 10.7.1 #123

Closed abelsiqueira closed 3 years ago

abelsiqueira commented 3 years ago

Related to https://github.com/tlienart/Franklin.jl/pull/803 and https://github.com/tlienart/Franklin.jl/pull/804.

I chose the custom download from https://highlightjs.org/download/ selecting all Common (were already selected) and Julia and Julia REPL from the Other.

tlienart commented 3 years ago

Thanks a lot!

This one is a bit trickier, in terms of languages I typically pick https://github.com/tlienart/FranklinTemplates.jl#misc but that's easy to adjust.

The javascript by default doesn't recognise shell> and pkg> so there needs to be a fix for this as per this line: https://github.com/tlienart/FranklinTemplates.jl/blob/master/src/templates/common/_libs/highlight/highlight.pack.js#L639 in that line you'll see that it's basically a copy-paste of the Julia> one 2 times (once for shell, once for pkg). Depending on highlight version the exact syntax to copy paste is a bit different (basically you have to search for the Julia one, and then copy paste).

I don't want to bother you with this though, I'm already grateful for your two PRs! I can do that fix in a bit.

abelsiqueira commented 3 years ago

Hi @tlienart, happy to help. I updated the PR with the different highlight custom package and added the shell> and pkg> syntax copies. There was a new aliases:["jldoctest"] for the original, which I didn't know if I should copy or not, so I left it out. The commits are separated for better verification. I imagine it's hard to make sure I did the right, so feel free to close or modify this PR.

tlienart commented 3 years ago

Thanks a lot!

No it's not hard to verify: we just have to locally create a new site with the default template and check the second menu page (/menu2/) (maybe menu 3 one of the two) and check that the code is highlighted properly (there's a few toy code with shell> and pkg

Thanks again for your help!

abelsiqueira commented 3 years ago

Looks like it worked: franklin-template

tlienart commented 3 years ago

Perfect, thank you very much!