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.

Add support for other templating languages

See original GitHub issue

Hi!

I use Windi with Eleventy and so I use Nunjucks templates. This works well, no issues about it. Even though there’s no official support for it (yet?) this works completely fine, every features including the analyzer works perfectly

However, this extension doesn’t work on .njk files even though they’re (mostly) normal html files due to it only triggering on .html, .vue etc files. Changing the extension manually to make it so it enables itself on .njk files (adding them to package.json and filetypes.ts like php files are) works perfectly. However, of course this breaks whenever the extension is updated

I was wondering if a way to add it to other file formats without having to hack the extension would be possible. For instance, vscode-auto-close-tag allows this through a parameter called auto-close-tag.activationOnLanguage another reference might be the official emmet settings for doing so emmet.includeLanguages

Please note that I’m not asking for Nunjucks support to be added, VS Code doesn’t even support them by default. I’m asking for a way to support file types arbitrarily 😅

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
alexanderniebuhrcommented, Apr 11, 2021

greater than release v0.11.1, you should be able to define custom language mapping with

  "windicss.includeLanguages": {
    "njk": "html"
  }
1reaction
alexanderniebuhrcommented, Apr 11, 2021

ok cool… i will have this feature ready for next release 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add the ability to allow for other templating engines to be used
I am thinking, for the test case, the one template language to test this functionality, due to popularity and growth, would be PHP...
Read more >
Top 14 Templating Engines for JavaScript 2022 - Colorlib
Remarkably flexible and user-friendly templating engines for JavaScript ... In other words, Handlebars works with Node.js, Chrome, Firefox, ...
Read more >
5 Templating Languages To Use Instead of HTML
EJS. Embedded JavaScript, or, EJS, is a templating language that lets you generate HTML with plain JavaScript in between. It is a very...
Read more >
Template Languages — Eleventy
HTML · Markdown · WebC · JavaScript · Nunjucks · Liquid · Handlebars · Mustache · EJS · HAML · Pug · Custom....
Read more >
Using Templating Engines to Streamline WordPress Theme ...
At its most basic, a templating engine is a package that is included in a project that allows us to compile one language...
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