# noddity-render-static

> Generate static HTML from Noddity posts

Latest version **3.0.1** (published 2018-03-01) · WTFPL license · 0 weekly downloads

## Install

```sh
npm install noddity-render-static
pnpm add noddity-render-static
yarn add noddity-render-static
bun add noddity-render-static
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.1 |
| Published | 2018-03-01 |
| First published | 2015-09-04 |
| Weekly downloads | 0 |
| License | WTFPL |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8 |
| Dependencies | 4 |
| Unpacked size | 24.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | TehShrike |
| Maintainers | tehshrike |
| Keywords | noddity |

## Links

- npm: https://www.npmjs.com/package/noddity-render-static
- Repository: https://github.com/TehShrike/noddity-render-static
- Homepage: https://github.com/TehShrike/noddity-render-static#readme
- Issues: https://github.com/TehShrike/noddity-render-static/issues
- npm.io page: https://npm.io/package/noddity-render-static

## Dependencies (4)

- [pify](https://npm.io/package/pify.md) ~3.0.0
- [ractive](https://npm.io/package/ractive.md) ~0.8.14
- [random-uuid-v4](https://npm.io/package/random-uuid-v4.md) 0.0.6
- [noddity-template-parser](https://npm.io/package/noddity-template-parser.md) ~1.1.1

## Recent versions

- 3.0.1 (latest) — 2018-03-01
- 3.0.0 — 2018-03-01
- 2.4.3 — 2017-02-13
- 2.4.1 — 2017-01-10
- 2.4.0 — 2016-12-06
- 2.3.0 — 2016-11-15
- 2.2.4 — 2016-10-27
- 2.2.3 — 2016-10-27
- 2.2.2 — 2015-11-23
- 2.2.1 — 2015-10-20
- 2.2.0 — 2015-10-06
- 2.1.0 — 2015-10-02
- 2.0.1 — 2015-10-02
- 2.0.0 — 2015-10-02
- 1.2.0 — 2015-10-01
- … 4 more at https://npm.io/package/noddity-render-static/versions

## README

Render static HTML from a Noddity post.

# Usage

```js
const render = require('noddity-render-static')
const Butler = require('noddity-butler')
const Linkifier = require('noddity-linkifier')

const butler = new Butler(noddityUrlString | noddityRetrieval, levelUpDb, [options])
const linkifier = new Linkifier('#/myposts/')

const options = {
	butler: butler,
	linkifier: linkifier,
	data: {
		config: {
			configProperty: 'configValue'
		},
		arbitraryValue: 'lol'
	}
}

const html = await render('template.md', 'excellent-missive.md', options)

console.log(html)

```

# htmlPromise = render(template, post, options)

- `template`: either a Noddity post object, or file name of a post, to be used as the template into which the current post will be injected.  Should have `{{>current}}` in it somewhere - this is where the current/main post will show up.
- `post`: either a Noddity post object, or the file name of a post to be loaded
- `options`: all the other arguments
	- `butler`: a [Noddity Butler](https://www.npmjs.com/package/noddity-butler)
	- `linkifier`: a [Noddity Linkifier](https://www.npmjs.com/package/noddity-linkifier)
	- `data`: Any properties on the `data` object will be made available to the templates.
	- `convertToHtml`: don't turn the markdown into html

# Values accessible in Ractive expressions

- `postList`: an array of post objects that have dates, ordered by date descending.  Metadata is accessible on the object iself without having to use the `metadata` property
- `posts`: an object whose keys are the post file names, and whose value is the post object.  Right now the keys all have periods `.` stripped from them due to an issue with Ractive
- `removeDots`: a function that takes a string as input and returns a version with dots `.` removed
- `current`: the file name of the currently displayed post (the one specified in the url)

# License

[WTFPL](http://wtfpl2.com)

---
_Source: https://npm.io/package/noddity-render-static · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
