An open API service indexing awesome lists of open source software.

https://github.com/ioncakephper/typedocinc

Include files in documentation generated with typedoc.
https://github.com/ioncakephper/typedocinc

documentation documentation-tool typedoc typescript

Last synced: about 1 month ago
JSON representation

Include files in documentation generated with typedoc.

Awesome Lists containing this project

README

          

# 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 `_before.md` and `_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`:

```bash
npm i typedocinc -g
```

Check it works:

```bash
typedocinc -h
```

```txt
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] prepare original documentation in by creating its before and after files
build|b [options] enhance original documentation in by mergind before and after files in the original documentation.
generate|g [options] prepare before and after files, enhance original documentation in by mergind before and after files
in the original documentation.
help [command] display help for command
```

## Usage

**Get basic help information**

```bash
// short option name
typedocinc -h

// or the long option name
typedocinc --help

// or the help command
typedocinc help [command]
```

**Get help for `prepare | p` command**

```bash
typedocinc help prepare
```

```txt
Usage: typedocin prepare|p [options]

prepare original documentation in by creating its before and after files

Options:
-i, --includes Path where before and after files will be created.
-c, --clear Override before and after files (default: false)
-d, --defaultIncludes Path to file with default content for includes files
-b, --beforeIncludes Path to file with default before content for includes files
-a, --afterIncludes Path to file with default after content for includes files
-h, --help display help for command
```

**Get help for `build | b` command**

```bash
typedocinc help build
```

```txt
Usage: typedocin build|b [options]

enhance original documentation in by mergind before and after files in the original documentation.

Options:
-i, --includes Path where before and after files already exist.
-t, --target Path where enhanced documentation is saved into.
-h, --help display help for command
```

**Get help for `generate | g` command**

```bash
typedocinc help generate
```

```txt
Usage: typedocin generate|g [options]

prepare before and after files, enhance original documentation in by mergind before and after files in the original documentation.

Options:
-i, --includes Path where before and after files already exist.
-t, --target Path where enhanced documentation is saved into.
-c, --clear Override before and after files (default: false)
-d, --defaultIncludes Path to file with default content for includes files
-b, --beforeIncludes Path to file with default before content for includes files
-a, --afterIncludes Path to file with default after content for includes files
-h, --help display help for command
```

## 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. |

## getDefaultIncludesContent(options) ⇒ string \| undefined
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'} |