-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No longer compatible with MkDocs static-site generator #2099
Comments
That's because To get the latest version of your If you want to use a CDN, then check out the basic usage section about CDNs. |
Thanks for the prompt response, but that is not the problem I need to report! The It does puzzle me that this happens with no warning or error message in the console. I do appreciate that Prism doesn’t claim to support HTML generated by MkDocs (attached). But it used to (try switching in |
It wouldn't doing any highlighting off the DOM if the language isn't included in the bundle. How did you get the updated bundle? |
Apologies that I’m struggling to make this clear. The test site, designed to replicate the issue minimally, is generated from Markdown code fences labelled https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript from which the downloaded Thanks for your patience. |
That's the problem. The generated code blocks will get the class |
That’s not the problem. The code fences (a Markdown, not HTML, feature) are
labelled correctly. From them, the MkDocs site generator then produces HTML
code elements with language-txt and language-css classes, visible in the
HTML attached to my last message.
If this were not so, the 2017 prism0.js could not be working.
Stephen Taylor | Librarian | *Kx* | +44 7713 400852 | [email protected]
…On Mon, 21 Oct 2019 at 10:32, Michael Schmidt ***@***.***> wrote:
So the opening code fences in docs/index.md are labeled txt and css
respectively.
That's the problem. The generated code blocks will get the class txt and
css respectively but Prism requires language-txt or language-css to
detect the language.
To fix that, prism0.js contains a small JQuery function (the first few
lines of code) which transforms e.g. css -> language-css. This function
*isn't* from us. It's likely from your predecessor.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2099?email_source=notifications&email_token=AE62DADCI5ZFCD22KDKB6R3QPVZJ5A5CNFSM4JCVMBEKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBZV7OQ#issuecomment-544432058>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE62DADQ2NNQ6QGGLZWMYVTQPVZJ5ANCNFSM4JCVMBEA>
.
|
They are not labeled <p>And some CSS:</p>
<pre><code class="css">*, .none {
border-color: red;
margin: 0;
padding: 0;
}
</code></pre>
As I said, /* Code syntax highlighting in code.kx.com
-------------------------------------------
Pygment highlighting disabled – switched off Markdown extensions codehilite and superfences
This leaves eg <pre><code class="java">… in MkDocs output.
Now need to switch to <pre><code class="java language-java">… as per http://prismjs.com/index.html#basic-usage
*/
$("pre code").each(function(){
var c = $(this).attr('class');
if( c ) {
$(this).addClass('language-'+c);
}
});
/* End of Kx hack -------------------------- */ So executing this function before Prism should make everything work again. |
My apologies: it should have occurred to me to look for a local hack. Thought I’d learned by now:
|
No problem. I assume that means the problem is resolved? |
It does. Thanks for your help.
Stephen Taylor | Librarian | *Kx* | +44 7713 400852 | [email protected]
…On Mon, 21 Oct 2019 at 14:58, Michael Schmidt ***@***.***> wrote:
No problem. I assume that means the problem is resolved?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2099?email_source=notifications&email_token=AE62DAEWYIHBD74WRLI6K53QPWYQHA5CNFSM4JCVMBEKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEB2NIHQ#issuecomment-544527390>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE62DABHOOTRLZPOXDRGY3LQPWYQHANCNFSM4JCVMBEA>
.
|
The MkDocs static-site generator has a code-highlighting plugin based on Pygments. We use Prism instead, because it supports the q (kdb+database) language.
code.kx.com
Trying to upgrade Prism, I cannot find a current JS that works. With my 2017 JS everything works. Switch in a current JS or link to the CDN and highlighting disappears. No warning or error in the browser console. Problem is reproducible from the minimal MkDocs instance created by
mkdocs new
command with inclusion of foldersdocs/scripts
anddocs/stylesheets
. (Attached.) Configuration file:Above,
prism.js
is the minimal file downloaded currently from prismjs.com, andprism0.js
is the corresponding file from August 2017.We value the code highlighting Prism gives us and want to stay current.
Attached is a ZIP of the entire MkDocs instance.
archive.zip
The text was updated successfully, but these errors were encountered: