@onerepo/plugin-docgen
Installation
Section titled InstallationConfiguration
Section titled Configurationdocgen()
Section titled docgen()Include the eslint
plugin in your oneRepo plugin setup:
Parameters
Section titled ParametersParameter | Type |
---|---|
opts | Options |
Options
Section titled OptionsFull configuration options for the Docgen core command.
Type declaration
Section titled Type declarationformat?
Section titled format?Default output format for the documentation
- Default:
'markdown'
name?
Section titled name?Override the name of the command.
- Default:
'docgen'
outFile?
Section titled outFile?If set, a file will be written by default to the given location (in the given outWorkspace
)
outWorkspace?
Section titled outWorkspace?If outFile
is also set, the generated documentation will be written out.
safeWrite?
Section titled safeWrite?Set to true to amend content to the given file using the file.writeSafe | file.writeSafe
method.
Commands
Section titled Commandsone docgen
Section titled one docgenGenerate documentation for the oneRepo cli.
Help documentation should always be easy to find. This command will help automate the creation of docs for this command-line interface. If you are reading this somewhere that is not your terminal, there is a very good chance that this command was already run for you!
Add this command to your one Repo tasks on pre-commit to ensure that your documentation is always up-to-date.
Option | Type | Description |
---|---|---|
--add | boolean | Add the output file to the git stage |
--format | "markdown" , "json" , default: "markdown" | Output format for documentation |
--heading-level | number | Heading level to start at for Markdown output |
--out-file | string | File to write output to. If not provided, stdout will be used |
--out-workspace | string | Workspace name to write the —out-file to |
--safe-write | boolean | Write documentation to a portion of the file with start and end sentinels. |
Advanced options
Option | Type | Description |
---|---|---|
--command | string | Start at the given command, skip the root and any others |
--show-advanced | boolean | Pair with --help to show advanced options. |
--use-defaults | boolean | Use the oneRepo default configuration. Helpful for generating default documentation. |