Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template language syntax highlighting #31

Open
gavinmcfarland opened this issue Aug 20, 2019 · 0 comments
Open

Template language syntax highlighting #31

gavinmcfarland opened this issue Aug 20, 2019 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@gavinmcfarland
Copy link

Would you consider adding support for templating languages like Nunjucks, Handlebars, Liquid etc?

It would be very useful to be able to see template variables like {{variable}} more clearly.

Here's an example from one of my projects which uses Nunjucks.

export default ['template', 'font-style', ({ theme }) => {

	let data = {
		rules: [{
			name: 'font-style',
			abbr: 'font',
			...structure(theme.font.style, ['modifiers', 'props', 'value'])
		}]
	}

	return render(`{% for rule in rules -%}
	{%- if rule.props -%}
	.{{rule.abbr}} {
		{%- for prop in rule.props %}
		{{prop.name | kebabcase}}: {{prop.value}};
		{%- endfor %}
	}
	{%- endif -%}
	{% for modifier in rule.modifiers %}
	{% if modifier.name === 'default' %}
	.{{rule.abbr}} {
	{%- else -%}
	.{{rule.abbr}}-{{modifier.name}} {
	{%- endif -%}
		{%- for prop in modifier.props %}
		{{prop.name | kebabcase}}: {{prop.value}};
		{%- endfor %}
	}
	{%- endfor -%}
	{%- endfor -%}`, data)
}]
@0x00000001A 0x00000001A self-assigned this Nov 13, 2019
@0x00000001A 0x00000001A added the enhancement New feature or request label Nov 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants