question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is it possible to access inner contents of element as it was written in md?

See original GitHub issue

I’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:

screen shot 2018-08-03 at 12 29 43 pm

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:closed
  • Created 5 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jonearleycommented, Aug 3, 2018

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?

0reactions
jonearleycommented, Aug 6, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found