Skip to content
Liminoid
GitHub

Markdown

$ yarn add liminoid-mdx

or

$ npm install --save liminoid-mdx

Usage

```python packages=['numpy']; edit=true
import numpy as np
np.random.rand(3,2)
```

multiple meta tags must be seperated with a ;

Liminoid CLI

$ liminoid develop

Webpack

$ npm init mdx webpack
$ cd webpack-mdx
$ yarn add liminoid-mdx
// webpack.config.js
const liminoid = require('liminoid-mdx');
module.exports = {
mode: 'development',
module: {
rules: [
{
test: /\.js$/,
use: 'babel-loader',
},
{
test: /\.mdx?$/,
use: [
'babel-loader',
{
loader: '@mdx-js/loader',
options: {
remarkPlugins: [liminoid],
},
},
],
},
],
},
};
$ yarn start #=> ... Project is running at http://localhost:8080/

Gatsby

$ npm init mdx gatsby
$ cd gatsby-mdx
$ yarn add liminoid-mdx
// gatsby.config.js
const liminoid = require('liminoid-mdx');
module.exports = {
plugins: [
{
resolve: 'gatsby-plugin-mdx',
options: {
// ...
remarkPlugins: [liminoid],
},
},
],
};
$ yarn start #=> ... Project is running at http://localhost:8000/

meta

namedefaultvaluesdescription
packages[]Array: package names currently avalable in PyodideUses Pyodide's loadPackage() to preload packages
consoletrueBoolean: true or falsefalse disables the HTML console which displays the results.
edittrueBoolean: true or falsefalse disables the textarea input while still allowing the embedded code to be run.
scopefalseBoolean: true or falsetrue creates a new Repl() for the component with its own Python context. false shares the Repl() context between editors globally, i.e. one editor can reference variables from another.
onResultundefinedFunction: [function expression][f_exp] or referencecallback function that receives the results when the code is run. (res, err) => { ... }
Edit this page on GitHub
GithubChatTwitterStack OverflowContributingColophonCitation