vuepress-plugin-typedoc
Advanced tools
Comparing version 0.10.3 to 0.11.0
{ | ||
"name": "vuepress-plugin-typedoc", | ||
"version": "0.10.3", | ||
"description": "A VuePress plugin to build api documentation with TypeDoc.", | ||
"main": "dist/index.js", | ||
"version": "0.11.0", | ||
"description": "A VuePress plugin to build API documentation with TypeDoc.", | ||
"main": "./dist/v1/index.js", | ||
"exports": { | ||
".": "./dist/v1/index.js", | ||
"./next": "./dist/v2/index.js" | ||
}, | ||
"files": [ | ||
@@ -18,25 +22,24 @@ "dist/" | ||
"homepage": "https://github.com/tgreyuk/typedoc-plugin-markdown/tree/master/packages/vuepress-plugin-typedoc", | ||
"peerDependencies": { | ||
"typedoc": ">=0.22.0", | ||
"typedoc-plugin-markdown": ">=3.11.10" | ||
}, | ||
"author": "Thomas Grey", | ||
"scripts": { | ||
"lint": "eslint ./src --ext .ts", | ||
"prepublishOnly": "yarn run lint && yarn run build", | ||
"build": "rm -rf ./dist && tsc", | ||
"test:init": "rm -rf test/site && yarn create vuepress-site test/site", | ||
"test:demo:start": "yarn run build && cd test/site/docs && yarn run dev", | ||
"test:demo:build": "yarn run build && cd test/site/docs && yarn run build && npx http-server ./src/.vuepress/dist -o" | ||
"build": "rm -rf ./dist && tsc" | ||
}, | ||
"author": "Thomas Grey", | ||
"peerDependencies": { | ||
"typedoc": ">=0.23.0", | ||
"typedoc-plugin-markdown": ">=3.13.0" | ||
}, | ||
"devDependencies": { | ||
"typedoc-plugin-markdown": ">=3.13.0" | ||
}, | ||
"license": "MIT", | ||
"keywords": [ | ||
"vuepress", | ||
"vuepress-plugin", | ||
"typedoc", | ||
"plugin", | ||
"markdown", | ||
"typescript", | ||
"api" | ||
], | ||
"gitHead": "7976973ebef53fcd873418866032b0cbd8a0cb59" | ||
] | ||
} |
110
README.md
# vuepress-plugin-typedoc | ||
A [VuePress](https://vuepress.vuejs.org/) plugin to build documentation with [TypeDoc](https://github.com/TypeStrong/typedoc). | ||
A [VuePress](https://vuepress.vuejs.org/) plugin to build API documentation with [typedoc](https://github.com/TypeStrong/typedoc). | ||
@@ -10,12 +10,9 @@ [![npm](https://img.shields.io/npm/v/vuepress-plugin-typedoc.svg)](https://www.npmjs.com/package/vuepress-plugin-typedoc) | ||
- Generates pages as part of the build. | ||
- Adds Front Matter to pages. | ||
- Generates sidebars config to enable navigation. | ||
- Generates pages in Markdown as part of the build. | ||
- Generates sidebar configuration. | ||
## Installation | ||
> Install in the same location as the VuePress root directory. | ||
> Install in the same location as your VuePress project root. | ||
This guide assumes that a VuePress project has been setup. See [getting started docs](https://vuepress.vuejs.org/guide/getting-started.html). | ||
```shell | ||
@@ -27,6 +24,10 @@ npm install typedoc typedoc-plugin-markdown vuepress-plugin-typedoc --save-dev | ||
### Config | ||
### v1.x | ||
Add the plugin to `.vuepress/config.js` and specify the required options (see [options](#options)). | ||
- Setup a VuePress project https://v1.vuepress.vuejs.org/guide/getting-started.html. | ||
- Add the plugin to `.vuepress/config.js` and specify the required options (see [options](#options)). | ||
- TypeDoc will be bootstraped with the Vuepress `dev` and `build` [cli commands](https://vuepress.vuejs.org/api/cli.html). | ||
#### `.vuepress/config.js` | ||
```js | ||
@@ -37,3 +38,3 @@ plugins: [ | ||
// Plugin / TypeDoc options | ||
// plugin options | ||
{ | ||
@@ -47,19 +48,37 @@ entryPoints: ['../src/index.ts'], | ||
TypeDoc will be bootstraped with the Vuepress `dev` and `build` [cli commands](https://vuepress.vuejs.org/api/cli.html): | ||
### v2.x | ||
```javascript | ||
"dev": "vuepress dev [targetDir]", | ||
"build": "vuepress build [targetDir]", | ||
- Setup a VuePress v2 project https://v2.vuepress.vuejs.org/guide/getting-started.html. | ||
- Using a plugin via string is not supported. Import the plugin directly in `.vuepress/config.ts` under the `next` entrypoint and specify the required options (see [options](#options)). | ||
- TypeDoc will be bootstraped with the Vuepress `dev` and `build` [cli commands](https://v2.vuepress.vuejs.org/reference/cli.html). | ||
#### `.vuepress/config.ts` | ||
```ts | ||
import { defaultTheme } from 'vuepress'; | ||
import { typedocPlugin } from 'vuepress-plugin-typedoc/next'; | ||
module.exports = { | ||
theme: defaultTheme({}), | ||
plugins: [ | ||
typedocPlugin({ | ||
// plugin options | ||
entryPoints: ['../src/index.ts'], | ||
tsconfig: '../tsconfig.json', | ||
}), | ||
], | ||
}; | ||
``` | ||
Once built the docs will be available at `/api` or equivalent out directory. | ||
### Typical project structure | ||
``` | ||
docs/ (Vuepress website root) | ||
βββ src/ | ||
β βββ .vuepress | ||
β β ββββconfig.js | ||
β β ββββdist/ (static site dir) | ||
β βββ api/ (compiled typedoc markdown) | ||
β βββ .vuepress | ||
β β βββ config.js|ts | ||
β β βββ dist/ (static site dir) | ||
β βββ api/ (output directory / compiled typedoc markdown) | ||
βββ package.json | ||
ββ βsrc (typescript source files) | ||
βββ tsconfig.json | ||
``` | ||
@@ -83,3 +102,3 @@ | ||
```js | ||
plugin:['typedoc-plugin-xyz'] | ||
plugin: ['typedoc-plugin-xyz']; | ||
``` | ||
@@ -94,35 +113,30 @@ | ||
### Plugin options | ||
| Name | Default | Description | | ||
| :----------------------- | :------ | :--------------------------------------------------------------------------- | | ||
| `out` | `"api"` | Output directory relative to docs directory. | | ||
| `hideInPageTOC` | `false` | Do not render in-page table of contents items. | | ||
| `sidebar.fullNames` | `false` | Display full names with module path if applicable. | | ||
| `sidebar.parentCategory` | `"API"` | The parent category label for sidebar. Pass `"none"` for no parent category. | | ||
In addition to TypeDoc options there are some custom plugin options that can be configured. | ||
| Name | Default | Description | | ||
| :-------------------------- | :------ | :--------------------------------------------------------------------------- | | ||
| `out` | `"api"` | Output directory relative to docs directory. | | ||
| `hideInPageTOC` | `false` | Do not render in-page table of contents items. | | ||
| `sidebar.autoConfiguration` | `true` | Set to `false` to disable auto sidebar configuration. | | ||
| `sidebar.fullNames` | `false` | Display full names with module path if applicable. | | ||
| `sidebar.parentCategory` | `"API"` | The parent category label for sidebar. Pass `"none"` for no parent category. | | ||
### Example config | ||
### Example options object | ||
```js | ||
{ | ||
// TypeDoc options | ||
entryPoints: ['../src/index.ts'], | ||
tsconfig: '../tsconfig.json', | ||
cleanOutputDir: true | ||
plugins: [ | ||
[ | ||
'vuepress-plugin-typedoc', | ||
{ | ||
// TypeDoc options | ||
entryPoints: ['../src/index.ts'], | ||
tsconfig: '../tsconfig.json', | ||
// Plugin options | ||
out: 'api', | ||
sidebar: { | ||
fullNames: true, | ||
parentCategory: 'API', | ||
}, | ||
}, | ||
], | ||
], | ||
// Plugin options | ||
out: 'api', | ||
sidebar: { | ||
fullNames: true, | ||
parentCategory: 'API', | ||
} | ||
} | ||
``` | ||
@@ -132,2 +146,2 @@ | ||
[MIT](https://github.com/tgreyuk/typedoc-plugin-markdown/blob/master/packages/vuepress-plugin-typedoc/LICENSE) | ||
[MIT](https://github.com/tgreyuk/typedoc-plugin-markdown/blob/master/packages/vuepress-plugin-typedoc/LICENSE) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20813
17
372
141
1
1