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.

Interpolate variables in the MDX

See original GitHub issue

Thank you all for Docusaurus, it’s really easy and understandable 🙌

💥 Proposal

Following the https://github.com/facebook/docusaurus/issues/395#issuecomment-925703543 we are really need ability to interpolate variables in MDX markup of *.md files.

For example:

const data = "azaza";

// we wish this:
'''jsx
  const data = "{data}";
'''

// to become:
'''jsx
  const data = "azaza";
'''

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
JasonZhLiangcommented, Dec 15, 2022

@slorber thanks a lot, you save my day!

0reactions
slorbercommented, Dec 14, 2022

No official example I actually tried to share but I guess this could be an example: https://github.com/angeloashmore/gatsby-remark-find-replace/blob/master/src/index.js

(just found this with Google)

Read more comments on GitHub >

github_iconTop Results From Across the Web

MDX: Markdown for the component era
MDX allows you to use JSX in your markdown content. You can import components, such as interactive charts or alerts, and embed them...
Read more >
mdx-variables - npm
A package for reading variables from .mdx files. ... Start using mdx-variables in your project by running `npm i mdx-variables`.
Read more >
MDX and React - Docusaurus
Within the MDX page, the following variables are available as globals: frontMatter : the front matter as a record of string keys and...
Read more >
Execution Context of a Query and Interpolation Strings
There are situations where you may need to replace an interpolation variable with the value provided in the query only if this value...
Read more >
ASAM MDX - Wiki
Aggregates exactly one <SW-SYSTEM>, which is used to describe the software inside of an ECU. <SW-INTERFACE-MAPPINGS>. Map interface variables or software ...
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