babel-plugin-literate
v0.0.2
Published
Allows [literate programming](https://en.wikipedia.org/wiki/Literate_programming) in Javascript via Babel 7.
Readme
babel-plugin-literate
Allows literate programming in Javascript via Babel 7.
Write your code with its documentation surrounding it as a Markdown file. Everything but the code blocks will be ignored.
Currently supports file extensions .js.md and .jsx.md.
Sample Babel Config
// babel.config.js
module.exports = {
plugins: ['babel-plugin-literate'],
};Usage with @babel/node
$ babel-node --extensions .md mytestfile.js.mdUsage with @babel/register
// main.js
require('@babel/register')({
extensions: ['.md'],
});Related
TODO
- [ ] Make file extensions configurable.
- [ ] Write better tests than just a Markdown file.
