From bba764bd28040c1681614230049158c48a20acbf Mon Sep 17 00:00:00 2001 From: Luke Schoen Date: Wed, 10 Oct 2018 13:16:36 +0200 Subject: [PATCH] feat: Fixes #210. Add Mermaid.js Gitbook plugin. Generate API flow diagram (#211) * feat: Add Mermaid.js Gitbook plugin. Generate API flow diagram * fix: Remove HTTP from diagram. Change text to funnel user to WS --- book.json | 1 + package.json | 1 + packages/rpc-core/src/index.ts | 8 ++++++++ 3 files changed, 10 insertions(+) diff --git a/book.json b/book.json index 76b7c9ebdf..8096b1138d 100644 --- a/book.json +++ b/book.json @@ -3,6 +3,7 @@ "gitbook": ">=2.4.0", "plugins": [ "include-codeblock", + "mermaid-gb3", "-highlight", "sunlight-highlighter" ], diff --git a/package.json b/package.json index d1c406fad9..4b27d21695 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ }, "dependencies": { "gitbook-plugin-include-codeblock": "^3.2.2", + "gitbook-plugin-mermaid-gb3": "^2.1.0", "gitbook-plugin-sunlight-highlighter": "^0.4.3" } } diff --git a/packages/rpc-core/src/index.ts b/packages/rpc-core/src/index.ts index 76b96808b1..250156d881 100644 --- a/packages/rpc-core/src/index.ts +++ b/packages/rpc-core/src/index.ts @@ -18,6 +18,14 @@ import isFunction from '@polkadot/util/is/function'; * @name Rpc * @summary The API may use a HTTP or WebSockets provider. * @description It allows for querying a Polkadot Client Node. + * WebSockets provider is recommended since HTTP provider only supports basic querying. + * + * ```mermaid + * graph LR; + * A[Api] --> |WebSockets| B[WsProvider]; + * B --> |endpoint| C[ws://127.0.0.1:9944] + * ``` + * * @example *
*