-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathconfig.mjs
More file actions
686 lines (671 loc) · 22.2 KB
/
Copy pathconfig.mjs
File metadata and controls
686 lines (671 loc) · 22.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
import { nav } from './themeConfig/nav.js';
import { rewrites } from './themeConfig/rewrites.js';
import { withMermaid } from "vitepress-plugin-mermaid";
export default withMermaid({
/* --- FOR DEPLOYMENT TO GITHUB PAGES--- */
base: '/', // The base URL the site will be deployed at.
outDir: '../dist',
/* --- HOME PAGE --- */
title: 'Agoric Documentation', // title for the site. prefix for all page titles and displayed in the navbar
description: 'Build, deploy and operate dApps and DeFi markets.', // desc for the site; rendered as a <meta> tag in the page HTML
// Extra tags to inject into the page HTML <head>. You can specify each tag in the form of [tagName, { attrName: attrValue }, innerHTML?].
head: [
[
'meta',
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
],
['link', { rel: 'icon', href: '/favicon-full.ico' }],
[
'style',
{ type: 'text/css' },
`
.two-col-table td {
width: 50%;
}
.two-col-table table {
table-layout: fixed;
}
a[href^='#'] {
font-style: italic;
}`,
],
[
'script',
{
src: 'https://www.googletagmanager.com/gtag/js?id=UA-118217811-1',
async: '',
},
],
[
'script',
{},
"window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-118217811-1'); ",
],
[
'script',
{},
`
/** @type {Map<[...anySelectors: string[]], (elems: (Element | null)[]) => unknown>} */
const fixups = new Map();
// Update the "home" link to target agoric.com while intercepting clicks
// such that those outside of its image continue routing to the root of
// the documentation site.
fixups.set(['.home-link', '.logo'], ([homeEl, logoEl]) => {
if (homeEl) {
homeEl.setAttribute('href', 'https://agoric.com');
homeEl.setAttribute('onclick', 'return false;');
}
if (logoEl) {
logoEl.setAttribute('onclick', "document.location='https://agoric.com';return false;");
}
});
// Poll until all fixups trigger by matching at least one element.
const fixupInterval = setInterval(function() {
for (const [selectors, fixup] of fixups) {
const elems = selectors.map(sel => document.querySelector(sel));
if (elems.some(el => el)) {
// console.log('fixup', selectors);
fixups.delete(selectors);
Promise.resolve(elems).then(fixup);
}
}
if (!fixups.size) {
clearInterval(fixupInterval);
// console.log('fixups are done');
}
}, 500);
`,
],
],
ignoreDeadLinks: [
// ignore all localhost links
/^https?:\/\/localhost/,
// ignore links that starts with ./packages/*
/^.\/packages\/*/,
'./MAINTAINERS',
'./CONTRIBUTING',
'./LICENSE',
],
sitemap: {
hostname: 'https://docs.agoric.com',
},
plugins: [],
/* --- ROUTE REWRITES / REDIRECTS --- */
rewrites,
/* --- DEFAULT THEME CONFIG --- */
themeConfig: {
sidebarDepth: 1,
lastUpdated: {
text: 'Last Updated',
formatOptions: {
dateStyle: 'medium',
timeStyle: 'long',
timeZone: 'Etc/UTC',
},
},
logo: '/agoric-logo-red.svg',
/* --- NAVBAR (top) --- */
nav,
/* --- SIDEBAR --- */
// This configuration displays different sidebars for different sections of
// content. Pages must be organized into directories for each desired
// section
// NOTES:
// Internal links: Must have a corresponding folder with a index.md file
// Links must be absolute with trailing slash '/guide/'
// Trailing slash implies it is looking for a .md file
sidebar: {
'/': [
{
text: 'Orchestrate',
link: '/guides/orchestration/',
collapsed: true,
items: [
{
text: 'Key Concepts and APIs',
link: '/guides/orchestration/key-concepts',
},
{
text: 'Contract Walkthroughs',
link: '/guides/orchestration/contract-walkthroughs/',
items: [
{
text: 'Send Anywhere Example',
link: '/guides/orchestration/contract-walkthroughs/send-anywhere',
},
{
text: 'Cross-Chain Unbond Example',
link: '/guides/orchestration/contract-walkthroughs/cross-chain-unbond',
}
]
},
{
text: 'Example Orchestration DApp',
link: '/guides/orchestration/orchestration-basics/',
items: [
{
text: 'Installation and Deployment',
link: '/guides/orchestration/orchestration-basics/installation',
},
{
text: 'Orca Contract walkthrough',
link: '/guides/orchestration/orchestration-basics/contract',
},
{
text: 'UI Walkthrough',
link: '/guides/orchestration/orchestration-basics/ui',
}
]
},
{
text: 'How Orchestration Works',
link: '/guides/orchestration/how-orch-works',
},
]
},
{
text: 'Build',
collapsed: true,
items: [
{
text: 'Getting Started',
link: '/guides/getting-started/',
items: [
{
text: 'Takeaway 1: Starting a Local Chain',
link:
'/guides/getting-started/explainer-how-to-start-a-local-chain',
},
{
text: 'Takeaway 2: Deploying a Smart Contract',
link:
'/guides/getting-started/explainer-deploying-a-smart-contact',
},
{
text: 'Takeaway 3: Making an Offer',
link:
'/guides/getting-started/explainer-how-to-make-an-offer',
},
],
},
{
text: 'Smart Contract Basics',
link: '/guides/zoe/contract-basics',
collapsed: true,
items: [
{
text: 'Hello World Smart Contract',
link: '/guides/zoe/contract-hello',
},
{
text: 'State Smart Contract',
link: '/guides/zoe/contract-state',
},
{
text: 'Access Control Smart Contract',
link: '/guides/zoe/contract-access-control',
},
{
text: 'Complete Contract Walk-Through',
link: '/guides/zoe/contract-walkthru',
},
{
text: 'Contract Upgrade',
link: '/guides/zoe/contract-upgrade',
},
{ text: 'Contract Governance', link: '/guides/governance/' },
],
},
{
text: 'UI Component Library',
link: '/guides/UIComponentLibrary/',
},
{
text: 'Building Client Dapps',
link: '/guides/getting-started/contract-rpc',
},
{
text: 'Permissioned Contract Deployment',
ariaLabel: 'Permissioned Contract Deployment',
link: '/guides/coreeval/',
collapsed: true,
items: [
{
text: 'Write Code to Deploy a Contract',
link: '/guides/coreeval/proposal',
},
{
text: 'Declare Required Capabilities',
link: '/guides/coreeval/permissions',
},
{
text: 'Submit Transactions',
link: '/guides/coreeval/local-testnet',
},
],
},
{
text: 'Integrating with Agoric Network',
link: '/guides/integration/chain-integration',
collapsed: true,
items: [
{
text: 'Name Services: agoricNames, namesByAddress, board',
link: '/guides/integration/name-services',
},
{
text: 'SubQuery Indexing',
link: '/guides/subquery-indexing',
},
],
},
{
text: 'Agoric CLI',
link: '/guides/agoric-cli/',
collapsed: true,
items: [
{ text: 'Agoric CLI Reference', link: '/guides/agoric-cli/' },
{
text: 'Using agd to make queries and transactions',
link: '/guides/agoric-cli/agd-query-tx',
},
],
},
{
text: 'Agoric API Reference',
link: 'https://agoric-sdk.pages.dev/'
},
{
text: 'Endo API Reference',
link: 'https://endojs.github.io/endo/'
},
{
text: 'ERTP API',
link: '/reference/ertp-api/',
collapsed: true,
items: [
{ text: 'ERTP API', link: '/reference/ertp-api/' },
{ text: 'Issuer Object', link: '/reference/ertp-api/issuer' },
{ text: 'Mint Object', link: '/reference/ertp-api/mint' },
{ text: 'Brand Object', link: '/reference/ertp-api/brand' },
{ text: 'Purse Object', link: '/reference/ertp-api/purse' },
{
text: 'Payment Object',
link: '/reference/ertp-api/payment',
},
{
text: 'AmountMath Object',
link: '/reference/ertp-api/amount-math',
},
{
text: 'ERTP Data Types',
link: '/reference/ertp-api/ertp-data-types',
},
],
},
{
text: 'Zoe API',
link: '/reference/zoe-api/',
collapsed: true,
items: [
{ text: 'Zoe API', link: '/reference/zoe-api/' },
{ text: 'Zoe Service', link: '/reference/zoe-api/zoe' },
{
text: 'UserSeat Object',
link: '/reference/zoe-api/user-seat',
},
{
text: 'Zoe Contract Facet (ZCF)',
link: '/reference/zoe-api/zoe-contract-facet',
},
{ text: 'ZCFSeat Object', link: '/reference/zoe-api/zcfseat' },
{ text: 'ZCFMint Object', link: '/reference/zoe-api/zcfmint' },
{
text: 'ZoeHelper Functions',
link: '/reference/zoe-api/zoe-helpers',
},
{
text: 'Ratio Math Functions',
link: '/reference/zoe-api/ratio-math',
},
{
text: 'Zoe Data Types',
link: '/reference/zoe-api/zoe-data-types',
},
],
},
{
text: 'Example Zoe Contracts',
ariaLabel: 'Example Zoe Contracts',
link: '/guides/zoe/contracts/',
collapsed: true,
items: [
{
text: 'Example Zoe Contracts',
link: '/guides/zoe/contracts/',
},
{
text: 'Oracle Query Contract',
link: '/guides/zoe/contracts/oracle',
},
{
text: 'Vault Contract',
link: '/guides/zoe/contracts/vault',
},
{ text: 'Loan Contract', link: '/guides/zoe/contracts/loan' },
{
text: 'Funded Call Spread Contract',
link: '/guides/zoe/contracts/fundedCallSpread',
},
{
text: 'Priced Call Spread Contract',
link: '/guides/zoe/contracts/pricedCallSpread',
},
{
text: 'Covered Call Contract',
link: '/guides/zoe/contracts/covered-call',
},
{
text: 'OTC Desk Contract',
link: '/guides/zoe/contracts/otc-desk',
},
{
text: 'ConstantProduct AMM Contract',
link: '/guides/zoe/contracts/constantProductAMM',
},
{
text: 'Sell Items Contract',
link: '/guides/zoe/contracts/sell-items',
},
{
text: 'Atomic Swap Contract',
link: '/guides/zoe/contracts/atomic-swap',
},
{
text: 'Barter Exchange Contract',
link: '/guides/zoe/contracts/barter-exchange',
},
{
text: 'Second-Price Auction Contract',
link: '/guides/zoe/contracts/second-price-auction',
},
{
text: 'Simple Exchange Contract',
link: '/guides/zoe/contracts/simple-exchange',
},
{
text: 'Escrow To Vote Contract',
link: '/guides/zoe/contracts/escrow-to-vote',
},
{
text: 'Mint Payments Contract',
link: '/guides/zoe/contracts/mint-payments',
},
{
text: 'Mint and Sell NFTs Contract',
link: '/guides/zoe/contracts/mint-and-sell-nfts',
},
{
text: 'Use Object Contract',
link: '/guides/zoe/contracts/use-obj-example',
},
{
text: 'Automatic Refund Contract',
link: '/guides/zoe/contracts/automatic-refund',
},
],
},
{
text: 'End-to-End Testing',
ariaLabel: 'End-to-End Testing',
link: '/e2e-testing',
},
],
},
{
text: 'Learn',
collapsed: true,
items: [
{
text: 'What is Agoric?',
link: '/what-is-agoric',
},
{
text: 'Agoric Platform',
link: '/guides/platform/',
collapsed: true,
items: [],
},
{
text: 'Zoe Smart Contract Framework',
link: '/guides/zoe/',
},
{
text: 'ERTP',
ariaLabel: 'ERTP',
link: '/guides/ertp/',
collapsed: true,
items: [
{
text: 'Amounts, Values, and Brands',
link: '/guides/ertp/amounts',
},
{ text: 'AmountMath', link: '/guides/ertp/amount-math' },
{
text: 'Issuers and Mints',
link: '/guides/ertp/issuers-and-mints',
},
{
text: 'Purses and Payments',
link: '/guides/ertp/purses-and-payments',
},
],
},
{
text: 'JavaScript Framework',
ariaLabel: 'JavaScript Framework',
link: '/guides/js-programming/',
},
{
text: 'Deployed Zoe Contracts',
ariaLabel: 'Deployed Zoe Contracts',
link: '/guides/zoe/actual-contracts/',
collapsed: true,
items: [
{
text: 'PSM Contract',
link: '/guides/zoe/actual-contracts/PSM',
},
{
text: 'PriceAuthority Object',
link: '/reference/zoe-api/price-authority',
},
],
},
{
text: 'Glossary',
ariaLabel: 'Glossary Menu',
link: '/glossary/',
},
{
text: 'Papers',
ariaLabel: 'Papers Page Link',
link: 'https://agoric.com/papers/',
},
],
},
{
text: 'Tutorials',
link: '/guides/getting-started/tutorial/',
collapsed: true,
items: [
{
text: 'dapp-agoric-basics',
link: '/guides/getting-started/tutorial-dapp-agoric-basics',
items: [
{
text: 'Takeaway 1: Sell Concert Tickets Contract Overview',
link:
'/guides/getting-started/sell-concert-tickets-contract-explainer',
},
{
text: 'Takeaway 2: Swaparoo Contract Overview',
link:
'/guides/getting-started/swaparoo-how-to-swap-assets-explainer',
},
{
text:
'Takeaway 3: Sending Invitation Payments using an Address',
link:
'/guides/getting-started/swaparoo-making-a-payment-explainer',
},
],
},
{
text: 'UI Tutorial',
link: '/guides/getting-started/ui-tutorial/',
items: [
{
text: '1. Starting',
link: '/guides/getting-started/ui-tutorial/starting',
},
{
text: '2. Agoric Provider',
link: '/guides/getting-started/ui-tutorial/agoric-provider',
},
{
text: '3. Connect Wallet',
link: '/guides/getting-started/ui-tutorial/connect-wallet',
},
{
text: '4. Querying Vstorage',
link: '/guides/getting-started/ui-tutorial/querying-vstorage',
},
{
text: '5. Making an Offer',
link: '/guides/getting-started/ui-tutorial/making-an-offer',
},
{
text: '6. Conclusion',
link: '/guides/getting-started/ui-tutorial/conclusion',
},
],
},
],
},
{
text: 'Support',
collapsed: true,
items: [
{
text: 'Agoric',
ariaLabel: 'Agoric Homepage Link',
link: 'https://agoric.com/',
},
{
text: 'Discord',
link: 'https://agoric.com/discord',
},
{
text: 'Discussions (Q&A)',
link: 'https://github.com/Agoric/agoric-sdk/discussions',
},
{
text: 'Office Hours',
link: 'https://github.com/Agoric/agoric-sdk/wiki/Office-Hours',
},
{
text: 'Twitter',
link: 'https://twitter.com/agoric',
},
{
text: 'YouTube',
ariaLabel: 'Agoric YouTube Channel Page Link',
link: 'https://www.youtube.com/channel/UCpY91oQLh_Lp0mitdZ5bYWg/',
},
{
text: 'Github',
ariaLabel: 'Agoric Github Link',
link: 'https://github.com/Agoric/',
},
],
},
],
},
docsRepo: 'Agoric/documentation',
// if your docs are not at the root of the repo:
docsDir: 'main',
// if your docs are in a specific branch (defaults to 'master'):
docsBranch: 'main',
// custom text for edit link. Defaults to "Edit this page"
editLink: {
pattern: 'https://github.com/Agoric/documentation/edit/main/main/:path',
text: 'Help us improve this page!',
},
zoeVersion: 'v0.24.0',
zoeDocsUpdated: 'August 25, 2022',
// https://vitepress.dev/reference/default-theme-search#local-search
// uses minisearch: https://github.com/lucaong/minisearch/
search: {
provider: 'local',
options: {
miniSearch: {
/**
* @type {Pick<import('minisearch').Options, 'extractField' | 'tokenize' | 'processTerm'>}
*/
options: {
/* ... */
},
/**
* @type {import('minisearch').SearchOptions}
* @default
* { fuzzy: 0.2, prefix: true, boost: { title: 4, text: 2, titles: 1 } }
*/
searchOptions: {
/* ... */
},
/**
* @param {string} src
* @param {import('vitepress').MarkdownEnv} env
* @param {import('markdown-it')} md
*/
// _render(src, env, md) {
// },
},
},
},
footer: {
copyright: `© ${new Date().getFullYear()} Agoric Systems Operating Company. All Rights Reserved.`,
},
socialLinks: [
{
icon: 'discord',
ariaLabel: 'Discord',
link: 'https://agoric.com/discord',
},
{
icon: 'github',
ariaLabel: 'GitHub',
link: 'https://github.com/Agoric/agoric-sdk',
},
{
icon: 'twitter',
ariaLabel: 'Twitter',
link: 'https://twitter.com/agoric',
},
{
icon: 'youtube',
ariaLabel: 'YouTube',
link: 'https://www.youtube.com/@Agoric',
},
],
},
// optionally, you can pass MermaidConfig
mermaid: {
// refer https://mermaid.js.org/config/setup/modules/mermaidAPI.html#mermaidapi-configuration-defaults for options
},
// optionally set additional config for plugin itself with MermaidPluginConfig
mermaidPlugin: {
// class: "mermaid my-class", // set additional css classes for parent container
},
});