Skip to content

Commit d461e4b

Browse files
committed
docs: run formatter on md files
1 parent ba86481 commit d461e4b

File tree

108 files changed

+2515
-2068
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+2515
-2068
lines changed

CONTRIBUTING.md

+68-18
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ sidebar: auto
77
Agoric's public-facing technical documentation is mostly in the [Agoric Documentation GitHub repo](https://github.com/Agoric/documentation).
88
The complete documentation set also includes external items such as papers, presentations, videos, etc. Our document
99
process is:
10+
1011
1. Write docs in the repo in Markdown. Image files are usually in `.svg` format and also stored in the repo.
1112
2. Proofread your docs. However, be aware that everyone is their own worst proofreader and this is especially
1213
true if you try to do it immediately or very soon after you finish writing it. Given our frequent time pressure, while
@@ -29,9 +30,10 @@ process is:
2930
9. [VitePress](https://vitepress.dev/guide/what-is-vitepress) automatically
3031
processes any new or changed files for display.
3132
10. The [Agoric website's Documentation Section](https://agoric.com/documentation/) displays
32-
the VitePress processed files, which have been converted to HTML.
33+
the VitePress processed files, which have been converted to HTML.
3334

3435
This doc explains:
36+
3537
- The overall documentation structure.
3638
- Our preferred way of writing links.
3739
- What happens when you make a PR.
@@ -88,14 +90,17 @@ on one page and that they aren't too long. Otherwise the sidebar menu for the pa
8890

8991
Individual pages do not automatically display a sidebar menu for their headers without the use of a plugin.
9092
To force an individual page sidebar menu, add the following YAML at the top of a page's source file (this file has this YAML at the top):
93+
9194
```js
9295
---
9396
sidebar: auto
9497
---
9598
```
99+
96100
Other ways of activating this are:
97101

98102
Turn it on for the whole site:
103+
99104
```js
100105
// .vitepress/config.js
101106
module.exports = {
@@ -106,23 +111,24 @@ module.exports = {
106111
```
107112

108113
Or, add a config entry, either as part of a group or as an individual page.
114+
109115
```js
110116
// .vitepress/config.js
111117
module.exports = {
112118
themeConfig: {
113119
sidebar: [
114120
{
115-
title: 'Group 1', // required
116-
link: '/foo/', // optional, link of the title, which should be an absolute path and must exist
121+
title: 'Group 1', // required
122+
link: '/foo/', // optional, link of the title, which should be an absolute path and must exist
117123
collapsable: false, // optional, defaults to true
118-
sidebarDepth: 1, // optional, defaults to 1
119-
items: [
120-
{ text: '', link: '/' },
121-
]
124+
sidebarDepth: 1, // optional, defaults to 1
125+
items: [{ text: '', link: '/' }]
122126
},
123127
{
124128
title: 'Group 2',
125-
items: [ /* ... */ ],
129+
items: [
130+
/* ... */
131+
],
126132
initialOpenGroupIndex: -1 // optional, defaults to 0, defines the index of initially opened subgroup
127133
}
128134
]
@@ -152,7 +158,7 @@ by just linking to `(/glossary/#allocation)`; its path starting at `main`. Any p
152158
at `main`. These links also open in the same browser tab.
153159

154160
VitePress turns every header in a Markdown file into an HTML anchor you can link to, so clicking such a link takes you directly to
155-
that file location (called *slugifying* by WordPress and other blogging platforms). A header link consists of its file
161+
that file location (called _slugifying_ by WordPress and other blogging platforms). A header link consists of its file
156162
name, with an appended `#` and appended altered header text. The header text in a link has been converted to
157163
to lower case and all non-alphanumerics, including spaces, have been replaced by hyphens. The two exceptions to the latter
158164
are, first, all consecutive non-alphanumbers are converted to a single hyphen; i.e. "Foo&$ Bar" is converted to "foo-bar".
@@ -223,11 +229,13 @@ displayed in a doc.
223229
You can make an entire code file, or any part of it, into a snippet (each
224230
of which can be used multiple times in the docs). Just surround the part
225231
you want to be a snippet with `#region` and `#endregion` comments:
232+
226233
```js
227234
// #region regionName
228235
...
229236
// #endregion regionName
230237
```
238+
231239
`regionName` in the above is any name you want to give this snippet.
232240

233241
If you want the whole file to be a snippet, just put the `#region` / `#endregion`
@@ -248,6 +256,7 @@ the file.
248256
The tests should be in the snippets directory. Actually the snippet files and the test files ended up being the same file because that was the cleanest way to go. The snippet files should all be named test-original-filename.js where original-filename is the markdown filename, like amounts of ertp/guide/amounts.md
249257

250258
To test your snippets files while writing your docs:
259+
251260
1. Write tests using AVA. They should be in the appropriate file in the snippets directory, with files named `test-original-filename.js` `original-filename` is
252261
the Markdown filename. For example, `test-amounts.js` for `ertp/guide/amounts.md` See [this Snippets file](/snippets/ertp/guide/test-amounts.js)
253262
2. Run the tests with `yarn test` (run from anywhere, but usually from the root of the repo).
@@ -266,43 +275,53 @@ broken links, and what file and line number they're at.
266275
## Local Install, Build, and Run
267276

268277
1. **Clone**: Clone the Documentation repo to your local machine. We suggest using
269-
Sourcetree to manage your local and remote copies and the various commits
270-
and pull requests you'll make while debugging. The following steps should all
271-
be run from the directory you cloned the repo into.
278+
Sourcetree to manage your local and remote copies and the various commits
279+
and pull requests you'll make while debugging. The following steps should all
280+
be run from the directory you cloned the repo into.
272281

273282
2. **Install**: To ensure using the latest agoric-sdk
274-
version when running code snippets, from a shell, run
283+
version when running code snippets, from a shell, run
284+
275285
```shell
276286
agoric install
277287
```
288+
278289
3. **Build**: To build the site as it will be built for production, run:
290+
279291
```shell
280292
yarn docs:build
281293
```
294+
282295
The resulting build assets can be found in `/dist` in the project root.
283296

284297
4. **Run**: To run a local server and see your changes in real time, run:
298+
285299
```shell
286300
yarn docs:dev
287301
```
302+
288303
Most edit changes are immediately reflected in the browser, but
289304
applying site config changes may require stopping and restarting this program.
290305

291306
View your local documentation site at `localhost:5173`
292307

293308
5. **Preview**: To preview a production build, run:
309+
294310
```shell
295311
yarn docs:preview
296312
```
313+
297314
View your local documentation site at `localhost:4173`
298315

299316
## Updating Zoe Version and DocsUpdated
300317

301318
In `[/.vitepress/config.js](/.vitepress/config.js)`, find the lines
319+
302320
```
303321
zoeVersion: 'Beta Release v1.0.0',
304322
zoeDocsUpdated: 'Apr 7, 2021'
305323
```
324+
306325
Edit the values to be current. The current Zoe version is the "version" field of
307326
[Zoe's package.json](https://github.com/Agoric/agoric-sdk/tree/master/packages/zoe/package.json),
308327
normally on line 3.
@@ -325,18 +344,22 @@ But if you're viewing "Introduction to Zoe" itself, you'll always see the Gettin
325344
no way to have it sometimes (appropriately) display the Zoe sidebar menu instead.
326345

327346
### Configuration and navigation
347+
328348
All configuration is handled in [`/main/.vitepress/config.js`](/.vitepress/config.js). Here you can:
349+
329350
- Set and modify the website title and description.
330351
- Configure the top navigation bar.
331352
- Configure the various sidebar menus
332353

333354
#### Configuring the top menubar
355+
334356
Go to `[main/.vitepress/themeConfig/nav.js](/.vitepress/themeConfig/nav.js)` to configure the top
335357
navigation bar. `/main/.vitepress/config.js`, the overall VitePress configuration file, imports `nav.js`.
336358

337359
Below is an abridged configuration of the top navigation bar showing an array of only two entries,
338360
Getting Started and Learn More.
339361
Each entry is an object with three or four properties:
362+
340363
- `text`: The text shown in the nav bar.
341364
- `ariaLabel`: Labels this page element. Used to access it if the text is not visible.
342365
- `link`: Optional. Link to where the browser goes if you click the top menubar item itself, instead of a
@@ -349,6 +372,7 @@ Each entry is an object with three or four properties:
349372
To add an entry to the top menubar, just add a menu item object to the array. We suggest copying a
350373
similar one, adding the copy, and editing the copy's property values to be those of the new item and
351374
its submenus. To delete an entry, just remove its object from the menubar item array.
375+
352376
```js
353377
module.exports = [
354378
{
@@ -378,11 +402,13 @@ module.exports = [
378402
},
379403
]
380404
```
405+
381406
#### Configuring the top menubar submenus
382407
383408
A top menubar item without a submenu, such as Glossary, has no
384409
`items` property and must have a `link` property (otherwise there's
385410
nothing to click, so it's really not a good navigation menu item).
411+
386412
```js
387413
{
388414
text: 'Glossary',
@@ -400,6 +426,7 @@ link value is `'/getting-started/ertp-introduction/'` and not `'/getting-started
400426
To add a submenu item, just copy an appropriate one, add it to the `items` array, and edit its
401427
property values to be what you want for the new item. To delete a submenu item, just remove its
402428
entry from the `items` array.
429+
403430
```js
404431
{
405432
text: 'ERTP',
@@ -426,11 +453,13 @@ entry from the `items` array.
426453
```
427454

428455
#### Configuring sidebar menus.
456+
429457
Sidebar menus are configured in [`/.vitepress/config.js`](/.vitepress/config.js). There,
430458
sidebars are configured where it starts: `sidebar: {`.
431459

432460
Here's an abridged version of the overall sidebar configuration, only showing the Getting Started
433461
and ERTP sidebars, and leaving out their specific items:
462+
434463
```js
435464
sidebar: {
436465
'/getting-started/': [
@@ -451,7 +480,9 @@ sidebar: {
451480
],
452481
}
453482
```
483+
454484
Below is an abridged version of the ERTP sidebar. Each item entry has five properties:
485+
455486
- `title`: The string that appears in the sidebar menu for this item.
456487
- `path`: Where you go if you click on this menu item. As usual, the leading `/` denotes a path
457488
starting at `main`. Note the full file name is given, including the `.md` suffix (which VitePress
@@ -492,6 +523,7 @@ Below is an abridged version of the ERTP sidebar. Each item entry has five prope
492523
},
493524
],
494525
```
526+
495527
When viewing a page, VitePress has automatically constructed a sidebar menu entry for that page
496528
consisting of all `h1`, `h2`, and `h3` header titles on the page.
497529
@@ -505,21 +537,39 @@ If you need to redirect to an **external** website, this will be accomplished at
505537

506538
Go to (or create if not there) `documentation/main/.vitepress/enhanceApp.js` As of March 2021, ours
507539
looks like this:
540+
508541
```js
509542
export default ({ router }) => {
510543
router.addRoutes([
511544
{ path: '/wallet-api/', redirect: '/guides/wallet/' },
512545
{ path: '/wallet-api.html', redirect: '/guides/wallet/' },
513-
{ path: '/chainlink-integration/', redirect: '/guides/chainlink-integration.md' },
514-
{ path: '/chainlink-integration.html', redirect: '/guides/chainlink-integration.md' },
546+
{
547+
path: '/chainlink-integration/',
548+
redirect: '/guides/chainlink-integration.md'
549+
},
550+
{
551+
path: '/chainlink-integration.html',
552+
redirect: '/guides/chainlink-integration.md'
553+
},
515554
{ path: '/distributed-programming/', redirect: '/guides/js-programming/' },
516-
{ path: '/distributed-programming.html', redirect: '/guides/js-programming/' },
517-
{ path: '/getting-started/agoric-cli-guide/', redirect: '/guides/agoric-cli/' },
518-
{ path: '/getting-started/agoric-cli-guide.html', redirect: '/guides/agoric-cli/' },
555+
{
556+
path: '/distributed-programming.html',
557+
redirect: '/guides/js-programming/'
558+
},
559+
{
560+
path: '/getting-started/agoric-cli-guide/',
561+
redirect: '/guides/agoric-cli/'
562+
},
563+
{
564+
path: '/getting-started/agoric-cli-guide.html',
565+
redirect: '/guides/agoric-cli/'
566+
}
519567
])
520568
}
521569
```
570+
522571
The general format should be self-explanatory. However, there are two things you need to know that aren't apparent
572+
523573
- VitePress treats `main` as the root of the folders. So all of the addresses start with `/` to represent `/main/`.
524574
- You'll notice there are two entries for every redirect, one where the redirected address ends with `.html` and
525575
one where it ends with `/`. For each individual file that is not a `index.md`, there are two ways to access it.

README.md

+11-14
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,17 @@
33
This repository contains the raw documentation files for the [Agoric
44
documentation website](https://agoric.com/documentation/).
55

6-
* [Learn how to mint new tokens of various kinds in our ERTP (Electronic
7-
Rights Transfer
8-
Protocol)](https://agoric.com/documentation/ertp/guide/)
6+
- [Learn how to mint new tokens of various kinds in our ERTP (Electronic
7+
Rights Transfer
8+
Protocol)](https://agoric.com/documentation/ertp/guide/)
99

10+
- Want to write smart contracts where the worst thing that can happen to
11+
your users is they get their money back? [Check out how we enforce
12+
"offer safety" in smart contracts on
13+
Zoe](https://agoric.com/documentation/zoe/guide/)
1014

11-
* Want to write smart contracts where the worst thing that can happen to
12-
your users is they get their money back? [Check out how we enforce
13-
"offer safety" in smart contracts on
14-
Zoe](https://agoric.com/documentation/zoe/guide/)
15+
- Wondering about IBC? [Agoric has been hard at work with Tendermint Inc
16+
and the Interchain Foundation](https://cosmos.network/ibc)
1517

16-
17-
* Wondering about IBC? [Agoric has been hard at work with Tendermint Inc
18-
and the Interchain Foundation](https://cosmos.network/ibc)
19-
20-
21-
* Want to run the full Agoric vm? You can [get started
22-
here](https://agoric.com/documentation/getting-started/#overview)
18+
- Want to run the full Agoric vm? You can [get started
19+
here](https://agoric.com/documentation/getting-started/#overview)

0 commit comments

Comments
 (0)