Skip to content

Commit de22eee

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

29 files changed

+2230
-29
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 = {
@@ -165,6 +168,15 @@ function getGuideSidebar(): DefaultTheme.SidebarGroup[] {
165168
},
166169
],
167170
},
171+
{
172+
text: 'Documenting Iroha',
173+
items: [
174+
{
175+
text: 'Code snippets',
176+
link: '/documenting/snippets',
177+
},
178+
],
179+
},
168180
]
169181
}
170182

@@ -180,7 +192,7 @@ export default defineConfig({
180192
lang: 'en-US',
181193
vite: {
182194
plugins: [
183-
Windi({ config: path.resolve(__dirname, '../windi.config.ts') }),
195+
Windi({ config: resolve(__dirname, '../windi.config.ts') }),
184196
VitePWA({
185197
// Based on: https://evilmartians.com/chronicles/how-to-favicon-in-2021-six-files-that-fit-most-needs
186198
manifest: {
@@ -201,6 +213,7 @@ export default defineConfig({
201213
strategies: 'injectManifest',
202214
injectRegister: false,
203215
}),
216+
svgLoader()
204217
],
205218
},
206219
lastUpdated: true,
@@ -213,8 +226,14 @@ export default defineConfig({
213226
],
214227

215228
markdown: {
216-
config(md) {
229+
async config(md) {
217230
md.use(footnote)
231+
snippets_plugin(md, {
232+
'snippet_root': resolve(__dirname, '../src/snippets/'),
233+
'highlighter': await getHighlighter({
234+
theme: "github-light"
235+
})
236+
})
218237
},
219238
},
220239

0 commit comments

Comments
 (0)