# manner-docs

> Walk Manner-based api and generate docs from schema files directly. No need for Fancy code comments!

Latest version **0.1.12** (published 2018-07-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install manner-docs
pnpm add manner-docs
yarn add manner-docs
bun add manner-docs
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.12 |
| Published | 2018-07-23 |
| First published | 2018-07-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 26.1 KB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Joesph Hopkins |
| Maintainers | joehop67 |
| Keywords | manner, api, docs, documentation, data, web, tether |

## Links

- npm: https://www.npmjs.com/package/manner-docs
- Repository: https://github.com/joehop67/manner-docs
- Homepage: https://github.com/joehop67/manner-docs#readme
- Issues: https://github.com/joehop67/manner-docs/issues
- npm.io page: https://npm.io/package/manner-docs

## Dependencies (3)

- [ejs](https://npm.io/package/ejs.md) ^2.6.1
- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.1
- [fs-extra](https://npm.io/package/fs-extra.md) ^7.0.0

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 0.1.12 (latest) — 2018-07-23
- 0.1.1 — 2018-07-23
- 0.0.1 — 2018-07-22

## README

# Manner-docs
#### Generate documentation for your Manner API directly from you schema files!

#### Note: This package is meant to be used in tandem with [Manner](https://github.com/tether/manner)

## Usage - Markdown
----
If your api is in a folder named `v1`:

Create a file named `docs.js`

```js
const docs = require('manner-docs')
const join = require('path').join

/**
 * Generate documentation in MarkDown format
 */

docs(join(__dirname, 'v1'), {output: 'markdown'})
```

and add the following to your `package.json` file:

```json
    "scripts": {
        "gendocs": "node docs.js"
    }
```

and run with the command:
`npm run gendocs`
Then watch in awe as your `v1` folder now contains a directory called `docs` with a structure resembling your api, but filled with MarkDown files that contain all the documentation you need for your API!

## Usage - Static Website
----
If your API is in a folder named `v1`

create a file named `docs.js` and add the following code:
```js
const docs = require('manner-docs')
const join = require('path').join

/**
 * Generate documentation and export to static website
 */

docs(join(__dirname, 'v1'), {output: 'static', config: {output: join(__dirname, 'v1', 'static_docs'), data: {name: 'My API', description: 'API For My App'}}})
```

then add this script to your `package.json` file:
```json
    "scripts": {
        "gendocs": "node docs.js"
    }
```
then run `npm run gendocs` and watch as a directory named `static_docs` appears in your `v1` directory!

This directory contains:
- `public` directory: where the outputted index.js lives (if you set your configuration as above)
- `data` directory: Stores a large JSON file containing all the data relevant to build the static website based on your api
- `static` directory: contains the index.ejs file used to generate the static website

Congratulations! You just generated a fully fledged API documentation website with minimal hassel! All the data lives inside `index.html` so feel free to customize it as you like! Though, I would recommend moving it from the specified output directory, as it will be overwritten if you generate your docs again!

### Config Data for Static option
When you choose to export your Manner-docs as a static website, it is recommended that you also include a config object in your options as such:
```
{output: 'static', config: {output: join(__dirname, 'v1', 'static_docs'), data: {name: 'My API', description: 'API For My App'}}}
```

Which sets the following:
- `config.output` is the directory where you wish to export your static website data to
- `config.data` is used to fill in the jumbotron header on the website. This consists of the following:
    * `name` is the name of your API project/the title for the static website
    * `description` serves as the subheading for your static website

### Serving your Static site
This part is up to you! You can use a custom express server, raw NodeJS, etc. The site is just standard HTML! Serve it how you like.

My humble recommendation is [http-server](https://github.com/indexzero/http-server) a blazingly fast, simple to use server that you can setup directly in your NPM scripts!

## Installation
____
```shell
npm install manner-docs --save-dev
```

## Contributing
____
If you'd like to contribute, feel free to fork the project and start hacking!

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