Generates an apidoc plugin for listing endpoint Author
npm install apidoc-plugin-authorThis plugin, as with all apiDoc plugins named as apidoc-plugin-*, can be installed locally or globally alongside the apidoc-core. Run either npm install apidoc-plugin-author or npm install -g apidoc-plugin-author.
author field in the generated documentation.js
/**
* @apiAuthor Jason Corns
**/
`The generated
api_data.json should now include a block like
` json
{
"author": "Jason Corns "
}
`$3
apiDoc is the visual wrapper that includes the template for the generated doc site. apiDoc has a dependency on apiDoc-core to generate documentation sites and the apidoc-plugin-author plugin must exist alongside _core_. In order to add the author field - or any other custom plugin field - the apiDoc template must be updated to include references to the new field.For example, fork the apiDoc and modify the
template-article block to add something like the following:
` handlebars
{{#if article.author}}Authored by: {{article.author}}
{{/if}}
`With this modification, and after updating the root project's dependency on apiDoc to the modified fork, a new line will appear below the article title, like
` html
Authored by: Jason Corns <JasonAllenCorns@users.noreply.github.com>
`Notes and known limitations
- The
author field, like all api____ fields, accept the lines containing the @apiAuthor mark and all lines thereafter up to either: another api____ mark, or: the end of the comment block. The content includes the newline mark(s) as a consolidated string. Issue #4 will cover this case.
- The author field is, for now, a singular field. Multiple author` listings will show only a single value, as a "last-in-wins" value.