diff --git a/.gitignore b/.gitignore index a5107aa..242f43b 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ node_modules/ dist/ *.log coverage/ -docs/ \ No newline at end of file +docs/ +pageDocs/ \ No newline at end of file diff --git a/package.json b/package.json index bd91e4d..2fc0f89 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "build": "tsc && prettier --check 'dist/**/*' --write", "test": "jest --coverage", "lint": "eslint --ext=.ts,.tsx --max-warnings=0 src/ && prettier --check 'src/**/*'", - "docs": "typedoc --out docs/$npm_package_version && scripts/gen-docs-index.sh $npm_package_version", + "docs": "scripts/gen-docs.sh $npm_package_version", "version": "conventional-changelog -p angular -i CHANGELOG.md -s && git add CHANGELOG.md" }, "main": "dist/index.js", @@ -54,6 +54,7 @@ "react-test-renderer": "^16.9.0", "ts-jest": "^24.1.0", "typedoc": "^0.16.9", - "typescript": "^3.7" + "typescript": "^3.7", + "typedoc-plugin-markdown-pages": "^0.3.0" } } diff --git a/scripts/gen-docs-index.sh b/scripts/gen-docs-index.sh deleted file mode 100755 index 6c643e2..0000000 --- a/scripts/gen-docs-index.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -PKG_VERSION=$1 - -echo ";" > docs/index.html \ No newline at end of file diff --git a/scripts/gen-docs.sh b/scripts/gen-docs.sh new file mode 100755 index 0000000..7786187 --- /dev/null +++ b/scripts/gen-docs.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +PKG_VERSION=$1 + +mkdir pageDocs && ln -sf ../eslint-plugin/README.md pageDocs/EslintPlugin.md + +yarn run typedoc --out "docs/${PKG_VERSION}" + +echo ";" > docs/index.html + +rm -rf pageDocs \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index cdbdbeb..fce9ac4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,6 +12,8 @@ }, "typedocOptions": { "exclude": "src/__tests__/**/*", - "out": "docs" + "out": "docs", + "mdPagesSourcePath": "pageDocs", + "theme": "markdown-pages" } } diff --git a/yarn.lock b/yarn.lock index 2e324c2..6a26720 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5371,6 +5371,11 @@ typedoc-default-themes@^0.7.2: lunr "^2.3.8" underscore "^1.9.1" +typedoc-plugin-markdown-pages@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/typedoc-plugin-markdown-pages/-/typedoc-plugin-markdown-pages-0.3.0.tgz#17f0f9ff3aa312e9ed142eb15ea216ea95d5fb5f" + integrity sha512-QVWs6eL0BEOiRgJm6wRRgE8kESFv85HlefLv14ZbMM2VQ1HqErVeT9ukbhkYMznsD/juAsX3Xc5M+Ju7/ZDq4Q== + typedoc@^0.16.9: version "0.16.9" resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.16.9.tgz#d6f46f4dea7d3362029927a92981efdf896f435b"