Skip to content
This repository has been archived by the owner on Dec 31, 2021. It is now read-only.

Latest commit

 

History

History
36 lines (25 loc) · 795 Bytes

README.md

File metadata and controls

36 lines (25 loc) · 795 Bytes

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.