Skip to content

Commit 17d50e2

Browse files
RSginerjvandemo
authored andcommitted
feat(compodoc): add compodoc for generating documentation (#76)
* feat(compodoc): generate angular documentation * doc(README): add how to generate docs * doc(README): correct how to generate docs * refactor: move and correct how to generate docs, fix the build:docs script in package.json and add docs folder into npmignore * fix(package): dynamic library name generating docs * fix(package): dynamic library name on build:docs
1 parent 52ce370 commit 17d50e2

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,15 @@ This will generate a `dist` directory with:
114114
- `*.d.ts`: type definitions for you library
115115
- `sample-library.metadata.json`: metadata for your library to support AOT compilation
116116

117+
## Generating documentation for your library
118+
119+
From the root of your library directory, run:
120+
121+
```bash
122+
$ npm run build:docs
123+
```
124+
This will generate a `docs` directory with all documentation of your library
125+
117126
## Publishing your library to NPM
118127

119128
To publish your library to NPM, first generate the `dist` directory:

generators/app/templates/_package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"scripts": {
55
"build": "gulp build",
66
"build:watch": "gulp",
7+
"build:docs": "compodoc -p tsconfig.json -n <%= props.libraryName.original %> -d docs --hideGenerator",
78
"lint": "tslint --type-check --project tsconfig.json src/**/*.ts",
89
"test": "tsc && karma start"
910
},
@@ -29,6 +30,7 @@
2930
"@angular/core": "^4.0.0",
3031
"@angular/platform-browser": "^4.0.0",
3132
"@angular/platform-browser-dynamic": "^4.0.0",
33+
"@compodoc/compodoc": "^1.0.0-beta.7",
3234
"@types/jasmine": "2.5.38",
3335
"@types/node": "~6.0.60",
3436
"codelyzer": "~2.0.0",

generators/app/templates/npmignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Node
22
node_modules/*
33
npm-debug.log
4-
4+
docs/*
55
# DO NOT IGNORE TYPESCRIPT FILES FOR NPM
66
# TypeScript
77
# *.js

0 commit comments

Comments
 (0)