Skip to content

Commit 1f7ae6f

Browse files
0x009922a-zorina
andauthored
docs: update torii reference to reflect rc.1 (#513)
* fix: extend default theme correctly Signed-off-by: quacumque <[email protected]> * docs: update torii reference according to `rc.1.0` Signed-off-by: quacumque <[email protected]> * ci: bump node version Signed-off-by: quacumque <[email protected]> * ci: update corepack to latest Signed-off-by: quacumque <[email protected]> * docs: fix broken anchor Signed-off-by: quacumque <[email protected]> * Apply suggestions from code review Co-authored-by: Alexandra Zorina <[email protected]> Signed-off-by: 0x009922 <[email protected]> * docs: update iroha rev, revise query section Signed-off-by: qua <[email protected]> * docs: refine queries table Signed-off-by: qua <[email protected]> --------- Signed-off-by: quacumque <[email protected]> Signed-off-by: 0x009922 <[email protected]> Signed-off-by: qua <[email protected]> Co-authored-by: quacumque <[email protected]> Co-authored-by: Alexandra Zorina <[email protected]>
1 parent af2321c commit 1f7ae6f

File tree

6 files changed

+243
-171
lines changed

6 files changed

+243
-171
lines changed

.github/workflows/pull-request-ci.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ jobs:
1010

1111
- uses: actions/setup-node@v3
1212
with:
13-
node-version: 18
13+
node-version: 22
1414

1515
# --- Install with caching
1616
# https://github.com/pnpm/action-setup#use-cache-to-reduce-installation-time
1717

1818
- name: Enable Corepack
19-
run: corepack enable
19+
run: |
20+
npm i -g corepack@latest
21+
corepack enable
2022
2123
- name: Get pnpm store directory
2224
id: pnpm-cache

.vitepress/theme/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import './style/index.scss'
1010
import { defineAsyncComponent } from 'vue'
1111

1212
export default {
13-
...ThemeDefault,
13+
extends: ThemeDefault,
1414
Layout: LayoutCustom,
1515
enhanceApp({ app }: EnhanceAppContext) {
1616
app.component('MermaidRenderWrap', MermaidRenderWrap)
@@ -23,4 +23,4 @@ export default {
2323
defineAsyncComponent(async () => import('./components/CompatibilityMatrixTableIcon.vue')),
2424
)
2525
},
26-
}
26+
} satisfies import('vitepress').Theme

etc/meta.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
/**
2-
* hyperledger-iroha/iroha#iroha2-dev
3-
*/
4-
export const IROHA_REV_DEV = 'e7a605c1a926c319d214ef3825524ee6c2e9f076'
1+
export const IROHA_RC_1 = 'v2.0.0-rc.1.0'
52

63
/**
74
* hyperledger-iroha/iroha-javascript#iroha2 (rc13)

etc/schema/render.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@ import { match, P } from 'ts-pattern'
33
// https://github.com/vuejs/vitepress/blob/b16340acbd3c60fee023daadb0ec5a0292060a1e/src/node/markdown/markdown.ts#L13
44
import { slugify } from '@mdit-vue/shared'
55

6+
function typeSlug(type: string) {
7+
if (type === '()') return `unit`
8+
return slugify(type)
9+
}
10+
611
function segmentHeading(content: string) {
7-
return `## ${code(content)}`
12+
return `## ${code(content)} {#${typeSlug(content)}}`
813
}
914

1015
function segmentPropNameOnly(prop: string) {
@@ -32,7 +37,7 @@ function tyMdLink(ty: string) {
3237
'String',
3338
(x) => `${code(x)}`,
3439
)
35-
.otherwise((ty) => `[${code(ty)}](#${slugify(ty)})`)
40+
.otherwise((ty) => `[${code(ty)}](#${typeSlug(ty)})`)
3641
}
3742

3843
function code(content: string) {
@@ -97,7 +102,14 @@ function renderSegment(segment: Segment, segmentName: string): string {
97102
segmentType('Enum'),
98103
segmentPropNameOnly('Variants'),
99104
table(
100-
[{ title: 'Variant name', align: 'right' }, { title: 'Variant value', align: 'left' }, 'Discriminant'],
105+
[
106+
{ title: 'Variant name', align: 'right' },
107+
{
108+
title: 'Variant value',
109+
align: 'left',
110+
},
111+
'Discriminant',
112+
],
101113
variants.map((x) => [code(x.tag), x.type ? tyMdLink(x.type) : `&mdash;`, String(x.discriminant)]),
102114
{ indent: ' ' },
103115
),

etc/snippet-sources.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { SnippetSourceDefinition } from './types'
2-
import { IROHA_JAVA_REV_DEV, IROHA_JS_REV, IROHA_REV_DEV } from './meta'
2+
import { IROHA_JAVA_REV_DEV, IROHA_JS_REV, IROHA_RC_1 } from './meta'
33
import { render as renderDataModelSchema } from './schema'
44

55
// *****
@@ -102,11 +102,11 @@ const javascriptSnippets = [
102102

103103
export default [
104104
{
105-
src: `https://raw.githubusercontent.com/hyperledger-iroha/iroha/${IROHA_REV_DEV}/MAINTAINERS.md`,
105+
src: `https://raw.githubusercontent.com/hyperledger-iroha/iroha/${IROHA_RC_1}/MAINTAINERS.md`,
106106
filename: 'iroha-maintainers.md',
107107
},
108108
{
109-
src: `https://raw.githubusercontent.com/hyperledger-iroha/iroha/${IROHA_REV_DEV}/docs/source/references/schema.json`,
109+
src: `https://raw.githubusercontent.com/hyperledger-iroha/iroha/${IROHA_RC_1}/docs/source/references/schema.json`,
110110
filename: `data-model-schema.md`,
111111
transform: (source) => {
112112
return renderDataModelSchema(JSON.parse(source))
@@ -116,18 +116,18 @@ export default [
116116
src: './src/example_code/lorem.rs',
117117
},
118118
{
119-
src: `https://raw.githubusercontent.com/hyperledger-iroha/iroha/${IROHA_REV_DEV}/configs/client.template.toml`,
119+
src: `https://raw.githubusercontent.com/hyperledger-iroha/iroha/${IROHA_RC_1}/docs/source/references/client.template.toml`,
120120
filename: 'client-cli-config-template.toml',
121121
},
122122
{
123-
src: `https://raw.githubusercontent.com/hyperledger-iroha/iroha/${IROHA_REV_DEV}/configs/peer.template.toml`,
123+
src: `https://raw.githubusercontent.com/hyperledger-iroha/iroha/${IROHA_RC_1}/docs/source/references/peer.template.toml`,
124124
filename: 'peer-config-template.toml',
125125
},
126126
{
127-
src: `https://raw.githubusercontent.com/hyperledger-iroha/iroha/${IROHA_REV_DEV}/configs/swarm/genesis.json`,
127+
src: `https://raw.githubusercontent.com/hyperledger-iroha/iroha/${IROHA_RC_1}/defaults/genesis.json`,
128128
},
129129
{
130-
src: `https://raw.githubusercontent.com/hyperledger-iroha/iroha/${IROHA_REV_DEV}/client/examples/tutorial.rs`,
130+
src: `https://raw.githubusercontent.com/hyperledger-iroha/iroha/${IROHA_RC_1}/crates/iroha/examples/tutorial.rs`,
131131
filename: 'tutorial-snippets.rs',
132132
},
133133

0 commit comments

Comments
 (0)