JSPM

markdown-it-codetabs

1.2.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 244
  • Score
    100M100P100Q93802F
  • License MIT

Show your code blocks in different tabs.

Package Exports

  • markdown-it-codetabs

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (markdown-it-codetabs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

markdown-it-codetabs

Code tabs plugin for markdown-it markdown parser.

Install

npm install markdown-it-codetabs --save

Use

  1. Render your file:

    var md = require('markdown-it')()
                .use(require('markdown-it-codetabs'));
    // `group` and `tab` can only contain characters in [A-Za-z0-9_].
    md.render('```js [group:tab]\nconsole.log("hello");\n```');
  2. Import your own styles, you can start from codetabs.scss.

MD Example

```js [g1:JavaScript]
console.log("hello");
```

```py [g1:Python3]
print("hello")
```

Notice: DON'T add anything except white space between two code blocks.