Can we support rendering of pug templates?
See original GitHub issueSummary
There are some pug template code blocks in https://developer.mozilla.org/en-US/docs/Learn/Server-side/Express_Nodejs/Displaying_data/LocalLibrary_base_template that are marked as plain because yari doesn’t support pug syntax highlighting.
If it were easy and not “costly” to support pug as well that would be good. I am not sure it would be easy/I think it is not supported, but just checking.
This came out of https://github.com/mdn/content/pull/18744
URL
Reproduction steps
Open a page, use ```pug to highlight some pug text. Url above is good. It renders as plain.
Expected behavior
Would be nice to render pug if we can
Actual behavior
We can’t 😃
Device
Desktop
Browser
Chrome
Browser version
Stable
Operating system
Windows
Screenshot
No response
Anything else?
No response
Validations
- I have read the Community Participation Guidelines.
- I have verified that there isn’t already an issue that reports the same bug to avoid creating a duplicate.
- I have checked that this is a concrete bug. For Q&A open a GitHub Discussion.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Pug: Getting Started
The general rendering process of Pug is simple. pug.compile() will compile the Pug source code into a JavaScript function that takes a data...
Read more >Server-Side Rendering with Pug Templates
Unbuffered code makes use of Javascript, but does not get rendered to the webpage.
Read more >Rendering Pug Templates with Multiple Data Files
How to render your Pug templates from multiple data files using Gulp.
Read more >Pug HTML Template Engine: A Beginner's Guide
This makes it easy to insert variables into our templates, iterate over arrays and objects, conditionally render HTML, and much more.
Read more >Rendering a portion of a PUG template without refreshing ...
No, pug is a server-side only HTML processor. As such there is no way to do what you describe here - to get...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
w.r.t. Prism highlighting support. Prism has a component for virtually every non-esoteric language, so the only blocker is whether we want to include that in our bundle or not. I wish there’s a better workflow to assess the tradeoffs of adding each language. My stance is that we should add every language that ought to be added (e.g. we should have
diff
,svelte
,jsx
, etc. as well).Even better—I wonder if we can code-split by Prism components, so we don’t have to worry about bundle size too much.
Fixed by https://github.com/mdn/yari/pull/6831.