question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can we support rendering of pug templates?

See original GitHub issue

Summary

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

https://developer.mozilla.org/en-US/docs/Learn/Server-side/Express_Nodejs/Displaying_data/LocalLibrary_base_template

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

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Josh-Cenacommented, Jul 25, 2022

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.

0reactions
caugnercommented, Aug 22, 2022
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found