A few examples of where gatsby-remark-vscode excels: Scenario And since VS Code is built with JavaScript and CSS, is open source, and has a rich extension ecosystem, it turns out that it’s pretty easy to use its highlighting engine and extensions and get great results. So why make tradeoffs that don’t buy you anything? There’s no reason why the syntax highlighting on your blog should be any less sophisticated than the syntax highlighting in your code editor. Your Gatsby app, on the other hand, renders to HTML at build-time in Node, so these constraints don’t apply. Since they get downloaded and executed whenever a user visits a page, they have to be ultra-fast and ultra-lightweight. JavaScript syntax highlighting libraries that were designed to run in the browser, like Prism, have to make compromises given the constraints of their intended environment. ![]() Usage as a remark plugin without Gatsby.Using different themes for different code fences.Using languages and themes from an extension.New features are line numbers and diff highlighting (thanks for the latter!). If you’re updating from v2.x.x (or v1), see MIGRATING.md. Includes OS dark mode support □ v3 is out now! □ Any language and theme VS Code supports, whether built-in or via a third-party extension, can be rendered on your Gatsby site. ![]() A syntax highlighting plugin for Gatsby that uses VS Code’s extensions, themes, and highlighting engine.
0 Comments
Leave a Reply. |