Transform Markdown into JSX or React component modules
92
stars
117
commits
JavaScript
primary language
Apr 12, 2024
updated
As of April 2024, jsxtreme markdown (& batfish) are no longer maintained & this repository is archived.
Transform Markdown with interpolated JS expressions and JSX elements into JSX or React component modules.
It's Xtreme! Like xtreme sports with Red Bull, but with Markdown and React and indoors at your computer.
Within jsxtreme-markdown, JS expressions and JSX elements can be interpolated between designated delimiters (defaults are {{..}}).
JS expressions are transformed into curly-brace-delimited {expressions} within the JSX output.
JSX elements are passed directly through.
With the following input:
# Title
Here is some **markdown**. _So easy_ to write.
You can interpolate JS expressions like {{ data.number }}
or {{ dogs.map(d => d.name).join(', ') }}.
You can also interpolate JSX elements,
whether {{ <span>inline</span> }} or as a block:
{{ <div className="fancy-class">
This is a block.
</div> }}
You can even break up JSX interpolation to process more or your text
as Markdown.
{{ <div className="fancy-class"> }}
This is a **Markdown** paragraph inside the div.
And this is another.
{{ </div> }}
You get the following JSX output:
<div>
<h1>Title</h1>
<p>
Here is some <strong>markdown</strong>. So <em>easy</em> to write.
</p>
<p>
You can interpolate JS expressions like {data.number}
or {dogs.map((d) => d.name).join(', ')}.
</p>
<p>
You can also interpolate JSX elements, whether <span>inline</span> or as a
block:
</p>
<div className="fancy-class">This is a block.</div>
<p>
You can even break up JSX interpolation to process more or your text as
Markdown.
</p>
<div className="fancy-class">
<p>
This is a <strong>Markdown</strong> paragraph inside the div.
</p>
<p>And this is another.</p>
</div>
</div>
This monorepo includes the following packages:
npm run start-repl
This will start the REPL locally.
node/repl/src/build-css.js
If you update the CSS, you'll need to run this to see your changes.
When you're ready to update the REPL, run bin/deploy-gh-pages.
That should do it.
This monorepo does not include any special tooling for managing common dependencies or publishing. Tests are run from the root of the repo, but each of the four packages are updated and published independently using the same publishing process used in other Mapbox JS packages.
A postinstall script is in place to ensure that each of the four packages install dependencies when npm i is run at the repo root. This ensures that all dependencies are in place so that tests can run on ci.
JavaScript
82.5%
CSS
12.4%
HTML
4.5%
Transform Markdown into JSX or React component modules
92
stars
117
commits
JavaScript
primary language
Apr 12, 2024
updated
As of April 2024, jsxtreme markdown (& batfish) are no longer maintained & this repository is archived.
Transform Markdown with interpolated JS expressions and JSX elements into JSX or React component modules.
It's Xtreme! Like xtreme sports with Red Bull, but with Markdown and React and indoors at your computer.
Within jsxtreme-markdown, JS expressions and JSX elements can be interpolated between designated delimiters (defaults are {{..}}).
JS expressions are transformed into curly-brace-delimited {expressions} within the JSX output.
JSX elements are passed directly through.
With the following input:
# Title
Here is some **markdown**. _So easy_ to write.
You can interpolate JS expressions like {{ data.number }}
or {{ dogs.map(d => d.name).join(', ') }}.
You can also interpolate JSX elements,
whether {{ <span>inline</span> }} or as a block:
{{ <div className="fancy-class">
This is a block.
</div> }}
You can even break up JSX interpolation to process more or your text
as Markdown.
{{ <div className="fancy-class"> }}
This is a **Markdown** paragraph inside the div.
And this is another.
{{ </div> }}
You get the following JSX output:
<div>
<h1>Title</h1>
<p>
Here is some <strong>markdown</strong>. So <em>easy</em> to write.
</p>
<p>
You can interpolate JS expressions like {data.number}
or {dogs.map((d) => d.name).join(', ')}.
</p>
<p>
You can also interpolate JSX elements, whether <span>inline</span> or as a
block:
</p>
<div className="fancy-class">This is a block.</div>
<p>
You can even break up JSX interpolation to process more or your text as
Markdown.
</p>
<div className="fancy-class">
<p>
This is a <strong>Markdown</strong> paragraph inside the div.
</p>
<p>And this is another.</p>
</div>
</div>
This monorepo includes the following packages:
npm run start-repl
This will start the REPL locally.
node/repl/src/build-css.js
If you update the CSS, you'll need to run this to see your changes.
When you're ready to update the REPL, run bin/deploy-gh-pages.
That should do it.
This monorepo does not include any special tooling for managing common dependencies or publishing. Tests are run from the root of the repo, but each of the four packages are updated and published independently using the same publishing process used in other Mapbox JS packages.
A postinstall script is in place to ensure that each of the four packages install dependencies when npm i is run at the repo root. This ensures that all dependencies are in place so that tests can run on ci.
JavaScript
82.5%
CSS
12.4%
HTML
4.5%