Skip to content

Commit 98fd396

Browse files
author
Documenter.jl
committed
build based on e2c752a
1 parent ca589ae commit 98fd396

File tree

170 files changed

+228761
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

170 files changed

+228761
-0
lines changed
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
import { defineConfig } from 'vitepress'
2+
import { tabsMarkdownPlugin } from 'vitepress-plugin-tabs'
3+
import mathjax3 from "markdown-it-mathjax3";
4+
import footnote from "markdown-it-footnote";
5+
import path from 'path'
6+
7+
function getBaseRepository(base: string): string {
8+
if (!base || base === '/') return '/';
9+
const parts = base.split('/').filter(Boolean);
10+
return parts.length > 0 ? `/${parts[0]}/` : '/';
11+
}
12+
13+
const baseTemp = {
14+
base: '/MolecularEvolution.jl/previews/PR57/',// TODO: replace this in makedocs!
15+
}
16+
17+
const navTemp = {
18+
nav: [
19+
{ text: 'Core Concepts', collapsed: false, items: [
20+
{ text: 'Intro', link: '/intro' },
21+
{ text: 'The MolecularEvolution.jl Framework', link: '/framework' },
22+
{ text: 'Models', link: '/models' }]
23+
},
24+
{ text: 'Methods & Algorithms', collapsed: false, items: [
25+
{ text: 'Simulation', link: '/simulation' },
26+
{ text: 'Optimization', link: '/optimization' },
27+
{ text: 'Ancestral Reconstruction', link: '/ancestors' }]
28+
},
29+
{ text: 'Extensions & Utilities', collapsed: false, items: [
30+
{ text: 'Input/Output', link: '/IO' },
31+
{ text: 'Visualization', link: '/generated/viz' },
32+
{ text: 'Updating a phylogenetic tree', link: '/generated/update' }]
33+
},
34+
{ text: 'Examples', link: '/examples' },
35+
{ text: 'Full API', link: '/api' }
36+
]
37+
,
38+
}
39+
40+
const nav = [
41+
...navTemp.nav,
42+
{
43+
component: 'VersionPicker'
44+
}
45+
]
46+
47+
// https://vitepress.dev/reference/site-config
48+
export default defineConfig({
49+
base: '/MolecularEvolution.jl/previews/PR57/',// TODO: replace this in makedocs!
50+
title: 'MolecularEvolution.jl',
51+
description: 'Documentation for MolecularEvolution.jl',
52+
lastUpdated: true,
53+
cleanUrls: true,
54+
outDir: '../1', // This is required for MarkdownVitepress to work correctly...
55+
head: [
56+
['link', { rel: 'icon', href: '/favicon.ico' }],
57+
['script', {src: `${getBaseRepository(baseTemp.base)}versions.js`}],
58+
// ['script', {src: '/versions.js'], for custom domains, I guess if deploy_url is available.
59+
['script', {src: `${baseTemp.base}siteinfo.js`}]
60+
],
61+
62+
vite: {
63+
define: {
64+
__DEPLOY_ABSPATH__: JSON.stringify('/MolecularEvolution.jl'),
65+
},
66+
resolve: {
67+
alias: {
68+
'@': path.resolve(__dirname, '../components')
69+
}
70+
},
71+
optimizeDeps: {
72+
exclude: [
73+
'@nolebase/vitepress-plugin-enhanced-readabilities/client',
74+
'vitepress',
75+
'@nolebase/ui',
76+
],
77+
},
78+
ssr: {
79+
noExternal: [
80+
// If there are other packages that need to be processed by Vite, you can add them here.
81+
'@nolebase/vitepress-plugin-enhanced-readabilities',
82+
'@nolebase/ui',
83+
],
84+
},
85+
},
86+
markdown: {
87+
math: true,
88+
config(md) {
89+
md.use(tabsMarkdownPlugin),
90+
md.use(mathjax3),
91+
md.use(footnote)
92+
},
93+
theme: {
94+
light: "github-light",
95+
dark: "github-dark"}
96+
},
97+
themeConfig: {
98+
outline: 'deep',
99+
logo: { src: '/logo.png', width: 24, height: 24},
100+
search: {
101+
provider: 'local',
102+
options: {
103+
detailedView: true
104+
}
105+
},
106+
nav,
107+
sidebar: [
108+
{ text: 'Core Concepts', collapsed: false, items: [
109+
{ text: 'Intro', link: '/intro' },
110+
{ text: 'The MolecularEvolution.jl Framework', link: '/framework' },
111+
{ text: 'Models', link: '/models' }]
112+
},
113+
{ text: 'Methods & Algorithms', collapsed: false, items: [
114+
{ text: 'Simulation', link: '/simulation' },
115+
{ text: 'Optimization', link: '/optimization' },
116+
{ text: 'Ancestral Reconstruction', link: '/ancestors' }]
117+
},
118+
{ text: 'Extensions & Utilities', collapsed: false, items: [
119+
{ text: 'Input/Output', link: '/IO' },
120+
{ text: 'Visualization', link: '/generated/viz' },
121+
{ text: 'Updating a phylogenetic tree', link: '/generated/update' }]
122+
},
123+
{ text: 'Examples', link: '/examples' },
124+
{ text: 'Full API', link: '/api' }
125+
]
126+
,
127+
editLink: { pattern: "https://https://github.com/MurrellGroup/MolecularEvolution.jl/edit/main/docs/src/:path" },
128+
socialLinks: [
129+
{ icon: 'github', link: 'https://github.com/MurrellGroup/MolecularEvolution.jl' }
130+
],
131+
footer: {
132+
message: 'Made with <a href="https://luxdl.github.io/DocumenterVitepress.jl/dev/" target="_blank"><strong>DocumenterVitepress.jl</strong></a><br>',
133+
copyright: `© Copyright ${new Date().getUTCFullYear()}.`
134+
}
135+
}
136+
})
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
.jldocstring.custom-block {
2+
border: 1px solid var(--vp-c-gray-2);
3+
color: var(--vp-c-text-1);
4+
overflow: hidden;
5+
}
6+
7+
.jldocstring.custom-block summary {
8+
font-weight: 700;
9+
cursor: pointer;
10+
user-select: none;
11+
margin: 0 0 8px;
12+
}
13+
.jldocstring.custom-block summary a {
14+
pointer-events: none;
15+
text-decoration: none;
16+
}
17+
18+
.jldocstring.custom-block .source-link {
19+
border: 1px solid var(--vp-c-gray-2);
20+
border-radius: 4px;
21+
text-decoration: none;
22+
background-color: #414040;
23+
float: right;
24+
opacity: 0;
25+
visibility: hidden;
26+
transform: translateY(-5px);
27+
transition: all 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
28+
}
29+
30+
.jldocstring.custom-block .source-link a {
31+
text-decoration: none;
32+
color: #e5e5e5;
33+
}
34+
35+
.jldocstring.custom-block .source-link a:hover {
36+
text-decoration: underline;
37+
}
38+
39+
.jldocstring.custom-block:hover .source-link {
40+
opacity: 1;
41+
visibility: visible;
42+
transform: translateY(0);
43+
}
44+
45+
@media (max-width: 768px) {
46+
.jldocstring.custom-block .source-link {
47+
opacity: 1;
48+
visibility: visible;
49+
transform: translateY(0);
50+
}
51+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// .vitepress/theme/index.ts
2+
import { h } from 'vue'
3+
import DefaultTheme from 'vitepress/theme'
4+
import type { Theme as ThemeConfig } from 'vitepress'
5+
6+
import {
7+
NolebaseEnhancedReadabilitiesMenu,
8+
NolebaseEnhancedReadabilitiesScreenMenu,
9+
} from '@nolebase/vitepress-plugin-enhanced-readabilities/client'
10+
11+
import VersionPicker from "@/VersionPicker.vue"
12+
import AuthorBadge from '@/AuthorBadge.vue'
13+
import Authors from '@/Authors.vue'
14+
15+
import { enhanceAppWithTabs } from 'vitepress-plugin-tabs/client'
16+
17+
import '@nolebase/vitepress-plugin-enhanced-readabilities/client/style.css'
18+
import './style.css' // You could setup your own, or else a default will be copied.
19+
import './docstrings.css' // You could setup your own, or else a default will be copied.
20+
21+
export const Theme: ThemeConfig = {
22+
extends: DefaultTheme,
23+
Layout() {
24+
return h(DefaultTheme.Layout, null, {
25+
'nav-bar-content-after': () => [
26+
h(NolebaseEnhancedReadabilitiesMenu), // Enhanced Readabilities menu
27+
],
28+
// A enhanced readabilities menu for narrower screens (usually smaller than iPad Mini)
29+
'nav-screen-content-after': () => h(NolebaseEnhancedReadabilitiesScreenMenu),
30+
})
31+
},
32+
enhanceApp({ app, router, siteData }) {
33+
enhanceAppWithTabs(app);
34+
app.component('VersionPicker', VersionPicker);
35+
app.component('AuthorBadge', AuthorBadge)
36+
app.component('Authors', Authors)
37+
}
38+
}
39+
export default Theme

0 commit comments

Comments
 (0)