Comments (11)
Exposing something similar to how prettier works would be awesome if possible! That or just exposing user settings in their JSON file for specific format options like wrapping attributes on new lines, indenting the head and body tags or not, stuff like that.
I'm not entirely sure this is possible but it would be great if it was!
from nunjucks-template.
@eseom awesome, thanks!
It looks like there are still a few bugs with indentation and new lines, however. I'll open a new issue for clarity.
from nunjucks-template.
What formatter do you prefer, for example?
from nunjucks-template.
Thanks for this extension - I've just tried a bunch of them and yours is best. 🥇
The way the Nunjucks Template Formatter extension makes it easy to change settings is great. Screenshot below. That project is now archived so maybe you could salvage some of the code from there?
For now, do you know if there's a way to force the "End self-closing tags with a space" setting right now? Nunjucks Template Formatter and yours both use prettydiff2 so I'm assuming it should be possible?
Many thanks!
from nunjucks-template.
I would also like to be able to keep line breaks. It makes my files much more legible!
from nunjucks-template.
Closing because this seems inactive!
from nunjucks-template.
@anghelos a "preserveEmptyLine" configuration was added.
Im about to see Nunjucks Template Formatter
Any suggestion is welcome
from nunjucks-template.
It would really help if the extension could respect/inherit the html.format
settings, now when I activate this extension, it stops respecting the html.format.wrapAttributes
setting. I don't know the complexity of implementing such a feature but I don't understand why VS Code formatters for HTML-like template languages have this problem and apparently have to reimplement basic HTML formatter settings.
from nunjucks-template.
It would really help if the extension could respect/inherit the
html.format
settings, now when I activate this extension, it stops respecting thehtml.format.wrapAttributes
setting. I don't know the complexity of implementing such a feature but I don't understand why VS Code formatters for HTML-like template languages have this problem and apparently have to reimplement basic HTML formatter settings.
First of all, because of the template syntax like {{ variable }}
, a new formatter have to be implemented for the formatting. This extension is using prettydiff2
, Fortunately it supports a lot of options for formatting. I think it would support the option like the wrapAttributes
. Instead of inheriting the original formatter, it had better to adjust the options into prettydiff2
.
Could you list what options would be needed except wrapAttributes
?
from nunjucks-template.
It would be great if this extension had options like here VS Code Twig Language 2
as an example, some of the options from there:
from nunjucks-template.
Related Issues (20)
- Allow multiline frontmatter HOT 3
- Frontmatter inside njk (nunjucks) is formatted as gray comment color
- autocorrect changing case on format HOT 1
- [BUG] Wrong highlight in script tags
- Formatter break if hyphen (-) character inside string HOT 3
- Formatting with multiply if's in the same tag removes the endif HOT 1
- Formatting does not respect the max line length HOT 3
- Version v0.3.4 issue with HTML coloring HOT 6
- YAML front matter formatting HOT 2
- Extension is missing in open-vsx.org store HOT 3
- Wrong behavior for html elements with no closing tag. HOT 1
- "a href" is joined while formatting HOT 2
- How do I enable formatting HOT 2
- add docs: This plugin not automatically detected njk language mode
- include partials shortcut not found
- Tab indentation is converted to spaces on file save
- How do you use the triggers?
- problem on highlight single tag
- autoclose tags not working HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nunjucks-template.