-
Notifications
You must be signed in to change notification settings - Fork 514
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
Render example sections #158
Conversation
client/src/ingredients/examples.js
Outdated
@@ -92,3 +92,7 @@ export function Examples({ examples }) { | |||
</> | |||
); | |||
} | |||
|
|||
export function Example({ example }) { |
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.
Just put export
in front on line 65.
Also, to align with the style of naming, would you mind renaming RenderExample
to Example
. and do the necessary renaming on line 90.
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.
Clearly the result of a late night PR..apologies 😅
Apart from the nit I've mentioned I think @joedarc has completely implemented based on this comment: #137 (comment) Perhaps we're being naive and perhaps you have bigger plans for dealing with |
fe0dbb5
to
a227224
Compare
Yes, it seems convincing to suggest that these strings should be maintained in stumptown-content. As for a joint way to handle "examples" and "example" - I did think we should do that, and then I sort of changed my mind, as they seem like semantically distinct things, and it seemed clearer therefore to represent them explicitly different. I'm very happy though that this PR is so small, so most of the same code is reused anyway :). |
Unfortunately this doesn't render the examples in "Applying color" as live samples. The reason is https://github.com/mdn/stumptown-renderer/blob/master/client/src/ingredients/examples.js#L80 - the renderer uses the existence of the It's my fault: I omitted Relatedly, in mdn/stumptown-content#54 (comment), I discussed whether we should explicitly indicate whether an example is a static example or a live sample, rather than have the renderer use implicit hints like the existence of So, options now:
We can also do both: (1) now, so we'll get guide pages rendering, and (2) in a follow-up. Having typed all this out, that's what I think we should do. |
Wow good catch @wbamberg, i had a version of this that had all of those rendering, however i remember having to put a fallback to use 100% width. Let me know how you feel about this:
Fallback to 100% width. Just checked and this renders them properly. |
Scratch that, ignore me. I see what you mean. If you have any suggestions I'd be more than happy to change some stuff here. |
You could use If we think 100% width all the time is the right way to go (I think I do), you could also always ignore Then in a follow-up PR I could fix the content to add an explicit "example type" indicator. |
a227224
to
115a721
Compare
@wbamberg, I changed it. If the decision to make everything 100% is agreed upon i can change it to just use that all the time. |
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.
This works great. Thanks @joedarc , it's really exciting to see guide pages getting rendered!
I don't agree that this needs to wait for #156 because the only reason for waiting is to see that it worked. We can simulate that instead by deliberately putting in a chaos monkey that randomly throws an error. |
Fixes #137
Please don't merge until #156 is merged into master.
This will allow example sections to render properly. Fixes #137 and partially satisfies #157