Skip to content

Commit e705656

Browse files
Build vitepress documentation (#232)
1 parent 3c92c0b commit e705656

18 files changed

+396
-62
lines changed

.github/workflows/Documentation.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@ jobs:
1616
- uses: actions/checkout@v3
1717
- uses: julia-actions/setup-julia@v2
1818
with:
19-
version: '1.10'
19+
version: "1.10"
2020
- name: Build and deploy
2121
env:
2222
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2323
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
24-
GKSwstype: "100"
25-
run: ./scripts/buildDocs.sh
24+
run: ./scripts/buildVitePressDocs.sh

docs/.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
build/
2+
node_modules/
3+
package-lock.json
4+
Manifest.toml

docs/Project.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
33
DisplayAs = "0b91fe84-8a4c-11e9-3e1d-67c38462b6d6"
44
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
55
DocumenterCitations = "daee34ce-89f3-4625-b898-19384cb65244"
6+
DocumenterVitepress = "4710194d-e776-4893-9690-8d956a29c365"
67
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
78
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
89
UncertaintyQuantification = "7183a548-a887-11e9-15ce-a56ab60bad7a"
910

1011
[compat]
11-
Documenter = "1.4.1"
12+
Documenter = "1.7.0"
1213
DocumenterCitations = "1.3.3"

docs/literate/bayesianupdating/inverse-eigenvalue.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,5 +106,5 @@ samples, evidence = bayesianupdating(likelihood, [λ1, λ2], tmcmc)
106106
scatter(samples.θ1, samples.θ2; lim=[0, 4], label="TMCMC", xlabel="θ1", ylabel="θ2")
107107
#md savefig("stiffness-samples.svg"); nothing # hide
108108

109-
# ![](stiffness-samples.svg)
109+
# ![Resulting TMCMC](stiffness-samples.svg)
110110
# A scatter plot of the resulting samples shows convergence to two distinct regions. Unlike the transitional Markov Chain Monte Carlo algorithm, the standard Metropolis-Hastings algorithm would have only identified one of the two regions.

docs/make.jl

+13-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@ using Documenter
33
using DocumenterCitations
44
using UncertaintyQuantification
55

6+
format = if !isempty(ARGS) && ARGS[1] == "vite"
7+
using DocumenterVitepress
8+
9+
MarkdownVitepress(;
10+
repo="https://github.com/FriesischScott/UncertaintyQuantification.jl",
11+
devbranch="master",
12+
devurl="dev"
13+
)
14+
else
15+
Documenter.HTML(; prettyurls=get(ENV, "CI", nothing) == "true")
16+
end
17+
618
DocMeta.setdocmeta!(
719
UncertaintyQuantification,
820
:DocTestSetup,
@@ -14,7 +26,7 @@ bib = CitationBibliography(joinpath(@__DIR__, "references.bib"))
1426
makedocs(;
1527
modules=[UncertaintyQuantification],
1628
plugins=[bib],
17-
format=Documenter.HTML(; prettyurls=get(ENV, "CI", nothing) == "true"),
29+
format=format,
1830
sitename="UncertaintyQuantification.jl",
1931
authors="Jasper Behrensdorf and Ander Gray",
2032
pages=[

docs/package.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"scripts": {
3+
"docs:dev": "vitepress dev build/.documenter",
4+
"docs:build": "vitepress build build/.documenter",
5+
"docs:preview": "vitepress preview build/.documenter"
6+
},
7+
"dependencies": {
8+
"@shikijs/transformers": "^1.1.7",
9+
"markdown-it": "^14.1.0",
10+
"markdown-it-footnote": "^4.0.0",
11+
"markdown-it-mathjax3": "^4.3.2",
12+
"vitepress": "^1.1.4",
13+
"vitepress-plugin-tabs": "^0.5.0"
14+
}
15+
}

docs/references.bib

-48
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,6 @@ @article{chan2022adaptive
6161
publisher = {Elsevier}
6262
}
6363

64-
@article{chingTransitionalMarkovChain2007,
65-
title = {Transitional {{Markov Chain Monte Carlo Method}} for {{Bayesian Model Updating}}, {{Model Class Selection}}, and {{Model Averaging}}},
66-
author = {Ching, Jianye and Chen, Yi-Chu},
67-
year = {2007},
68-
journal = {Journal of Engineering Mechanics},
69-
volume = {133},
70-
number = {7},
71-
pages = {816--832},
72-
publisher = {American Society of Civil Engineers},
73-
doi = {10.1061/(ASCE)0733-9399(2007)133:7(816)}
74-
}
75-
76-
7764
@article{chingTransitionalMarkovChain2007,
7865
title = {Transitional {{Markov Chain Monte Carlo Method}} for {{Bayesian Model Updating}}, {{Model Class Selection}}, and {{Model Averaging}}},
7966
author = {Ching, Jianye and Chen, Yi-Chu},
@@ -148,19 +135,6 @@ @article{hastingsMonteCarloSampling1970
148135
doi = {10.1093/biomet/57.1.97}
149136
}
150137

151-
@article{hastingsMonteCarloSampling1970,
152-
title = {Monte {{Carlo}} Sampling Methods Using {{Markov}} Chains and Their Applications},
153-
author = {Hastings, W. K.},
154-
year = {1970},
155-
journal = {Biometrika},
156-
volume = {57},
157-
number = {1},
158-
pages = {97--109},
159-
issn = {0006-3444},
160-
doi = {10.1093/biomet/57.1.97}
161-
}
162-
163-
164138
@book{joeDependenceModelingCopulas2015,
165139
title = {Dependence {{Modeling}} with {{Copulas}}},
166140
author = {Joe, Harry},
@@ -223,18 +197,6 @@ @article{metropolisEquationStateCalculations1953
223197
doi = {10.1063/1.1699114}
224198
}
225199

226-
@article{metropolisEquationStateCalculations1953,
227-
title = {Equation of {{State Calculations}} by {{Fast Computing Machines}}},
228-
author = {Metropolis, Nicholas and Rosenbluth, Arianna W. and Rosenbluth, Marshall N. and Teller, Augusta H. and Teller, Edward},
229-
year = {1953},
230-
journal = {The Journal of Chemical Physics},
231-
volume = {21},
232-
number = {6},
233-
pages = {1087--1092},
234-
issn = {0021-9606},
235-
doi = {10.1063/1.1699114}
236-
}
237-
238200
@incollection{nikolaidisTypesUncertaintyDesign2004,
239201
title = {Types of {{Uncertainty}} in {{Design Decision Making}}},
240202
booktitle = {Engineering {{Design Reliability Handbook}}},
@@ -322,16 +284,6 @@ @book{raiffaAppliedStatisticalDecision1961
322284
pagetotal = {356}
323285
}
324286

325-
@book{raiffaAppliedStatisticalDecision1961,
326-
title = {Applied {{Statistical Decision Theory}}},
327-
author = {Raiffa, Howard and Schaifer, Robert},
328-
year = {1961},
329-
series = {Studies in {{Managerial Economics}}},
330-
publisher = {Division of Research, Graduate School of Business Adminitration, Harvard University},
331-
location = {Boston, MA},
332-
pagetotal = {356}
333-
}
334-
335287
@article{sklarFonctionsRepartitionDimensions1959,
336288
title = {Fonctions de repartition a n dimensions et leurs marges},
337289
author = {Sklar, M.},

docs/src/.vitepress/config.mts

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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: 'REPLACE_ME_DOCUMENTER_VITEPRESS',
10+
description: 'REPLACE_ME_DOCUMENTER_VITEPRESS',
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+
search: {
32+
provider: 'local',
33+
options: {
34+
detailedView: true
35+
}
36+
},
37+
nav: 'REPLACE_ME_DOCUMENTER_VITEPRESS',
38+
sidebar: 'REPLACE_ME_DOCUMENTER_VITEPRESS',
39+
editLink: 'REPLACE_ME_DOCUMENTER_VITEPRESS',
40+
socialLinks: [
41+
{ icon: 'github', link: 'REPLACE_ME_DOCUMENTER_VITEPRESS' }
42+
],
43+
footer: {
44+
message: 'Made with <a href="https://luxdl.github.io/DocumenterVitepress.jl/dev/" target="_blank"><strong>DocumenterVitepress.jl</strong></a><br>',
45+
copyright: `© Copyright ${new Date().getUTCFullYear()}.`
46+
}
47+
}
48+
})

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

+19
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

0 commit comments

Comments
 (0)