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

Support for HTML-like languages #22

Open
davletbaev opened this issue Jul 6, 2019 · 11 comments
Open

Support for HTML-like languages #22

davletbaev opened this issue Jul 6, 2019 · 11 comments
Assignees
Labels
collection An issue that houses multiple questions/issues enhancement New feature or request

Comments

@davletbaev
Copy link

Is your feature request related to a problem? Please describe.
Plugin don't work with HTML-like languages, e.g. Nunjucks, Handlebars, etc. It doesn't work even if extension of file is .html.

Describe the solution you'd like
Added the ability to select extensions in plugin settings.

Describe alternatives you've considered
Default support for all html-like languages.

@mvdschee mvdschee self-assigned this Jul 9, 2019
@mvdschee mvdschee added the enhancement New feature or request label Jul 9, 2019
@mvdschee
Copy link
Owner

@davletbaev Thank you for your suggestions, I had it on my personal list of features I should add when I’m done rewriting the handling of accessibility errors.

So why my extension is not working when you change the file extension from .something to .html is because in the down right corner of VS code they specify which language type it is (language mode), if you change that to html it will start working, but you lose the advantages you have for the correct language mode.

Back to your feature request, there is one big problem with those HTML like languages, for example, twig it’s common to use {% include 'metadata.twig' %} to make your code more modular. For example:

<head>
  {% block head %}
    {% include 'metadata.twig' %}
  {% endblock %}
</head>

Which means the extension is unable to lint if there is a title in the <head> element because it’s not able to process those includes. Those includes I believe is the power of those languages, but they come with great challenges when you need to lint them based on the context of HTML structure.

Btw I have never used one of those HTML-like languages you describe, so if you find any more, drop a comment with ones you like in this issue and will try to add them as well :)

@tylerkilburn
Copy link

Max, thank you for all your hard work on this extension, it rocks and definitely makes me more accessibility minded. Is there any chance we could sneak Handlebars (HBS) / Mustanche in? I don't know what the lift is, but I am hoping it is minimal as HBS doesn't let you do very much in HTML outside of dropping {{var}} tags in. Thanks again!

@tylerkilburn
Copy link

@mvdschee Mr Max, any insights? I would be down to help out if you are strapped for time. Just want your blessing before attempting any PRs :)

@mvdschee
Copy link
Owner

mvdschee commented Sep 4, 2020

@tylerkilburn I'm happy to hear you like the extension :) I can for sure add support for Handlebars (HBS) / Mustache. I will have to check it against a project, so if you have any for me, drop them here, and I can take a look, will look into HBS and if it's indeed just some {{var}} big chance It will be added with the next release!

PS Sorry for the late reply :)

@tylerkilburn
Copy link

Cool, I will throw together a cute hello world HBS project with partials, expressions and a few more bells and whistles and share the repo here. Sadly, I can share any of my work things... you know how that goes... 🤷‍♂️.

@tylerkilburn
Copy link

Hi Mr Max, I threw together a repo for you here https://gitlab.com/tkil/hbs-example. Just clone and go to town. Please let me know if you have any issues.

@tylerkilburn
Copy link

Mr Max, would you be open to me lending a hand if you are slammed with work / life? I don't want to step on your toes, but don't want to pressure you if life is busy either.

@mvdschee
Copy link
Owner

He @tylerkilburn I did not get any notifications of your reply! :O

Thanks for the repo I will use it to test it! No adding it is not the hard part, just de validation and checking can take sometime. Mid next week I have time to add HBS for you, and do a little update/upgrade. Don't worry about you being involved, It's a good thing and makes this project feel more alive :)

Will keep you posted!

@mvdschee mvdschee added the collection An issue that houses multiple questions/issues label Sep 24, 2020
@mvdschee
Copy link
Owner

mvdschee commented Sep 30, 2020

@tylerkilburn I have added support for HBS, hope it helps you :)

@martindrzka
Copy link

Hi, any chance to support .erb templates?

@robisadev
Copy link

What about html files with Twig

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
collection An issue that houses multiple questions/issues enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants