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(
5353 headings: string[]
5454 }[] = []
5555 let currentAnchor = ''
56 let extrepoEntryName: string | null = null
5657
5758 const body = src.startsWith('---')
5859 ? src.replace(/^---[\s\S]*?---\n?/, '')
@@ -137,6 +138,26 @@ function extractSearchMetadataFromMarkdown(
137138 tabPath.length = getTabsDepth()
138139 const resetState = tabResetStack.pop()
139140 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 }
140161 }
141162 }
142163
docs/.vitepress/theme/components/Search.vue +2
@@ -63,6 +63,7 @@ import { LRUCache } from '../composables/search/lru-cache'
6363import { createSearchTranslate } from '../composables/search/translation'
6464import { useData } from '../composables/search/use-data'
6565import { useEffects } from '../composables/useEffects'
66import { registerGlobalComponents } from '../globalComponents'
6667import { enhanceAppWithTabs } from './tabs'
6768
6869export interface FooterTranslations {
@@ -1298,6 +1299,7 @@ function buildDocExcerpt(docId: string): Promise<void> {
12981299 const app = createApp(comp)
12991300 app.config.warnHandler = () => {}
13001301 enhanceAppWithTabs(app, { renderAll: true })
1302 registerGlobalComponents(app)
13011303 app.provide(dataSymbol, vitePressData)
13021304 Object.defineProperties(app.config.globalProperties, {
13031305 $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'
1313import '@nolebase/vitepress-plugin-enhanced-readabilities/client/style.css'
1414import '@nolebase/vitepress-plugin-page-properties/client/style.css'
1515import 'floating-vue/dist/style.css'
16import Authors from './components/Authors.vue'
17import Tooltip from './components/Tooltip.vue'
1816import { createMediumZoomProvider } from './composables/medium-zoom'
1917import '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'
2518import Layout from './Layout.vue'
2619import './styles/tooltip-hint.css'
2720import './styles/steps.css'
28import Block from './components/Block.vue'
29import Highlight from './components/Highlight.vue'
30import LinkInline from './components/LinkInline.vue'
3121import { enhanceAppWithTabs } from './components/tabs'
22import { registerGlobalComponents } from './globalComponents'
3223
3324export default {
3425 extends: DefaultTheme,
@@ -50,16 +41,7 @@ export default {
5041 }
5142 })
5243 enhanceAppWithTabs(app)
53 app.component('LinkInline', LinkInline)
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)
44 registerGlobalComponents(app)
6345 createMediumZoomProvider(app, router)
6446 app.use(
6547 NolebasePagePropertiesPlugin<{ tags: string[]; progress: number }>(),