From 298991bde314a67e85e06ffb0d1ef9d3ef3f744f Mon Sep 17 00:00:00 2001 From: kamiazya Date: Thu, 31 Mar 2022 19:04:49 +0900 Subject: [PATCH] add markdown include example --- example/package.json | 3 +++ example/src/foo.md | 6 ++++++ example/src/foo.ts | 4 ++++ example/src/index.ts | 2 ++ package.json | 2 +- 5 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 example/src/foo.md create mode 100644 example/src/foo.ts diff --git a/example/package.json b/example/package.json index f675bf6..0e4b330 100644 --- a/example/package.json +++ b/example/package.json @@ -2,6 +2,9 @@ "name": "example", "version": "1.0.0", "dependencies": {}, + "scripts": { + "doc": "typedoc --includes src" + }, "devDependencies": { "typedoc": "^0.22.13" } diff --git a/example/src/foo.md b/example/src/foo.md new file mode 100644 index 0000000..d784cd6 --- /dev/null +++ b/example/src/foo.md @@ -0,0 +1,6 @@ +# Foo + +```mermaid +graph TB + A --> B +``` diff --git a/example/src/foo.ts b/example/src/foo.ts new file mode 100644 index 0000000..db78cc6 --- /dev/null +++ b/example/src/foo.ts @@ -0,0 +1,4 @@ +/** + * [[include:foo.md]] + */ +export class Foo {} diff --git a/example/src/index.ts b/example/src/index.ts index 6a3cdf2..90b6e89 100644 --- a/example/src/index.ts +++ b/example/src/index.ts @@ -1,3 +1,5 @@ +export { Foo } from './foo'; + /** * Example * diff --git a/package.json b/package.json index a629d50..f4e9a18 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "lint": "eslint -c .eslintrc.json --ext ts src && prettier --check './**/*.ts'", "build": "rollup -c && prettier --write ./dist/*", "test": "jest", - "example": "cd example && yarn typedoc" + "example": "yarn --cwd example" }, "dependencies": { "html-escaper": "^3.0.0"