# HTMLNotebook

"HTMLNotebook" is used for `.html` files.

## Usage

### Setup

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

const index = new Nodebook.HTMLNotebook('index');
```

**setTitle(title)**

Sets the `<title>` keyword in `<head>`.

string `title`: The value for the `<title>` element.

```javascript
index.setTitle('My Blog'); // <title> now has the value 'My Blog'
```

**setMeta(property, content)**

Adds/Sets a Metadata (`<meta>`)property to a content

string `property`: The property of the `<meta>`.\
string `content`: The content of the `<meta>`.

```javascript
index.setMeta('ogp:title', 'The Blog of the Century');
```

**setLink(rel, href)**

Adds/Sets a Link (`<link>`)'s relationship (rel) to a value (href)

string `rel`: The relationship of the link to the href.\
string `href`: The href (value) of the link.

```javascript
index.setLink('stylesheet', 'styles/main.css');
```

**addElement(element, value, inBody, selfClose, style, styleclass, styleid, spaces)**

Creates an element, with provided options.

string `element`: The element name. Will be shown between the `<>`.\
string `value`: The element's value. Will be between the starting and finish element. If `selfClose` is set to true, this will be the `href`.\
`optional` boolean `inBody`: Whether or not to put the element inside the `<body>`element. If false, will be put after the `</body>`. Defaults to `true`.\
`optional` boolean `selfClose`: Whether or not the element will self close. If true, an element will not have the `/` closing version and the `value` will be set as the `href`. Defaults to `false`.\
`optional` string `style`: Style parameter for the element. Set to `null` or leave blank for no style.\
`optional` string `styleclass`: The Class the element is in. Set to `null` or leave blank for no class.\
`optional` string `styleid`: The ID the element has. Set to `null` or leave blank for no ID.\
`optional` integer `spaces`: The amount of spaces the element will put in before typing.

```javascript
index.addElement('p', 'This morning I had some coffee!');
index.addElement('p', 'What did you have this morning?', true, false, 'font-weight: bold;');
index.addElement('img', 'https://welovecatsandkittens.com/wp-content/uploads/2017/03/likes.jpg', true, true);
index.addElement('h4', 'My favorite kitten picture', true, false, 'color: light_gray;', 'image-footer', null, 6);
```


---

# 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/web/htmlnotebook.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.
