Skip to content

Commit b932b09

Browse files
6r1d0x009922
andcommitted
[docs] hyperledger-iroha#89: Add scripts, Vue component, parser extension, update tutorial
Signed-off-by: 6r1d <[email protected]> Co-authored-by: 0x009922 <[email protected]>
1 parent d8374a8 commit b932b09

29 files changed

+2075
-7
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ dist
44
/src/flymd.md
55
/src/flymd.html
66
/src/*.temp
7+
/src/snippets

.vitepress/config.ts

+22-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ import { defineConfig, UserConfig, DefaultTheme } from 'vitepress'
22
import Windi from 'vite-plugin-windicss'
33
import footnote from 'markdown-it-footnote'
44
import customHighlight from './plugins/highlight'
5-
import path from 'path'
5+
import { resolve } from 'path'
66
import { VitePWA } from 'vite-plugin-pwa'
7+
import { snippets_plugin } from './snippet_tabs'
8+
import svgLoader from 'vite-svg-loader'
9+
import { getHighlighter } from "shiki";
710

811
async function themeConfig() {
912
const cfg: UserConfig = {
@@ -157,6 +160,15 @@ function getGuideSidebar(): DefaultTheme.SidebarGroup[] {
157160
},
158161
],
159162
},
163+
{
164+
text: 'Documenting Iroha',
165+
items: [
166+
{
167+
text: 'Code snippets',
168+
link: '/documenting/snippets',
169+
},
170+
],
171+
},
160172
]
161173
}
162174

@@ -172,7 +184,7 @@ export default defineConfig({
172184
lang: 'en-US',
173185
vite: {
174186
plugins: [
175-
Windi({ config: path.resolve(__dirname, '../windi.config.ts') }),
187+
Windi({ config: resolve(__dirname, '../windi.config.ts') }),
176188
VitePWA({
177189
// Based on: https://evilmartians.com/chronicles/how-to-favicon-in-2021-six-files-that-fit-most-needs
178190
manifest: {
@@ -193,6 +205,7 @@ export default defineConfig({
193205
strategies: 'injectManifest',
194206
injectRegister: false,
195207
}),
208+
svgLoader()
196209
],
197210
},
198211
lastUpdated: true,
@@ -205,8 +218,14 @@ export default defineConfig({
205218
],
206219

207220
markdown: {
208-
config(md) {
221+
async config(md) {
209222
md.use(footnote)
223+
snippets_plugin(md, {
224+
'snippet_root': resolve(__dirname, '../src/snippets/'),
225+
'highlighter': await getHighlighter({
226+
theme: "github-light"
227+
})
228+
})
210229
},
211230
},
212231

0 commit comments

Comments
 (0)