0.0.11 • Published 1 year ago

@doop/docs v0.0.11

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@DOOP/Docs

Doop documentation module

This module generally lives inside a build script.

/**
* 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:

NameTypeDefaultDescription
widdershinsObject{ codeSamples: true, user_templates: '../templates/widdershins' }Upstream widdershins config, see notes
shinsObjectshins: { inline: true, logo: './assets/logo/logo.png', 'logo-url': app.config.publicUrl },Upstream shins config, see notes
logfunctionconsole.logLogging function for any output
responseTypesObject{ 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.

NameTypeSchema TypeSchema Format
Streamapplication/octet-streamstringbinary
Fileapplication/octet-streamstringbinary
PDFapplication/pdfstringbinary
GIFimage/gifstringbase64
JPEGimage/jpegstringbase64
PNGimage/pngstringbase64
Stringtext/plainstring
HTMLtext/htmlstringhtml
Datetext/plainstringdate
DateTimetext/plainstringdate-time
Arrayapplication/jsonarray
Objectapplication/jsonobject

NOTES:

0.0.11

1 year ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago