> For the complete documentation index, see [llms.txt](https://nodebook.js.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nodebook.js.org/text/markdown.md).

# MDNotebook

"MDNotebook" is a special class used for `.md` (Markdown) files.

## Usage

### Setup

```javascript
const Nodebook = require('nodejs-notebook');

const readme = new Nodebook.MDNotebook('README');
```

**note(value)**

Similar to `addLine()` but it does not automatically create an indent.

`value`:\
The value to add in the markdown file. Can be anything. *Required*

```javascript
readme.note('Welcome to Project!');
```

**createHeader(value, options)**

Creates a header inside the file.

string `value`:\
The value that the header will be. *Required*

object `options`:

* &#x20;`options.type`: The type of header to add. Defaults to h1.

```javascript
readme.createHeader('Installation');
// Adds a h1 called "Installation"

readme.createHeader('Usage', { type: '2'});
// Adds a h2 called "Usage"

readme.createHeader('About Us', { type: 3 });
// Adds a h3 called "About Us"

// Notice how both numbers and number strings are supported...
```

**createLink(url, text)**

Creates a link inside the markdown file.

string `url`:\
The URL that the link points to. *Required*

`text`:\
The text that, when clicked redirects to the URL. Optional.

```javascript
readme.createLink('https://docs.myproject.com');
// Creates a link that redirects to that URL with that URL showing.

readme.createLink('https://docs.myproject.com', 'Docs');
// Creates a link that redirects to that URL with 'Docs' showing.
```

**createList(list, options)**

Creates a list inside the markdown file.

array `list`:\
An array of items to be added to the list.

object `options`:

* `options.type`: The type of list. If `unordered`, list starts with a • . If `ordered`, list goes up numerically. Defaults to `unordered`.

```javascript
readme.createList(['Head Author: Alex', 'Co-Author: James'], { type: 'unordered'})
// Creates an unordered list with the array contents

readme.createList(['Usage', 'Introduction', 'Installation'], { type: 'ordered'});
// Creates an ordered list with the array contents
```
