nunjucks-11ty-plus
nunjucks-11ty-plus is a syntax highlighter for nunjucks files.
Formatting can be done with Nunjucks-prettier however it will only really format the HTML in your file. The nunjucks code gets mangled.
It has some additions that help when you're using Eleventy (11ty) as your website build tool.
Warning: This extension is incomplete and there is much work to do.
Features
- Native comments and Syntax highlight in:
<style>
tags
<script>
tags
js
, yaml
and json
frontmatter.
To do
Syntax highlighting
Formatting
- [x] Basic inbuilt formatting using Prettier
- [ ] Improve the formatting (use the Jnija parser)?
- [ ] Formating JS, JSON and YAML in frontmatter?
- [ ] Indentation (in laungage config?)
Known Issues
- [ ] Bug: If you have front matter
Select all > Format
= bad
- [ ] Bug: Formatting is currently rubbish. But we're in control of it now.
copy/pasted from my setting until publication.
{
"name": "Frontmatter open/close tags",
"scope": "punctuation.definition.tag.begin.frontmatter,punctuation.definition.tag.end.frontmatter, keyword.other.whitespace.nunjucks",
"settings": {
"foreground": "#d4ae6e"
}
},
{
"name": "Nunjucks variable",
"scope": "variable.nunjucks",
"settings": {
"foreground": "#02a489"
}
},
{
"name": "Nunjucks keyword",
"scope": "keyword.control.nunjucks",
"settings": {
"foreground": "#ee6d0b"
}
},
{
"name": "Nunjucks open/close tags",
"scope": "punctuation.definition.tag.nunjucks",
"settings": {
"foreground": "#ffde39"
}
},
{
"name": "????????????????",
"scope": "entity.function.nunjucks",
"settings": {
"foreground": "#39ff3c"
}
},
{
"name": "Nunjucks Comments",
"scope": "comment.block.nunjucks",
"settings": {
"foreground": "#6A9955",
"fontStyle": "italic"
}
},