-
Notifications
You must be signed in to change notification settings - Fork 695
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
Add example transforms for email for supported components #2411
Conversation
As we discussed, we'll need to add format filtering to examples to make this work without functionality-breaking transforms from #2389. Proposal is to allow examples to include |
Sorry if I am missing context, just wanted to add this: wouldn't filtering the comments/documentation work with the already implemented syntax like |
Good idea. That could work. The closing tag might be a problem in some cases as you need to add a dummy empty comment before subsequent html elements without comment:
|
Sorry, I fear that adding logic like that (specifically, implementation that includes both start and end tag) would take significant time for me (with my knowledge of the samples parser, based on experience doing ampproject/amp-by-example#1338) and I have limited bandwidth for this. It's significantly easier to implement IFF:
|
@fstanis please give Matthias's suggestion a try. It might already work as sample pages are also generated via grow (which understands the filter syntax). |
Sorry @mathiasbynens, misunderstood your comment! Anyway, this works, but only if both start and end are in the same comment. Your code sample results in this error which I'm not sure how to debug:
(there are a few other issue, such as the fact that the current system assumes an example always has one format, but that could probably be fixed) More importantly, this wouldn't work for the |
Good point. This won't work for the previews. |
You meant @matthiasrohmer, not me. (GitHub’s autocomplete widget could use some love…) |
@fstanis what's the status here? |
be7d11a
to
9b078b0
Compare
This should now be done. PTAL. I added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add tests.
Addressed comments, updated tests for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Can you add a test for the validation behavior.
1fe038a
to
3d772b8
Compare
I changed the way validation results are returned and added some tests for it. |
Tried the PR locally. Two things:
|
@matthiasrohmer have you got a good idea, how we load |
Done.
I added logic for the following:
|
As we discussed, I temporarily made it so generated samples are hidden from the main website and only visible in the playground and preview until we resolve the issues with URLs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Filip!
This PR requires both #2389 and ampproject/amp-by-example#2028 to be merged first.