Skip to content

Commit 734aa7a

Browse files
Add DocumenterVitepress support and update documentation configuration
1 parent 9a3110d commit 734aa7a

File tree

6 files changed

+314
-79
lines changed

6 files changed

+314
-79
lines changed

docs/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[deps]
22
BioMarkovChains = "f861b655-cb5f-42ce-b66a-341b542d4f2c"
33
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
4+
DocumenterVitepress = "4710194d-e776-4893-9690-8d956a29c365"
45
GeneFinder = "2bc6ee46-2158-4f5a-a720-91cb2d7cee64"
56
LiveServer = "16fef848-5104-11e9-1b77-fb7a48bbb589"

docs/make.jl

Lines changed: 52 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,64 @@
11
using GeneFinder
22
using Documenter
3+
using DocumenterVitepress
34

45
DocMeta.setdocmeta!(GeneFinder, :DocTestSetup, :(using GeneFinder); recursive = true)
56

7+
# makedocs(;
8+
# modules = [GeneFinder],
9+
# authors = "Camilo García-Botero",
10+
# repo = "https://github.com/camilogarciabotero/GeneFinder.jl/",
11+
# sitename = "GeneFinder.jl",
12+
# format = Documenter.HTML(;
13+
# mathengine=MathJax3(),
14+
# # prettyurls = get(ENV, "CI", "false") == "true",
15+
# canonical = "https://camilogarciabotero.github.io/GeneFinder.jl",
16+
# repolink = "https://github.com/camilogarciabotero/GeneFinder.jl",
17+
# edit_link = "main",
18+
# ),
19+
# pages = [
20+
# "Home" => "index.md",
21+
# "Finding ORFs" => "naivefinder.md",
22+
# "Scoring ORFs" => "features.md",
23+
# "A Simple Coding Rule" => "simplecodingrule.md",
24+
# "Wrtiting ORFs In Files" => "iodocs.md",
25+
# "API" => "api.md",
26+
# # "Roadmap" => "roadmap.md",
27+
# ],
28+
# warnonly = true,
29+
# )
30+
31+
deploydocs(; repo = "https://github.com/camilogarciabotero/GeneFinder.jl", devbranch = "main")
32+
33+
34+
fmt = DocumenterVitepress.MarkdownVitepress(
35+
repo = "https://github.com/camilogarciabotero/GeneFinder.jl",
36+
devbranch = "main",
37+
)
38+
39+
pgs = [
40+
"Home" => "index.md",
41+
"Finding ORFs" => "naivefinder.md",
42+
"Scoring ORFs" => "features.md",
43+
"A Simple Coding Rule" => "simplecodingrule.md",
44+
"Wrtiting ORFs In Files" => "iodocs.md",
45+
"API" => "api.md",
46+
]
47+
648
makedocs(;
749
modules = [GeneFinder],
850
authors = "Camilo García-Botero",
9-
repo = "https://github.com/camilogarciabotero/GeneFinder.jl/",
51+
repo = Remotes.GitHub("camilogarciabotero", "GeneFinder.jl"),
1052
sitename = "GeneFinder.jl",
11-
format = Documenter.HTML(;
12-
mathengine=MathJax3(),
13-
# prettyurls = get(ENV, "CI", "false") == "true",
14-
canonical = "https://camilogarciabotero.github.io/GeneFinder.jl",
15-
repolink = "https://github.com/camilogarciabotero/GeneFinder.jl",
16-
edit_link = "main",
17-
),
18-
pages = [
19-
"Home" => "index.md",
20-
"Finding ORFs" => "naivefinder.md",
21-
"Scoring ORFs" => "features.md",
22-
"A Simple Coding Rule" => "simplecodingrule.md",
23-
"Wrtiting ORFs In Files" => "iodocs.md",
24-
"API" => "api.md",
25-
# "Roadmap" => "roadmap.md",
26-
],
53+
format = fmt,
54+
pages = pgs,
2755
warnonly = true,
2856
)
2957

30-
deploydocs(; repo = "https://github.com/camilogarciabotero/GeneFinder.jl", devbranch = "main")
58+
deploydocs(;
59+
repo = "https://github.com/camilogarciabotero/GeneFinder.jl",
60+
devbranch = "main",
61+
target = "build", # this is where Vitepress stores its output
62+
branch = "gh-pages",
63+
push_preview = true
64+
)

docs/src/.vitepress/config.mts

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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+
6+
// https://vitepress.dev/reference/site-config
7+
export default defineConfig({
8+
base: 'REPLACE_ME_DOCUMENTER_VITEPRESS',// TODO: replace this in makedocs!
9+
title: 'BioVossEncoder.jl',
10+
description: "A VitePress Site",
11+
lastUpdated: true,
12+
cleanUrls: true,
13+
outDir: 'REPLACE_ME_DOCUMENTER_VITEPRESS', // This is required for MarkdownVitepress to work correctly...
14+
head: [['link', { rel: 'icon', href: 'REPLACE_ME_DOCUMENTER_VITEPRESS_FAVICON' }]],
15+
ignoreDeadLinks: true,
16+
17+
markdown: {
18+
math: true,
19+
config(md) {
20+
md.use(tabsMarkdownPlugin),
21+
md.use(mathjax3),
22+
md.use(footnote)
23+
},
24+
theme: {
25+
light: "github-light",
26+
dark: "github-dark"}
27+
},
28+
themeConfig: {
29+
outline: 'deep',
30+
logo: 'REPLACE_ME_DOCUMENTER_VITEPRESS',
31+
// logo: { src: '/logo.png', width: 24, height: 24 },
32+
search: {
33+
provider: 'local',
34+
options: {
35+
detailedView: true
36+
}
37+
},
38+
nav: 'REPLACE_ME_DOCUMENTER_VITEPRESS',
39+
sidebar: 'REPLACE_ME_DOCUMENTER_VITEPRESS',
40+
editLink: 'REPLACE_ME_DOCUMENTER_VITEPRESS',
41+
socialLinks: [
42+
{ icon: 'github', link: 'REPLACE_ME_DOCUMENTER_VITEPRESS' }
43+
],
44+
footer: {
45+
message: 'Made with <a href="https://luxdl.github.io/DocumenterVitepress.jl/dev/" target="_blank"><strong>DocumenterVitepress.jl</strong></a><br>',
46+
copyright: `© Copyright ${new Date().getUTCFullYear()}.`
47+
}
48+
}
49+
})

docs/src/.vitepress/theme/index.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// .vitepress/theme/index.ts
2+
import { h } from 'vue'
3+
import type { Theme } from 'vitepress'
4+
import DefaultTheme from 'vitepress/theme'
5+
6+
import { enhanceAppWithTabs } from 'vitepress-plugin-tabs/client'
7+
import './style.css'
8+
9+
export default {
10+
extends: DefaultTheme,
11+
Layout() {
12+
return h(DefaultTheme.Layout, null, {
13+
// https://vitepress.dev/guide/extending-default-theme#layout-slots
14+
})
15+
},
16+
enhanceApp({ app, router, siteData }) {
17+
enhanceAppWithTabs(app)
18+
}
19+
} satisfies Theme
Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
@import url(https://fonts.googleapis.com/css?family=Space+Mono:regular,italic,700,700italic);
2+
@import url(https://fonts.googleapis.com/css?family=Space+Grotesk:regular,italic,700,700italic);
3+
4+
/* Customize default theme styling by overriding CSS variables:
5+
https://github.com/vuejs/vitepress/blob/main/src/client/theme-default/styles/vars.css
6+
*/
7+
8+
/* Layouts */
9+
10+
/*
11+
:root {
12+
--vp-layout-max-width: 1440px;
13+
} */
14+
15+
.VPHero .clip {
16+
white-space: pre;
17+
max-width: 500px;
18+
}
19+
20+
/* Fonts */
21+
22+
:root {
23+
/* Typography */
24+
--vp-font-family-base: "Barlow", "Inter var experimental", "Inter var",
25+
-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
26+
Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
27+
28+
/* Code Snippet font */
29+
--vp-font-family-mono: "Fira Code", Menlo, Monaco, Consolas, "Courier New",
30+
monospace;
31+
}
32+
33+
/* Colors */
34+
/* more colors ansi colors = [209, 32, 81, 204, 249, 166, 37] */
35+
/* more colors colors = ["#ff875f", "#0087d7", "#5fd7ff", "#ff5f87", "#b2b2b2", "#d75f00", "#00afaf"] */
36+
:root {
37+
--julia-blue: #5fd7ff ;
38+
--julia-purple: #5fd7ff;
39+
--julia-red: #CB3C33;
40+
--julia-green: #0087d7;
41+
42+
--vp-c-brand: #0087d7;
43+
--vp-c-brand-light: #0087d7;
44+
--vp-c-brand-lighter: #5fd7ff ;
45+
--vp-c-brand-lightest: #5fd7ff ;
46+
--vp-c-brand-dark: #5fd7ff;
47+
--vp-c-brand-darker: #5fd7ff ;
48+
--vp-c-brand-dimm: #212425;
49+
}
50+
51+
/* Component: Button */
52+
53+
:root {
54+
--vp-button-brand-border: var(--vp-c-brand-light);
55+
--vp-button-brand-text: var(--vp-c-white);
56+
--vp-button-brand-bg: var(--vp-c-brand);
57+
--vp-button-brand-hover-border: var(--vp-c-brand-light);
58+
--vp-button-brand-hover-text: var(--vp-c-white);
59+
--vp-button-brand-hover-bg: var(--vp-c-brand-light);
60+
--vp-button-brand-active-border: var(--vp-c-brand-light);
61+
--vp-button-brand-active-text: var(--vp-c-white);
62+
--vp-button-brand-active-bg: var(--vp-button-brand-bg);
63+
}
64+
65+
/* Component: Home */
66+
67+
:root {
68+
--vp-home-hero-name-color: transparent;
69+
--vp-home-hero-name-background: -webkit-linear-gradient(
70+
120deg,
71+
#ff875f 30%,
72+
#ff875f 30%
73+
);
74+
75+
--vp-home-hero-image-background-image: linear-gradient(
76+
-45deg,
77+
#0094ea11 15%,
78+
#0094ea11 15%,
79+
#0094ea11
80+
);
81+
--vp-home-hero-image-filter: blur(10px);
82+
}
83+
84+
@media (min-width: 640px) {
85+
:root {
86+
--vp-home-hero-image-filter: blur(60px);
87+
}
88+
}
89+
90+
@media (min-width: 960px) {
91+
:root {
92+
--vp-home-hero-image-filter: blur(72px);
93+
}
94+
}
95+
96+
/* Component: Custom Block */
97+
98+
:root.dark {
99+
--vp-custom-block-tip-border: var(--vp-c-brand);
100+
--vp-custom-block-tip-text: var(--vp-c-brand-lightest);
101+
--vp-custom-block-tip-bg: var(--vp-c-brand-dimm);
102+
103+
/* // Tweak the color palette for blacks and dark grays */
104+
--vp-c-black: hsl(220 20% 9%);
105+
--vp-c-black-pure: hsl(220, 24%, 4%);
106+
--vp-c-black-soft: hsl(220 16% 13%);
107+
--vp-c-black-mute: hsl(220 14% 17%);
108+
--vp-c-gray: hsl(220 8% 56%);
109+
--vp-c-gray-dark-1: hsl(220 10% 39%);
110+
--vp-c-gray-dark-2: hsl(220 12% 28%);
111+
--vp-c-gray-dark-3: hsl(220 12% 23%);
112+
--vp-c-gray-dark-4: hsl(220 14% 17%);
113+
--vp-c-gray-dark-5: hsl(220 16% 13%);
114+
115+
/* // Backgrounds */
116+
--vp-c-bg: hsl(240, 2%, 11%);
117+
--vp-custom-block-info-bg: hsl(220 14% 17%);
118+
--vp-c-gutter: hsl(220 20% 9%);
119+
120+
--vp-c-bg-alt: hsl(220 20% 9%);
121+
--vp-c-bg-soft: hsl(220 14% 17%);
122+
--vp-c-bg-mute: hsl(220 12% 23%);
123+
124+
}
125+
126+
/* Component: Algolia */
127+
128+
.DocSearch {
129+
--docsearch-primary-color: var(--vp-c-brand) !important;
130+
}
131+
132+
/* Component: MathJax */
133+
134+
/* mjx-container > svg {
135+
display: block;
136+
margin: auto;
137+
}
138+
139+
mjx-container {
140+
padding: 0.5rem 0;
141+
}
142+
143+
mjx-container {
144+
display: inline-block;
145+
margin: auto 2px -2px;
146+
}
147+
148+
mjx-container > svg {
149+
margin: auto;
150+
display: inline-block;
151+
} */
152+
153+
/**
154+
* Colors links
155+
* -------------------------------------------------------------------------- */
156+
157+
:root {
158+
--vp-c-brand-1: #ff875f;
159+
--vp-c-brand-2: #ff875f;
160+
--vp-c-brand-3: #ff875f;
161+
--vp-c-sponsor: #ca2971;
162+
--vitest-c-sponsor-hover: #c13071;
163+
}
164+
165+
.dark {
166+
--vp-c-brand-1: #0087d7;
167+
--vp-c-brand-2: #0087d7;
168+
--vp-c-brand-3: #0087d7;
169+
--vp-c-sponsor: #ee4e95;
170+
--vitest-c-sponsor-hover: #e51370;
171+
}

0 commit comments

Comments
 (0)