# @doop/docs

> Doop documentation module

Latest version **0.0.11** (published 2023-04-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install @doop/docs
pnpm add @doop/docs
yarn add @doop/docs
bun add @doop/docs
```

## Health

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

Positive: no vulnerabilities.

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

Negative: insecure dependencies; abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.11 |
| Published | 2023-04-20 |
| First published | 2021-04-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 70.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Matt Carter |
| Maintainers | hash-bang, mr-yellow |
| Keywords | Doop, Vue |

## Links

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

## Dependencies (5)

- [shins](https://npm.io/package/shins.md) ^2.6.0
- [globby](https://npm.io/package/globby.md) ^11.0.3
- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [pluralize](https://npm.io/package/pluralize.md) ^8.0.0
- [widdershins](https://npm.io/package/widdershins.md) git+https://github.com/MomsFriendlyDevCo/widdershins.git#feat-multiresponse

## Recent versions

- 0.0.11 (latest) — 2023-04-20
- 0.0.9 — 2022-07-11
- 0.0.8 — 2022-07-11
- 0.0.7 — 2022-07-11
- 0.0.6 — 2022-07-11
- 0.0.5 — 2022-07-05
- 0.0.4 — 2022-07-05
- 0.0.3 — 2021-05-07
- 0.0.2 — 2021-05-05
- 0.0.1 — 2021-04-07

## README

@DOOP/Docs
==================
Doop documentation module

This module generally lives inside a build script.


```javascript
/**
* Scan files for inline comments and build documentation 
*/
let gulp = require('gulp');
let {documenter} = require('@doop/docs');

gulp.task('build.vue', ['load:app', 'load:app.db', 'load:app.git'], ()=>
	documenter({
		log: gulp.log, // Fancy logging output
	})
);
```


API
===
This module exports only one sub-module currently, the `documenter` function.


Documenter(options)
-----------------
Scan project for inline documentation and process placing resulting files in the `dist/docs` directory within the parent Doop project.

This function expects the Doop global `app` to be available and it will use it for pathing, config information.

Options:

| Name            | Type       | Default          | Description                                                                      |
|-----------------|------------|------------------|----------------------------------------------------------------------------------|
| `widdershins`        | `Object`   | `{ codeSamples: true, user_templates: '../templates/widdershins' }` | Upstream widdershins config, see notes                                             |
| `shins`   | `Object`   | `shins: { inline: true, logo: './assets/logo/logo.png', 'logo-url': app.config.publicUrl },` | Upstream shins config, see notes                            |
| `log`           | `function` | `console.log`    | Logging function for any output                                                  |
| `responseTypes` | `Object` | `{ File: { type: 'application/octet-stream', schema: { type: 'string', format: 'binary' }}}` | Predefined content-type and schema for `@returns`


Usage
=============

* `@returns {Object}` where a collection is available will automagically be replaced with `@returns {ModelName}`
* `@returns {ModelName}` will create an `application/json` response with schema properties matching that of the Mongo collection.


Predefined Response Types
-------------------------

These types may be used in `@returns {Type}` and allow association of a response with a content-type and schema.

| Name            | Type       | Schema Type      | Schema Format    |
|-----------------|------------|------------------|------------------|
| `Stream`        | `application/octet-stream` | `string` | `binary` |
| `File`          | `application/octet-stream` | `string` | `binary` |
| `PDF`           | `application/pdf` | `string` | `binary` |
| `GIF`           | `image/gif` | `string` | `base64` |
| `JPEG`          | `image/jpeg` | `string` | `base64` |
| `PNG`           | `image/png` | `string` | `base64` |
| `String`        | `text/plain` | `string` | |
| `HTML`          | `text/html` | `string` | `html` |
| `Date`          | `text/plain` | `string` | `date` |
| `DateTime`      | `text/plain` | `string` | `date-time` |
| `Array`         | `application/json` | `array` | |
| `Object`        | `application/json` | `object` | |


**NOTES:**

* https://github.com/Mermade/widdershins#options
* https://github.com/Mermade/shins

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