typedocinc
Insert files content in documentation pages generated with typedoc
.
With this tool, API documentation writers will insert their own content before and after the original content of a typedoc-generated documentation. For every .html
file in the original documentation, the tool creates the <basename>_before.md
and <basename>_after.md
files. Next, the documentation writer adds content in these files. Finally, the tool merges the original documentation and the before
and after
files, and saves the new documentation.
Install
Install typedocinc
as global
:
npm i typedocinc -g
Check it works:
typedocinc -h
Usage: typedocin [options] [command] Includes files in documentation generated with typedoc Options: -V, --version output the version number -v, --verbose show detail messages during execution. (default: false) -h, --help display help for command Commands: prepare|p [options] <path> prepare original documentation in <path> by creating its before and after files build|b [options] <path> enhance original documentation in <path> by mergind before and after files in the original documentation. generate|g [options] <path> prepare before and after files, enhance original documentation in <path> by mergind before and after files in the original documentation. help [command] display help for command
Usage
typedocinc build original --includes original_includes --target original_modified
Build a modified documentation version in original_modified
. Merge the original documentation in original
folder with custom content in original_includes
folder.
The original_includes
folder contains the files with the content you want to include either before (_before
) or after (_after
) the API documentation text in the original
.
For example, you want to include your custom text before API text in original/index.html
. To this end, you will create the original_includes/index_before.md
file. To include your custom text after the API text in original/index.html
, you will create the original_includes/index_after.md
In original_includes/index_before.md
:
## Hello World! Welcome to our software product API documentation. You can find as at [FintechOS](http://fintechos.com). Use Markdown notation to quickly add content such as paragraphs, headers, tables, links, bullet and item lists.
In original_includes/index_after.md
:
## Awesome, right? We encourage you to contact us with your questions, comments and suggestions. Please feel free to contact our visit our [Community](http://community.fintechos.com).
typedocinc prepare original --includes original_includes
typedocinc prepare original --includes original_includes --clear
Getting help
Get basic help information
// short option nametypedocinc -h // or the long option nametypedocinc --help // or the help commandtypedocinc help [command]
prepare | p
command
Get help for typedocinc help prepare
Usage: typedocin prepare|p [options] <path> prepare original documentation in <path> by creating its before and after files Options: -i, --includes <path> Path where before and after files will be created. -c, --clear Override before and after files (default: false) -d, --defaultIncludes <path> Path to file with default content for includes files -b, --beforeIncludes <path> Path to file with default before content for includes files -a, --afterIncludes <path> Path to file with default after content for includes files -h, --help display help for command
build | b
command
Get help for typedocinc help build
Usage: typedocin build|b [options] <path> enhance original documentation in <path> by mergind before and after files in the original documentation. Options: -i, --includes <path> Path where before and after files already exist. -t, --target <path> Path where enhanced documentation is saved into. -h, --help display help for command
Get help for generate | g
command
typedocinc help generate
Usage: typedocin generate|g [options] <path> prepare before and after files, enhance original documentation in <path> by mergind before and after files in the original documentation. Options: -i, --includes <path> Path where before and after files already exist. -t, --target <path> Path where enhanced documentation is saved into. -c, --clear Override before and after files (default: false) -d, --defaultIncludes <path> Path to file with default content for includes files -b, --beforeIncludes <path> Path to file with default before content for includes files -a, --afterIncludes <path> Path to file with default after content for includes files -h, --help display help for command
More info
For more information and examples, visit Typedocinc Documentation.
Functions
- createIncludes(source, includes, options)
Create includes files for an original typedoc documentation.
- buildIncludes(source, includes, destination, options)
Merge includes files into original documentation.
Creates a copy of the source documentation containing the includes file for each source file as indicated in the specified folder. Saves resulting documentation in provided folder.
- getDefaultIncludesContent(options) ⇒
string
|undefined
Load default includes files as specified in provided keys.
createIncludes(source, includes, options)
Create includes files for an original typedoc documentation.
Kind: global function
Param | Type | Description |
---|---|---|
source | string |
Path of source (original) documentation. |
includes | string |
Path to includes folder. Create before and after includes files for each source file. |
options | object |
Object with key-value pairs |
buildIncludes(source, includes, destination, options)
Merge includes files into original documentation.
Creates a copy of the source documentation containing the includes file for each source file as indicated in the specified folder. Saves resulting documentation in provided folder.
Kind: global function
Param | Type | Description |
---|---|---|
source | string |
Path to source documentation. |
includes | string |
Path to folder with includes files. |
destination | string |
Path to resulting documentation, with original and includes files. |
options | object |
Object with options for building files. |
string
| undefined
getDefaultIncludesContent(options) ⇒ Load default includes files as specified in provided keys.
Kind: global function
Returns: string
| undefined
- If file exists, the content of the file, or undefined
otherwise.
Param | Type | Description |
---|---|---|
options | object |
Object whose keys are role for files and values are filenames {'beforeIncludes: 'path/to/file/to/include/before'} |