Syntax Highlighting in a Webpage Without JavaScript
11–20 of 44 posts
Re: Syntax Highlighting in a Webpage Without JavaScript
#12In https://documentation.page/ I'm using `markdown-it` with `prismjs` to generate the code snippets (see example on e.g. https://react-test.dev/). It's in fact a default helper, so you don't even need hacks:
import MarkdownIt from "markdown-it";
import Prism from "prismjs";
function highlight(str, lang) {
if (!lang || !Prism.languages[lang]) return;
return Prism.highlight(str, Prism.languages[lang], lang);
}
const md = new MarkdownIt({ highlight }).use(...Re: Syntax Highlighting in a Webpage Without JavaScript
#13What is so special about this? This is the way websites have been doing syntax highlighting before people started using javascript libraries.
At the very least, this kind of article is informative for that crowd.
Re: Syntax Highlighting in a Webpage Without JavaScript
#14...By running the same JS on the server or in a build step.
Re: Syntax Highlighting in a Webpage Without JavaScript
#15What is so special about this? This is the way websites have been doing syntax highlighting before people started using javascript libraries.
There's a increasingly larger amount of web developers who are only "trained in React/Angular/Vue" and are unable to understand how to use or the trade-offs of regular websites using just HTML+CSS with only a little or no JS (that goes for both templated or fully static sites), and a surprising number of them even thinking they are some kind of "legacy technology". At the very least, this kind of article is informati…
I have a hunch that there are a lot of web professionals out there these days who genuinely don't know how to build a web application without JavaScript - POST forms, cookies and the like.
Re: Syntax Highlighting in a Webpage Without JavaScript
#16...By running the same JS on the server or in a build step.
Re: Syntax Highlighting in a Webpage Without JavaScript
#17Re: Syntax Highlighting in a Webpage Without JavaScript
#18?Re: Syntax Highlighting in a Webpage Without JavaScript
#19Re: Syntax Highlighting in a Webpage Without JavaScript
#20Earlier quoted context omitted.
There's a increasingly larger amount of web developers who are only "trained in React/Angular/Vue" and are unable to understand how to use or the trade-offs of regular websites using just HTML+CSS with only a little or no JS (that goes for both templated or fully static sites), and a surprising number of them even thinking they are some kind of "legacy technology". At the very least, this kind of article is informati…
I'm fascinated by this. It seems that for any developer with less than five years of industry experience there's a reasonable chance that they've almost exclusively worked in an SPA, JavaScript-for-everything environment. I have a hunch that there are a lot of web professionals out there these days who genuinely don't know how to build a web application without JavaScript - POST forms, cookies and the like.