# 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
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://nodebook.js.org/text/markdown.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
