-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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 the ability to specify options on the demo page as JSON #1357
Conversation
I can do that, although right now all the things on the right are output/read-only, while the left side is input. What if instead of the details toggle, I added a similar dropdown on the input side? (Example of what it looks like forthcoming.) |
How about this change? Now all input is on the left, all output is on the right, and both have parallel type selectors. |
(FWIW, you can look at the live version at https://aprotim.github.io/marked/demo/) |
This is awesome! When the page loads the first time and there are no options in the query string, can you do This will give people an idea of what options are available 👍 |
Per @styfle's suggestion, setting the options element's contents to the defaults on load.
Done! |
@aprotim looks like your demo page has an error
seems to be because the options are duplicated in the "renderer" option
|
Ah, yeah. This is a problem with the roundtrip through JSON, when the default value for "renderer" is a complex object, not a dumb data object. I can either remove renderer from the object before stringifying, or I can set the default options text to be some manually-curated subset... let me tinker with it for a sec. |
Ok, now we filter any complex objects (or at least any objects whose prototype is different than Object's) out when we stringify. Seems to have cleared up the problem. |
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 is a much needed feature, thank you! 🎉
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.
Awesome 💯 🎉
Description
Create a details toggle that hides a textarea into which a user can type a JSON-formatted options object.
(For some reason, I can't seem to get the textarea inside a details tag to match the width of the other textareas. After staring at the CSS and banging my head against it, I figured I'd let other people look at it, decide if it was important, and if it was, how to fix it.)
Contributor
Committer
In most cases, this should be a different person than the contributor.