You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: packages/documentation/README.md
+69-8
Original file line number
Diff line number
Diff line change
@@ -52,22 +52,25 @@ Refer to the Starlight documentation on [authoring content](https://starlight.as
52
52
53
53
### Docs components
54
54
55
-
We have extracted some of the commonly repeated patterns within the documentation pages into custom docs components that can be reused.
55
+
We have extracted some of the commonly repeated patterns within the documentation pages into custom docs components that can be reused. There are components which are shared across all our Starlight documentation sites and those which are specific to Web Monetization only. This will determine what the import path is.
56
56
57
57
-[CodeBlock](#codeblock-component)
58
58
-[Disclosure](#disclosure-component)
59
59
-[Hidden](#hidden-component)
60
60
-[LargeImg](#largeimg-component)
61
61
-[LinkOut](#linkout-component)
62
+
-[MermaidWrapper](#mermaidwrapper-component)
62
63
-[StylishHeader](#stylishheader-component)
63
64
-[Tooltip](#tooltip-component)
64
65
66
+
For more information about importing things in Javascript, please refer to [import on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import).
67
+
65
68
1.#### `CodeBlock` component
66
69
67
70
Use this component if you wish to add a title to your code block. It takes a `title` attribute, which will be displayed above the code. To use it, your docs page must be in `.mdx` format. Please change the format from `.md` to `.mdx` if necessary. All your existing markdown will still be supported without issue. Import the `CodeBlock` component like so:
68
71
69
-
```
70
-
import CodeBlock from '/src/components/docs/CodeBlock'
Use the `<CodeBlock>` component within your content like so:
@@ -100,7 +103,7 @@ We have extracted some of the commonly repeated patterns within the documentatio
100
103
To use it, your docs page must be in `.mdx` format. Please change the format from `.md` to `.mdx` if necessary. All your existing markdown will still be supported without issue. Import the `Disclosure` component like so:
Use the `<Disclosure>` component within your content like so:
@@ -145,6 +148,10 @@ We have extracted some of the commonly repeated patterns within the documentatio
145
148
146
149
Use this component to hide content that is temporarily not ready to be shown to the public. This is not meant for long-term use, but a stop-gap when the current implementation is still far away from our documentation/specifications, and the content we have will be relevant but in the future.
Unfortunately, due to the nature of how the ToC on the right is generated, if we want to hide an entire section (including the header), we will have to manually hide the section heading by either commenting it out or deleting it.
149
156
150
157
1.#### `LargeImg` component
@@ -154,7 +161,7 @@ We have extracted some of the commonly repeated patterns within the documentatio
154
161
To use it, your docs page must be in `.mdx` format. Please change the format from `.md` to `.mdx` if necessary. All your existing markdown will still be supported without issue. Import the `LargeImg` component like so:
Use the `<LargeImg>` component within your content like so:
@@ -163,6 +170,16 @@ We have extracted some of the commonly repeated patterns within the documentatio
163
170
<LargeImg src='/img/OMG_A_GIGANTIC_IMG.png' alt='A really large diagram'/>
164
171
```
165
172
173
+
By default, there will be a border around the image, but if you want to remove the border, pass in a `hasBorder={false}` attribute.
174
+
175
+
```jsx
176
+
<LargeImg
177
+
src='/img/OMG_A_GIGANTIC_IMG.png'
178
+
alt='A really large diagram'
179
+
hasBorder={false}
180
+
/>
181
+
```
182
+
166
183
For user doc diagrams, be sure to include the `docs` folder in the path.
167
184
168
185
```jsx
@@ -179,7 +196,7 @@ We have extracted some of the commonly repeated patterns within the documentatio
179
196
To use it, your docs page must be in `.mdx` format. Please change the format from `.md` to `.mdx` if necessary. All your existing markdown will still be supported without issue. Import the `LinkOut` component like so:
Use the `<LinkOut>` component within your content like so:
@@ -196,12 +213,56 @@ We have extracted some of the commonly repeated patterns within the documentatio
196
213
</LinkOut>
197
214
```
198
215
216
+
1.#### `MermaidWrapper` component
217
+
218
+
Use this component if your Mermaid diagram is much larger than our available space and you would like users to view the full diagram in another tab. This adds "View full diagram" button with an external link indicator on the bottom right corner under the diagram. Note that the `client:load` attribute is required for the functionality to work because this component relies on state.
219
+
220
+
To use it, your docs page must be in `.mdx` format. Please change the format from `.md` to `.mdx` if necessary. All your existing markdown will still be supported without issue. Import the `MermaidWrapper` component like so:
Use the `<MermaidWrapper>` component within your content like so:
227
+
228
+
````jsx
229
+
<MermaidWrapper client:load>
230
+
```mermaid sequenceDiagram Alice ->> Bob: Hello Bob, how are you?
231
+
Bob-->>John: How about you John? Bob--x Alice: I am good thanks! Bob-x
232
+
John: I am good thanks! Note right of John: Bob thinks a long
233
+
<br />
234
+
long time, so long
235
+
<br />
236
+
that the text does
237
+
<br />
238
+
not fit on a row. Bob-->Alice: Checking with John... Alice->John: Yes...
239
+
John, how are you? ```
240
+
</MermaidWrapper>
241
+
````
242
+
243
+
By default, there will be a border around the image, but if you want to remove the border, pass in a `hasBorder={false}` attribute.
244
+
245
+
````jsx
246
+
<MermaidWrapper client:load hasBorder={false}>
247
+
```mermaid sequenceDiagram Alice ->> Bob: Hello Bob, how are you?
248
+
Bob-->>John: How about you John? Bob--x Alice: I am good thanks! Bob-x
249
+
John: I am good thanks! Note right of John: Bob thinks a long
250
+
<br />
251
+
long time, so long
252
+
<br />
253
+
that the text does
254
+
<br />
255
+
not fit on a row. Bob-->Alice: Checking with John... Alice->John: Yes...
256
+
John, how are you? ```
257
+
</MermaidWrapper>
258
+
````
259
+
199
260
1.#### `StylishHeader` component
200
261
201
262
Use this component if you wish to create a stylized heading that does not use the heading elements such that it will not appear in the ToC right sidebar. To use it, your docs page must be in `.mdx` format. Please change the format from `.md` to `.mdx` if necessary. All your existing markdown will still be supported without issue. Import the `StylishHeader` component like so:
Use the `<StylishHeader>` component within your content like so:
@@ -217,7 +278,7 @@ We have extracted some of the commonly repeated patterns within the documentatio
217
278
To use it, your docs page must be in `.mdx` format. Please change the format from `.md` to `.mdx` if necessary. All your existing markdown will still be supported without issue. Import the `Tooltip` component like so:
218
279
219
280
```jsx
220
-
import Tooltip from '/src/components/docs/Tooltip'
281
+
import { Tooltip } from '@interledger/docs-design-system'
221
282
```
222
283
223
284
Use the `<Tooltip>` component within your content like so:
0 commit comments