All Projects → vijithassar → rollup-plugin-markdown

vijithassar / rollup-plugin-markdown

Licence: other
import JavaScript from Markdown code blocks

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to rollup-plugin-markdown

rollup-plugin-generate-html-template
Rollup plugin for automatically injecting a script tag with the final bundle into an html file.
Stars: ✭ 58 (+262.5%)
Mutual labels:  rollup, rollup-plugin
rollup-plugin-collect-sass
Collect Sass, then compile
Stars: ✭ 17 (+6.25%)
Mutual labels:  rollup, rollup-plugin
postcss-font-grabber
A postcss plugin, it grabs remote font files and update your CSS, just like that.
Stars: ✭ 26 (+62.5%)
Mutual labels:  rollup, rollup-plugin
rollup-plugin-jscc
Conditional compilation and compile-time variable replacement for Rollup
Stars: ✭ 52 (+225%)
Mutual labels:  rollup, rollup-plugin
rollup-plugin-sizes
Rollup plugin to display bundle contents & size information
Stars: ✭ 77 (+381.25%)
Mutual labels:  rollup, rollup-plugin
rollup-plugin-purs
Bundles PureScript modules with Rollup
Stars: ✭ 71 (+343.75%)
Mutual labels:  rollup, rollup-plugin
rollup-plugin-userscript-metablock
Transform json file to userscript metablock and append on.
Stars: ✭ 26 (+62.5%)
Mutual labels:  rollup, rollup-plugin
rollup-plugin-tagged-template
Use plain HTML files as tagged templates.
Stars: ✭ 24 (+50%)
Mutual labels:  rollup, rollup-plugin
rollup-plugin-html
Import HTML files as strings in rollup build
Stars: ✭ 36 (+125%)
Mutual labels:  rollup, rollup-plugin
rollup-plugin-generate-package-json
Generate package.json file with packages from your bundle using Rollup
Stars: ✭ 29 (+81.25%)
Mutual labels:  rollup, rollup-plugin
rollup-plugin-closure-compiler-js
Rollup plugin for optimizing JavaScript with google-closure-compiler-js.
Stars: ✭ 31 (+93.75%)
Mutual labels:  rollup, rollup-plugin
web-config
A Rollup configuration to build modern web applications with sweet features as for example SCSS imports, Service Worker generation with Workbox, Karma testing, live reloading, coping resources, chunking, treeshaking, Typescript, license extraction, filesize visualizer, JSON import, budgets, build progress, minifying and compression with brotli a…
Stars: ✭ 17 (+6.25%)
Mutual labels:  rollup, rollup-plugin
rollup-plugin-inject-process-env
Inject environment variables in process.env with Rollup
Stars: ✭ 48 (+200%)
Mutual labels:  rollup, rollup-plugin
rollup-plugin-lit-css
Moved to https://github.com/bennypowers/lit-css
Stars: ✭ 35 (+118.75%)
Mutual labels:  rollup, rollup-plugin
rollup-plugin-external-globals
Transform external imports into global variables like output.globals.
Stars: ✭ 57 (+256.25%)
Mutual labels:  rollup, rollup-plugin
aria-vue
Testing tools for Vue components
Stars: ✭ 21 (+31.25%)
Mutual labels:  rollup
form-validation
FormValidation, the best validation library for JavaScript
Stars: ✭ 137 (+756.25%)
Mutual labels:  rollup
rollup-plugin-typescript-paths
Rollup Plugin to automatically resolve path aliases set in the compilerOptions section of tsconfig.json.
Stars: ✭ 32 (+100%)
Mutual labels:  rollup-plugin
ctx-core
A composable monorepo web-service/front-end toolkit
Stars: ✭ 25 (+56.25%)
Mutual labels:  rollup
base-ui
A component library for Vue developmemt
Stars: ✭ 35 (+118.75%)
Mutual labels:  rollup

Overview

This Rollup plugin lets you extract your JavaScript code from code blocks embedded in Markdown files, which in turn promotes good written documentation. This technique is called literate programming.

For a more detailed discussion about why you might want to do this, or to implement with other programming languages and other JavaScript build tools, please instead see lit, a shell script which provides the same functionality in a more agnostic fashion.

Example

GitHub Flavored Markdown represents code using fenced code blocks, which are demarcated with three backticks in a row:

function greeting() {
    console.log('hello world');
}

export { greeting };

After you import and run this plugin in your rollup.config.js configuration file, the greeting() function above can be imported directly from this Markdown document! For example, you might use the following ES6 module import statement:

import { greeting } from './path/to/README.md';

Sourcemaps will correctly point your debugging back to the original Markdown documents.

You must include js or javascript as a language specifier after opening up a fenced code block in Markdown. Fenced code blocks that specify any other language and fenced code blocks that do not specify a language at all will be ignored. This makes it possible for you to include other code in your Markdown file without that code being executed. This is particularly useful for including Bash commands.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].