-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Documenter.jl
committed
Aug 4, 2024
1 parent
3970496
commit e0bd0c9
Showing
111 changed files
with
29,971 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
import { j as inBrowser, a8 as useUpdateHead, a9 as RouterSymbol, aa as initData, ab as dataSymbol, ac as Content, ad as ClientOnly, ae as siteDataRef, af as createSSRApp, ag as createRouter, ah as pathToFile, Y as __vitePreload, d as defineComponent, u as useData, l as onMounted, z as watchEffect, ai as usePrefetch, aj as useCopyCode, ak as useCodeGroups, a6 as h } from "./chunks/framework.ChVRUVd0.js"; | ||
import { R as RawTheme } from "./chunks/theme.DGQ1Pde0.js"; | ||
function resolveThemeExtends(theme) { | ||
if (theme.extends) { | ||
const base = resolveThemeExtends(theme.extends); | ||
return { | ||
...base, | ||
...theme, | ||
async enhanceApp(ctx) { | ||
if (base.enhanceApp) | ||
await base.enhanceApp(ctx); | ||
if (theme.enhanceApp) | ||
await theme.enhanceApp(ctx); | ||
} | ||
}; | ||
} | ||
return theme; | ||
} | ||
const Theme = resolveThemeExtends(RawTheme); | ||
const VitePressApp = defineComponent({ | ||
name: "VitePressApp", | ||
setup() { | ||
const { site, lang, dir } = useData(); | ||
onMounted(() => { | ||
watchEffect(() => { | ||
document.documentElement.lang = lang.value; | ||
document.documentElement.dir = dir.value; | ||
}); | ||
}); | ||
if (site.value.router.prefetchLinks) { | ||
usePrefetch(); | ||
} | ||
useCopyCode(); | ||
useCodeGroups(); | ||
if (Theme.setup) | ||
Theme.setup(); | ||
return () => h(Theme.Layout); | ||
} | ||
}); | ||
async function createApp() { | ||
const router = newRouter(); | ||
const app = newApp(); | ||
app.provide(RouterSymbol, router); | ||
const data = initData(router.route); | ||
app.provide(dataSymbol, data); | ||
app.component("Content", Content); | ||
app.component("ClientOnly", ClientOnly); | ||
Object.defineProperties(app.config.globalProperties, { | ||
$frontmatter: { | ||
get() { | ||
return data.frontmatter.value; | ||
} | ||
}, | ||
$params: { | ||
get() { | ||
return data.page.value.params; | ||
} | ||
} | ||
}); | ||
if (Theme.enhanceApp) { | ||
await Theme.enhanceApp({ | ||
app, | ||
router, | ||
siteData: siteDataRef | ||
}); | ||
} | ||
return { app, router, data }; | ||
} | ||
function newApp() { | ||
return createSSRApp(VitePressApp); | ||
} | ||
function newRouter() { | ||
let isInitialPageLoad = inBrowser; | ||
let initialPath; | ||
return createRouter((path) => { | ||
let pageFilePath = pathToFile(path); | ||
let pageModule = null; | ||
if (pageFilePath) { | ||
if (isInitialPageLoad) { | ||
initialPath = pageFilePath; | ||
} | ||
if (isInitialPageLoad || initialPath === pageFilePath) { | ||
pageFilePath = pageFilePath.replace(/\.js$/, ".lean.js"); | ||
} | ||
if (false) | ||
; | ||
else { | ||
pageModule = __vitePreload(() => import( | ||
/*@vite-ignore*/ | ||
pageFilePath | ||
), true ? __vite__mapDeps([]) : void 0); | ||
} | ||
} | ||
if (inBrowser) { | ||
isInitialPageLoad = false; | ||
} | ||
return pageModule; | ||
}, Theme.NotFound); | ||
} | ||
if (inBrowser) { | ||
createApp().then(({ app, router, data }) => { | ||
router.go().then(() => { | ||
useUpdateHead(router.route, data.site); | ||
app.mount("#app"); | ||
}); | ||
}); | ||
} | ||
export { | ||
createApp | ||
}; | ||
function __vite__mapDeps(indexes) { | ||
if (!__vite__mapDeps.viteFileDeps) { | ||
__vite__mapDeps.viteFileDeps = [] | ||
} | ||
return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) | ||
} |
4 changes: 4 additions & 0 deletions
4
previews/PR186/assets/chunks/@localSearchIndexroot.DLwzfdfn.js
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.