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

Adding --remove-mustaches using pystache (new feature #23) #24

Closed
wants to merge 2 commits into from
Closed

Adding --remove-mustaches using pystache (new feature #23) #24

wants to merge 2 commits into from

Conversation

Lucas-C
Copy link
Contributor

@Lucas-C Lucas-C commented Jul 18, 2016

No description provided.

@Lucas-C
Copy link
Contributor Author

Lucas-C commented Jul 25, 2016

What do you think of this idea ? :)

@svenkreiss
Copy link
Owner

This sounds like a preprocessor to convert mustache templates to HTML. Its
an interesting idea, but I think this is outside of the scope of
html5validator for now and too specific to mustache.

I could see adding a crawler. That would mean you could serve HTML
(possibly generated from mustache templates) and validate the crawled HTML
using html5validator.

On Mon, Jul 25, 2016 at 6:43 PM Lucas Cimon notifications@github.com
wrote:

What do you think of this idea ? :)


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#24 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACpYJptjJisnIdU3w2o6EyNuCyb5T1X1ks5qZTwVgaJpZM4JOiT2
.

@Lucas-C
Copy link
Contributor Author

Lucas-C commented Jul 26, 2016

I don't get the crawler role here. What transformation would it perform on its input exactly ? And what kind of input would it take ?

But I understand your point about the separation of concerns & mustache templates beeing too specific.

There are many flavours of HTML templating systems. Just to name a few:

Certainly there is a need for extensibility here, and there is no reason to support only mustache templates.

However, I do not not really agree that this is clearly out of the scope of a Python lib / CLI HTML validator.
It would be really handy for such tool to have "batteries included", and support the most common templating systems, so that one could easily validate its HTML templates without adding any extra layer. I definitely see that that as a "plus" in term of usability.
I think adding "template plugins" could be the best option here. Mustache templates would be just a start, but they cover many cases in the list above (e.g. Angular & Handlebar share the same syntax with it).

Of course, you may not want your validator to take this direction. It's your call, and I can build another tool or fork html5validator to add this support for HTML templates.

@Lucas-C
Copy link
Contributor Author

Lucas-C commented Aug 18, 2016

Any thoughts ?

@svenkreiss
Copy link
Owner

I was thinking more about something like localcrawl. This can crawl a local development server and it processes all the JavaScript with a headless browser. It outputs the generated HTML and works with any template engine. The readme contains an example with a small Mustache template.

Does that work for your use case?

@Lucas-C
Copy link
Contributor Author

Lucas-C commented Nov 21, 2016

I worked around this by implementing mustaches-substitution in my pre-commit hook:
https://github.com/Lucas-C/pre-commit-hooks-html

No, localcrawl does not really work the way I want.

Closing this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants