0.5.0 • Published 6 years ago

marked-extensions v0.5.0

Weekly downloads
38
License
MIT
Repository
github
Last release
6 years ago

marked-extensions

Provides markdown extensions on top of the marked library, including:

  • if/if-not markdown blocks
  • hide code language blocks based on active language
  • special doc syntax for writing documentation for multiple languages at once
  • Code line numbers
  • CodeMirror runMode integration
  • Mermaid integration
  • YAML meta data

Install

npm install marked-extensions --save

Usage

var { process } = require('marked-extensions');
var marked = require('marked');

var markdown = `
# @@docMethod:full_name(@@docParam:first_name, @@docParam:last_name)
```@doc
Parameters:
@@docParam:first_name @@docType:String - The first name
@@docParam:last_name @@docType:String - The last name

Return Value:
@@docType:String - The first and last name
```
`

var processed = process(marked, markdown, { language: 'javascript' });  

%method-doc

```%method-doc
{
    "method": "",
    "desc": "",
    "args": {
          "arg1": { "type": "", "desc": "" },
          "arg2": { "type": "", "desc": "" }
    },
    "returns": { "type": "", "desc": "" },
    "constraints": [
        ""
    ],
    "examples": [
        {"args": [], "returns": null },
        {"args": [], "returns": null }
    ],
    "examplesOnly": false, // set to true if you want to only show examples with no method doc
    "formatTypes": true, // defaults to true, set to false if you want to disable type formattings
    "languages": { // override a specific language
      "javascript": {
        "method": ""
      }
    }
}
```
0.5.0

6 years ago

0.4.5

7 years ago

0.4.4

7 years ago

0.4.3

7 years ago

0.4.1

7 years ago

0.3.8

7 years ago

0.3.7

7 years ago

0.3.6

7 years ago

0.3.5

7 years ago

0.3.4

7 years ago

0.3.3

7 years ago

0.3.2

7 years ago

0.3.0

7 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.13

7 years ago

0.1.12

8 years ago

0.1.11

8 years ago

0.1.10

8 years ago

0.1.9

8 years ago

0.1.8

8 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago