Skip to content

Commit 6a2ae15

Browse files
AlexLakatoshuijing
andauthored
feat(docs): add mermaid support to docs (interledger#1929)
* Add mermaid support * Remove hoist command --------- Co-authored-by: Chen Hui Jing <[email protected]>
1 parent 006e7a9 commit 6a2ae15

File tree

6 files changed

+527
-2
lines changed

6 files changed

+527
-2
lines changed

packages/documentation/astro.config.mjs

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@ import react from '@astrojs/react'
66

77
import remarkMath from 'remark-math'
88
import rehypeMathjax from 'rehype-mathjax'
9+
import remarkMermaid from 'remark-mermaidjs'
910
import GraphQL from 'astro-graphql-plugin'
1011

1112
// https://astro.build/config
1213
export default defineConfig({
1314
site: 'https://rafiki.dev',
1415
outDir: './build',
1516
markdown: {
16-
remarkPlugins: [remarkMath],
17+
remarkPlugins: [remarkMath, remarkMermaid],
1718
rehypePlugins: [rehypeMathjax]
1819
},
1920
integrations: [

packages/documentation/netlify.toml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Settings in the [build] context are global and are applied to
2+
# all contexts unless otherwise overridden by more specific contexts.
3+
[build]
4+
# Directory where the build system installs dependencies
5+
# and runs your build. Store your package.json, .nvmrc, etc here.
6+
# If not set, defaults to the root directory.
7+
base = "packages/documentation"
8+
9+
# Directory that contains the deploy-ready HTML files and
10+
# assets generated by the build. This is an absolute path relative
11+
# to the base directory, which is the root by default (/).
12+
# This sample publishes the directory located at the absolute
13+
# path "root/project/build-output"
14+
publish = "build/"
15+
16+
# Default build command.
17+
command = "pnpm install --no-frozen-lockfile && pnpm dlx playwright install chromium && pnpm build"

packages/documentation/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"react-dom": "^18.2.0",
2222
"rehype-mathjax": "^4.0.3",
2323
"remark-math": "^5.1.1",
24+
"remark-mermaidjs": "^5.0.2",
2425
"sharp": "^0.32.6"
2526
}
2627
}

packages/documentation/src/content/docs/integration/event-handlers.md

+10
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Rafiki communicates with the Account Servicing Entity over webhook events, as me
99
The `incoming_payment.created` event indicates that an incoming payment has been created. It has not yet received any funds so no action is required. The webhook event is informational and allows the Account Servicing Entity to display upcoming incoming payments to their users.
1010

1111
```mermaid
12+
1213
sequenceDiagram
1314
1415
participant ASE as Account Servicing Entity
@@ -25,6 +26,7 @@ The `incoming_payment.completed` event indicates that an incoming payment has be
2526
Example: An incoming payment was completed and received $10.
2627

2728
```mermaid
29+
2830
sequenceDiagram
2931
3032
participant ASE as Account Servicing Entity
@@ -42,6 +44,7 @@ The `incoming_payment.expired` event indicates that an incoming payment has expi
4244
Example: An incoming payment has expired and received $2.55.
4345

4446
```mermaid
47+
4548
sequenceDiagram
4649
4750
participant ASE as Account Servicing Entity
@@ -59,6 +62,7 @@ The `outgoing_payment.created` event indicates that an outgoing payment has been
5962
Example: An outgoing payment for $12 has been created.
6063

6164
```mermaid
65+
6266
sequenceDiagram
6367
6468
participant ASE as Account Servicing Entity
@@ -76,6 +80,7 @@ The `outgoing_payment.completed` event indicates that an outgoing payment has su
7680
Example: An outgoing payment for $12 has been completed. $11.50 were sent. The Account Servicing Entity keeps $0.50 as fees.
7781

7882
```mermaid
83+
7984
sequenceDiagram
8085
8186
participant ASE as Account Servicing Entity
@@ -93,6 +98,7 @@ The `outgoing_payment.failed` event indicates that an outgoing payment has eithe
9398
Example: An outgoing payment for $12 has failed. $8 were sent.
9499

95100
```mermaid
101+
96102
sequenceDiagram
97103
98104
participant ASE as Account Servicing Entity
@@ -110,6 +116,7 @@ The `payment_pointer.web_monetization` event indicates that a payment pointer ha
110116
Example: A payment pointer received $0.33
111117

112118
```mermaid
119+
113120
sequenceDiagram
114121
115122
participant ASE as Account Servicing Entity
@@ -127,6 +134,7 @@ The `payment_pointer.not_found` event indicates that a [payment pointer](/refere
127134
Example: The payment pointer `https://example-wallet.com/carla_garcia` was requested but does not yet exist
128135

129136
```mermaid
137+
130138
sequenceDiagram
131139
132140
participant ASE as Account Servicing Entity
@@ -143,6 +151,7 @@ The `asset.liquidity_low` event indicates that the liquidity of an [asset](../re
143151
Example: The asset liquidity for USD (scale: 2) drops below 100.00 USD.
144152

145153
```mermaid
154+
146155
sequenceDiagram
147156
148157
participant ASE as Account Servicing Entity
@@ -159,6 +168,7 @@ The `peer.liquidity_low` event indicates that the liquidity of a [peer](../refer
159168
Example: The peer liquidity for Happy Life Bank drops below 100.00 USD.
160169

161170
```mermaid
171+
162172
sequenceDiagram
163173
164174
participant ASE as Account Servicing Entity

packages/documentation/src/content/docs/introduction/architecture.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The `backend` service has four responsibilities:
2323

2424
- Expose REST [Open Payments API](https://docs.openpayments.guide/reference) endpoints for public clients to perform account management tasks.
2525
- Expose an internal GraphQL Admin API for service operators to manage accounts and application settings like peering relationships.
26-
- Expose an [ILP connector](../concepts/interledger-protocol/connector.md) to send and receive STREAM packets with peers.
26+
- Expose an [ILP connector](/concepts/interledger-protocol/connector) to send and receive STREAM packets with peers.
2727
- Business logic to manage accounts and track balances.
2828

2929
The `backend`'s ILP functionality includes:

0 commit comments

Comments
 (0)