npm package: @rgrannell/markdown
Description: A utility library for generating markdown from JavaScript
Latest version: 9.4.0


# markdown (v9.3.0)

## Stability

> 0 - Experimental

A utility library for generating markdown from JavaScript



## Table of Contents

- [markdown.h1](#markdownh1)
  * [Parameters](#parameters)
- [markdown.h2](#markdownh2)
  * [Parameters](#parameters-1)
- [markdown.h3](#markdownh3)
  * [Parameters](#parameters-2)
- [markdown.h4](#markdownh4)
  * [Parameters](#parameters-3)
- [markdown.h5](#markdownh5)
  * [Parameters](#parameters-4)
- [markdown.h6](#markdownh6)
  * [Parameters](#parameters-5)
- [markdown.italic](#markdownitalic)
  * [Parameters](#parameters-6)
- [markdown.bold](#markdownbold)
  * [Parameters](#parameters-7)
- [markdown.mono](#markdownmono)
  * [Parameters](#parameters-8)
- [markdown.link](#markdownlink)
  * [Parameters](#parameters-9)
- [markdown.rule](#markdownrule)
- [markdown.list](#markdownlist)
  * [Parameters](#parameters-10)
- [markdown.code](#markdowncode)
  * [Parameters](#parameters-11)
- [markdown.document](#markdowndocument)
  * [Parameters](#parameters-12)

## API Documentation

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

## markdown.h1

Create a heading equivalent to <h1>

### Parameters

-   `text` **[String][1]** the heading text to display.

Returns **[text][2]** a markdown string displaying a header.

## markdown.h2

Create a heading equivalent to <h1>

### Parameters

-   `text` **[String][1]** the heading text to display.

Returns **[text][2]** a markdown string displaying a header.

## markdown.h3

Create a heading equivalent to <h2>

### Parameters

-   `text` **[String][1]** the heading text to display.

Returns **[text][2]** a markdown string displaying a header.

## markdown.h4

Create a heading equivalent to <h3>

### Parameters

-   `text` **[String][1]** the heading text to display.

Returns **[text][2]** a markdown string displaying a header.

## markdown.h5

Create a heading equivalent to <h4>

### Parameters

-   `text` **[String][1]** the heading text to display.

Returns **[text][2]** a markdown string displaying a header.

## markdown.h6

Create a heading equivalent to <h5>

### Parameters

-   `text` **[String][1]** the heading text to display.

Returns **[text][2]** a markdown string displaying a header.

## markdown.italic

Create italic text

### Parameters

-   `text` **[String][1]** the text to italicise.

Returns **[text][2]** a markdown string displaying italic text.

## markdown.bold

Create bold text

### Parameters

-   `text` **[String][1]** the text to embolden.

Returns **[text][2]** a markdown string displaying bold text.

## markdown.mono

Create monospace text

### Parameters

-   `text` **[String][1]** the target text.

Returns **[text][2]** monospaced text.

## markdown.link

Create a link

### Parameters

-   `text` **[String][1]** the text description
-   `link` **[String][1]** the URL

Returns **[text][2]** a markdown link.

## markdown.rule

Create a divider

Returns **[text][2]** a markdown divider.

## markdown.list

Create a markdown list

### Parameters

-   `lines` **[Array][3]&lt;[string][1]>** an array of list entries.

Returns **[text][2]** a markdown string displaying a list.

## markdown.code

Create a markdown code block

### Parameters

-   `text` **[String][1]** the source-code.

Returns **[text][2]** a code block

## markdown.document

Create a markdown document

### Parameters

-   `lines` **[Array][3]&lt;[string][1]>** the heading text to display.

Returns **[text][2]** a markdown doucment.

[1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String

[2]: https://developer.mozilla.org/docs/Web/HTML

[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array


## Dependencies

- Node.js >= v10.6.0
- NPM >= v10.6.0

## License

Copyright (c) 2020 Róisín Grannell

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.