Is it possible to access inner contents of element as it was written in md?
See original GitHub issueI’m building a documentation site for a pattern library and would like to write code examples in markdown and then render it with a live code editor like react-live.
## Start now button
Launch your service with a Start now button.
<Example>
<Button kind="start">Start now</Button>
</Example>
And have it render out something like this:

The missing piece is having the “children” of <Example>
passed through as a string so that react-live
can handle rendering.
Is it possible to access the inner contents of <Example>
as it is written in the markdown?
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
How to get data from a form which is written in inner HTML?
Here, the code from which I have to get data is written in inner html element.innerHTML = `<div class="col-md-6 mx-auto my-5" id="myDiv"> ...
Read more >HTMLElement.innerText - Web APIs | MDN
The innerText property of the HTMLElement interface represents the rendered text content of a node and its descendants.
Read more >CSS Content - CSS-Tricks
CSS has a property called content. It can only be used with the pseudo-elements ::after and ::before. It is written like a pseudo...
Read more >Content - Tailwind CSS
Utilities for controlling the content of the before and after pseudo-elements.
Read more >Writing Your Docs - MkDocs
When a directory is requested, by default, most web servers will return an index file (usually named index.html ) contained within that directory...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
If it could be added that would be amazing! I’ll look to publish a companion library for live code examples in markdown if it could work out.
Curious – Have you come across other approaches to including live code examples in markdown?
This is the kind of doc experience I’m aiming for: https://github.com/emotion-js/emotion/blob/master/docs/css.md.
Looks like I’ll be trying out Gatsby next.