Commit 42cd1c09de

42cd1c09deb8fd464b671eb63aea31895eb3a39d

parent: aa56656e73

Unsigned

Duck <57977673+woducku@users.noreply.github.com> · 2026-07-17 12:49 UTC

init

Layout: unified · split

docs/.vitepress/plugins/urlSearchPlugin.ts +21
@@ -53,6 +53,7 @@ function extractSearchMetadataFromMarkdown(
53 headings: string[] 53 headings: string[]
54 }[] = [] 54 }[] = []
55 let currentAnchor = '' 55 let currentAnchor = ''
56 let extrepoEntryName: string | null = null
56 57
57 const body = src.startsWith('---') 58 const body = src.startsWith('---')
58 ? src.replace(/^---[\s\S]*?---\n?/, '') 59 ? src.replace(/^---[\s\S]*?---\n?/, '')
@@ -137,6 +138,26 @@ function extractSearchMetadataFromMarkdown(
137 tabPath.length = getTabsDepth() 138 tabPath.length = getTabsDepth()
138 const resetState = tabResetStack.pop() 139 const resetState = tabResetStack.pop()
139 if (resetState) restoreHeadingState(resetState) 140 if (resetState) restoreHeadingState(resetState)
141 } else if (closed === 'extrepo') {
142 extrepoEntryName = null
143 }
144 }
145
146 if (containerStack.includes('extrepo') && !containerStack.includes('tabs')) {
147 const extrepoHeadingMatch = line.match(/^\s*==\s+(.+)$/)
148 if (extrepoHeadingMatch) {
149 extrepoEntryName = extrepoHeadingMatch[1].trim()
150 continue
151 }
152
153 if (extrepoEntryName) {
154 const fieldMatch = line.match(
155 /^\s*-\s*(?:url|raw|src|manga|anime|novel)\s*:\s*(\S+)/
156 )
157 if (fieldMatch) {
158 pushLink(fieldMatch[1].trim(), extrepoEntryName)
159 continue
160 }
140 } 161 }
141 } 162 }
142 163
docs/.vitepress/theme/components/Search.vue +2
@@ -63,6 +63,7 @@ import { LRUCache } from '../composables/search/lru-cache'
63import { createSearchTranslate } from '../composables/search/translation' 63import { createSearchTranslate } from '../composables/search/translation'
64import { useData } from '../composables/search/use-data' 64import { useData } from '../composables/search/use-data'
65import { useEffects } from '../composables/useEffects' 65import { useEffects } from '../composables/useEffects'
66import { registerGlobalComponents } from '../globalComponents'
66import { enhanceAppWithTabs } from './tabs' 67import { enhanceAppWithTabs } from './tabs'
67 68
68export interface FooterTranslations { 69export interface FooterTranslations {
@@ -1298,6 +1299,7 @@ function buildDocExcerpt(docId: string): Promise<void> {
1298 const app = createApp(comp) 1299 const app = createApp(comp)
1299 app.config.warnHandler = () => {} 1300 app.config.warnHandler = () => {}
1300 enhanceAppWithTabs(app, { renderAll: true }) 1301 enhanceAppWithTabs(app, { renderAll: true })
1302 registerGlobalComponents(app)
1301 app.provide(dataSymbol, vitePressData) 1303 app.provide(dataSymbol, vitePressData)
1302 Object.defineProperties(app.config.globalProperties, { 1304 Object.defineProperties(app.config.globalProperties, {
1303 $frontmatter: { 1305 $frontmatter: {
docs/.vitepress/theme/globalComponents.ts added +24
@@ -0,0 +1,24 @@
1import type { App } from 'vue'
2import Authors from './components/Authors.vue'
3import Block from './components/Block.vue'
4import Collapsible from './components/Collapsible.vue'
5import { ExtensionRepos } from './components/extrepo'
6import Fb from './components/Fb.vue'
7import Feedback from './components/Feedback.vue'
8import Highlight from './components/Highlight.vue'
9import LinkInline from './components/LinkInline.vue'
10import ScrapeTable from './components/ScrapeTable.vue'
11import Tooltip from './components/Tooltip.vue'
12
13export function registerGlobalComponents(app: App) {
14 app.component('LinkInline', LinkInline)
15 app.component('hl', Highlight)
16 app.component('Block', Block)
17 app.component('Authors', Authors)
18 app.component('Tooltip', Tooltip)
19 app.component('Feedback', Feedback)
20 app.component('fb', Fb)
21 app.component('Collapsible', Collapsible)
22 app.component('ScrapeTable', ScrapeTable)
23 app.component('ExtensionRepos', ExtensionRepos)
24}
docs/.vitepress/theme/index.ts +2 −20
@@ -13,22 +13,13 @@ import FloatingVue from 'floating-vue'
13import '@nolebase/vitepress-plugin-enhanced-readabilities/client/style.css' 13import '@nolebase/vitepress-plugin-enhanced-readabilities/client/style.css'
14import '@nolebase/vitepress-plugin-page-properties/client/style.css' 14import '@nolebase/vitepress-plugin-page-properties/client/style.css'
15import 'floating-vue/dist/style.css' 15import 'floating-vue/dist/style.css'
16import Authors from './components/Authors.vue'
17import Tooltip from './components/Tooltip.vue'
18import { createMediumZoomProvider } from './composables/medium-zoom' 16import { createMediumZoomProvider } from './composables/medium-zoom'
19import 'virtual:uno.css' 17import 'virtual:uno.css'
20import Collapsible from './components/Collapsible.vue'
21import { ExtensionRepos } from './components/extrepo'
22import Fb from './components/Fb.vue'
23import Feedback from './components/Feedback.vue'
24import ScrapeTable from './components/ScrapeTable.vue'
25import Layout from './Layout.vue' 18import Layout from './Layout.vue'
26import './styles/tooltip-hint.css' 19import './styles/tooltip-hint.css'
27import './styles/steps.css' 20import './styles/steps.css'
28import Block from './components/Block.vue'
29import Highlight from './components/Highlight.vue'
30import LinkInline from './components/LinkInline.vue'
31import { enhanceAppWithTabs } from './components/tabs' 21import { enhanceAppWithTabs } from './components/tabs'
22import { registerGlobalComponents } from './globalComponents'
32 23
33export default { 24export default {
34 extends: DefaultTheme, 25 extends: DefaultTheme,
@@ -50,16 +41,7 @@ export default {
50 } 41 }
51 }) 42 })
52 enhanceAppWithTabs(app) 43 enhanceAppWithTabs(app)
53 app.component('LinkInline', LinkInline) 44 registerGlobalComponents(app)
54 app.component('hl', Highlight)
55 app.component('Block', Block)
56 app.component('Authors', Authors)
57 app.component('Tooltip', Tooltip)
58 app.component('Feedback', Feedback)
59 app.component('fb', Fb)
60 app.component('Collapsible', Collapsible)
61 app.component('ScrapeTable', ScrapeTable)
62 app.component('ExtensionRepos', ExtensionRepos)
63 createMediumZoomProvider(app, router) 45 createMediumZoomProvider(app, router)
64 app.use( 46 app.use(
65 NolebasePagePropertiesPlugin<{ tags: string[]; progress: number }>(), 47 NolebasePagePropertiesPlugin<{ tags: string[]; progress: number }>(),