diff --git a/README.md b/README.md index e284a35..40076dd 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,18 @@ -[![Build Status](https://travis-ci.org/kamiazya/typedoc-plugin-mermaid.svg?branch=master)](https://travis-ci.org/kamiazya/typedoc-plugin-mermaid) [![CodeFactor](https://www.codefactor.io/repository/github/kamiazya/typedoc-plugin-mermaid/badge)](https://www.codefactor.io/repository/github/kamiazya/typedoc-plugin-mermaid) [![npm version](https://badge.fury.io/js/typedoc-plugin-mermaid.svg)](https://badge.fury.io/js/typedoc-plugin-mermaid) [![Maintainability](https://api.codeclimate.com/v1/badges/827855fa3daba03076b4/maintainability)](https://codeclimate.com/github/kamiazya/typedoc-plugin-mermaid/maintainability) [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fkamiazya%2Ftypedoc-plugin-mermaid.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fkamiazya%2Ftypedoc-plugin-mermaid?ref=badge_shield) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![typedoc-plugin-mermaid Dev Token](https://badge.devtoken.rocks/typedoc-plugin-mermaid)](https://devtoken.rocks/package/typedoc-plugin-mermaid) - +[![Build Status](https://travis-ci.org/kamiazya/typedoc-plugin-mermaid.svg?branch=master)](https://travis-ci.org/kamiazya/typedoc-plugin-mermaid) [![CodeFactor](https://www.codefactor.io/repository/github/kamiazya/typedoc-plugin-mermaid/badge)](https://www.codefactor.io/repository/github/kamiazya/typedoc-plugin-mermaid) [![npm version](https://badge.fury.io/js/typedoc-plugin-mermaid.svg)](https://badge.fury.io/js/typedoc-plugin-mermaid) [![Maintainability](https://api.codeclimate.com/v1/badges/827855fa3daba03076b4/maintainability)](https://codeclimate.com/github/kamiazya/typedoc-plugin-mermaid/maintainability) [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fkamiazya%2Ftypedoc-plugin-mermaid.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fkamiazya%2Ftypedoc-plugin-mermaid?ref=badge_shield) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![typedoc-plugin-mermaid Dev Token](https://badge.devtoken.rocks/typedoc-plugin-mermaid)](https://devtoken.rocks/package/typedoc-plugin-mermaid) [![BCH compliance](https://bettercodehub.com/edge/badge/kamiazya/typedoc-plugin-mermaid?branch=master)](https://bettercodehub.com/) # typedoc-plugin-mermaid -A plugin for TypeDoc that generates graphs for mermaid.js diagrams by "mermaid" annotation. +A plugin for TypeDoc that generates graphs for mermaid.js diagrams by @mermaid annotation. ## Usage -Write tsdoc with `@mermaid` annotation. +Write tsdoc with `@mermaid` annotation ```typescript /** * Hoge is sample class for example of `typedoc-plugin-mermaid`. * - * @mermaid + * @mermaid Make TypeDoc easy to use with mermaid.js * graph TB * mermaid.js --> TypeDoc; */ @@ -22,9 +21,9 @@ export class Hoge { ``` -↓↓↓ +[↓↓ DEMO ↓↓](https://kamiazya.github.io/typedoc-plugin-mermaid/classes/hoge.html) -[![DEMO](./img/example.png)](https://kamiazya.github.io/typedoc-plugin-mermaid/classes/hoge.html) +[![Example](./media/example.png)](https://kamiazya.github.io/typedoc-plugin-mermaid/classes/hoge.html) ## Installation diff --git a/docs/assets/js/search.js b/docs/assets/js/search.js index f7488ee..61d3149 100644 --- a/docs/assets/js/search.js +++ b/docs/assets/js/search.js @@ -1,3 +1,3 @@ var typedoc = typedoc || {}; typedoc.search = typedoc.search || {}; - typedoc.search.data = {"kinds":{"128":"Class","2048":"Method"},"rows":[{"id":0,"kind":128,"name":"Hoge","url":"classes/hoge.html","classes":"tsd-kind-class"},{"id":1,"kind":2048,"name":"exampleForGraphLR","url":"classes/hoge.html#exampleforgraphlr","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Hoge"}]}; \ No newline at end of file + typedoc.search.data = {"kinds":{"128":"Class","2048":"Method"},"rows":[{"id":0,"kind":128,"name":"Hoge","url":"classes/hoge.html","classes":"tsd-kind-class"},{"id":1,"kind":2048,"name":"aliceGreetingFlow","url":"classes/hoge.html#alicegreetingflow","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Hoge"},{"id":2,"kind":2048,"name":"multiGraphs","url":"classes/hoge.html#multigraphs","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Hoge"}]}; \ No newline at end of file diff --git a/docs/classes/hoge.html b/docs/classes/hoge.html index 09a526f..3c3f720 100644 --- a/docs/classes/hoge.html +++ b/docs/classes/hoge.html @@ -73,7 +73,7 @@

Class Hoge

mermaid
-

+

Make TypeDoc easy to use with mermaid.js

graph TB mermaid.js --> TypeDoc;
@@ -95,7 +95,8 @@

Index

Methods

@@ -104,26 +105,67 @@

Methods

Methods

- -

exampleForGraphLR

+ +

aliceGreetingFlow

    -
  • exampleForGraphLR(): void
  • +
  • aliceGreetingFlow(): void
  • +
    +

    Alice says "Hello John, how are you?" to Jone, + then John says "Great!".

    +
    mermaid
    -

    +

    Alice greet to Jone

    +
    sequenceDiagram + Alice->>John: Hello John, how are you? + John-->>Alice: Great! +
    +
    +
    +

    Returns void

    +
  • +
+
+
+ +

Abstract multiGraphs

+
    +
  • multiGraphs(): void
  • +
+
    +
  • + +
    +
    +

    Subgraphs.

    +
    +
    +
    mermaid
    +

    Subgraphs Example

    graph LR - A --- B - B-->C[fa:fa-ban forbidden] - B-->D(fa:fa-spinner); + A[Hard edge] -->|Link text| B(Round edge) + B --> C{Decision} + C -->|One| D[Result one] + C -->|Two| E[Result two] +
    +
    mermaid
    +

    Alice greet to Jone

    +
    sequenceDiagram + Alice->>John: Hello John, how are you? + John-->>Alice: Great!
    @@ -149,7 +191,10 @@

    Returns voidHoge

  • diff --git a/docs/index.html b/docs/index.html index b2f40b5..7ac4200 100644 --- a/docs/index.html +++ b/docs/index.html @@ -64,23 +64,23 @@

    typedoc-plugin-mermaid-example-package

    -

    Build Status CodeFactor npm version Maintainability FOSSA Status License: MIT typedoc-plugin-mermaid Dev Token

    +

    Build Status CodeFactor npm version Maintainability FOSSA Status License: MIT typedoc-plugin-mermaid Dev Token BCH compliance

    typedoc-plugin-mermaid

    -

    A plugin for TypeDoc that generates graphs for mermaid.js diagrams by "mermaid" annotation.

    +

    A plugin for TypeDoc that generates graphs for mermaid.js diagrams by @mermaid annotation.

    Usage

    -

    Write tsdoc with @mermaid annotation.

    +

    Write tsdoc with @mermaid annotation

    /**
      * Hoge is sample class for example of `typedoc-plugin-mermaid`.
      *
    - * @mermaid
    + * @mermaid Make TypeDoc easy to use with mermaid.js
      * graph TB
      *   mermaid.js --> TypeDoc;
      */
     export class Hoge {
     }
     
    -

    ↓↓↓

    -

    DEMO

    +

    ↓↓ DEMO ↓↓

    +

    Example

    Installation

    The plugin can then be installed using npm:

    NPM

    diff --git a/docs/media/example.png b/docs/media/example.png new file mode 100644 index 0000000..82f131e Binary files /dev/null and b/docs/media/example.png differ diff --git a/example/Hoge.ts b/example/Hoge.ts index 610a4c5..8390d6c 100644 --- a/example/Hoge.ts +++ b/example/Hoge.ts @@ -1,21 +1,40 @@ /** * Hoge is sample class for example of `typedoc-plugin-mermaid`. * - * @mermaid + * @mermaid Make TypeDoc easy to use with mermaid.js * graph TB * mermaid.js --> TypeDoc; */ -export class Hoge { +export abstract class Hoge { /** + * Alice says "Hello John, how are you?" to Jone, + * then John says "Great!". * - * @mermaid - * graph LR - * A --- B - * B-->C[fa:fa-ban forbidden] - * B-->D(fa:fa-spinner); + * @mermaid Alice greet to Jone + * sequenceDiagram + * Alice->>John: Hello John, how are you? + * John-->>Alice: Great! */ - public exampleForGraphLR() { - console.log('graphLR'); + public aliceGreetingFlow() { + console.log('Alice', 'Hello John, how are you?'); + console.log('John', 'Great!'); } + + /** + * Subgraphs. + * + * @mermaid Subgraphs Example + * graph LR + * A[Hard edge] -->|Link text| B(Round edge) + * B --> C{Decision} + * C -->|One| D[Result one] + * C -->|Two| E[Result two] + * + * @mermaid Alice greet to Jone + * sequenceDiagram + * Alice->>John: Hello John, how are you? + * John-->>Alice: Great! + */ + public abstract multiGraphs(): void; } diff --git a/example/package.json b/example/package.json index 6a92fc0..872c220 100644 --- a/example/package.json +++ b/example/package.json @@ -20,7 +20,7 @@ "devDependencies": { "live-server": "^1.2.1", "typedoc": "^0.14.2", - "typedoc-plugin-mermaid": "^0.9.2", + "typedoc-plugin-mermaid": "^0.9.7", "typescript": "^3.3.3333" } } diff --git a/example/typedoc.json b/example/typedoc.json index 560330f..150ca26 100644 --- a/example/typedoc.json +++ b/example/typedoc.json @@ -1,4 +1,5 @@ { "mode": "file", - "out": "../docs" + "out": "../docs", + "media": "../media" } \ No newline at end of file diff --git a/example/yarn.lock b/example/yarn.lock index 0db6ce6..6dde4f5 100644 --- a/example/yarn.lock +++ b/example/yarn.lock @@ -1658,10 +1658,10 @@ typedoc-default-themes@^0.5.0: resolved "https://registry.yarnpkg.com/typedoc-default-themes/-/typedoc-default-themes-0.5.0.tgz#6dc2433e78ed8bea8e887a3acde2f31785bd6227" integrity sha1-bcJDPnjti+qOiHo6zeLzF4W9Yic= -typedoc-plugin-mermaid@^0.9.2: - version "0.9.2" - resolved "https://registry.yarnpkg.com/typedoc-plugin-mermaid/-/typedoc-plugin-mermaid-0.9.2.tgz#400f1f316c1b06199e9ad72a2b6f7fe401e329c9" - integrity sha512-ci7xriIc9RceE+o++uOqi757E2vltvb756bKHWtga2yOJIuYWHWd8JaOnlH8AitCzbEGY2q43GjhCOPyUAOwuw== +typedoc-plugin-mermaid@^0.9.7: + version "0.9.7" + resolved "https://registry.yarnpkg.com/typedoc-plugin-mermaid/-/typedoc-plugin-mermaid-0.9.7.tgz#820ea6a4cbe9b3439804acdc811daf9c96137c2f" + integrity sha512-9CCJp8bFsHzKTMQ1e2UUPeAwSGzgaJP4IMzPJ3QIejx7Dupy7CF2MB0gtcGurOMTk0y/DgTRd72EoFIkVwZvaw== typedoc@^0.14.2: version "0.14.2" diff --git a/img/example.png b/img/example.png deleted file mode 100644 index 78426a3..0000000 Binary files a/img/example.png and /dev/null differ diff --git a/media/example.png b/media/example.png new file mode 100644 index 0000000..82f131e Binary files /dev/null and b/media/example.png differ