Skip to content

Commit 8689fdc

Browse files
Merge pull request #30 from divital-coder/master
Added documenterVitepress support
2 parents 22ac597 + 2b3b9d8 commit 8689fdc

29 files changed

+949
-2244
lines changed

.github/workflows/Documenter.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Documenter
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags: ['*']
8+
pull_request:
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: write
13+
pages: write
14+
id-token: write
15+
statuses: write
16+
17+
concurrency:
18+
group: pages
19+
cancel-in-progress: false
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
28+
- name: Setup Julia
29+
uses: julia-actions/setup-julia@v1
30+
with:
31+
version: '1.10'
32+
33+
- name: Load Julia packages from cache
34+
id: julia-cache
35+
uses: julia-actions/cache@v2
36+
37+
- name: Build and deploy docs
38+
uses: julia-actions/julia-docdeploy@v1
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
42+
GKSwstype: "100"
43+
JULIA_DEBUG: "Documenter"
44+
DATADEPS_ALWAYS_ACCEPT: true
45+
46+
- name: Save Julia depot cache on cancel or failure
47+
id: julia-cache-save
48+
if: cancelled() || failure()
49+
uses: actions/cache/save@v4
50+
with:
51+
path: |
52+
${{ steps.julia-cache.outputs.cache-paths }}
53+
key: ${{ steps.julia-cache.outputs.cache-key }}

.github/workflows/TagBot.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: TagBot
2+
on:
3+
issue_comment:
4+
types:
5+
- created
6+
workflow_dispatch:
7+
inputs:
8+
lookback:
9+
default: 3
10+
permissions:
11+
actions: read
12+
checks: read
13+
contents: write
14+
deployments: read
15+
issues: read
16+
discussions: read
17+
packages: read
18+
pages: read
19+
pull-requests: read
20+
repository-projects: read
21+
security-events: read
22+
statuses: read
23+
jobs:
24+
TagBot:
25+
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: JuliaRegistries/TagBot@v1
29+
with:
30+
token: ${{ secrets.GITHUB_TOKEN }}
31+
ssh: ${{ secrets.DOCUMENTER_KEY }}

.github/workflows/documentation.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.

.github/workflows/label.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

Project.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
3131
ColorTypes = ">=0.11.4"
3232
DataTypesBasic = ">=2.0.3"
3333
Dictionaries = ">=0.3.25"
34-
Documenter = "1"
35-
DocumenterVitepress = "0.0.19, 0.0.20"
3634
FreeType = ">=4.1.0"
3735
FreeTypeAbstraction = ">=0.10.0"
3836
GLFW = ">=3.4.1"

docs/.gitignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

docs/Project.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
[deps]
22
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
33
DocumenterVitepress = "4710194d-e776-4893-9690-8d956a29c365"
4-
Rocket = "df971d30-c9d6-4b37-b8ff-e965b2cb3a40"

docs/make.jl

Lines changed: 25 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,32 @@
1-
using Pkg
2-
Pkg.add([
3-
"Documenter",
4-
"DocumenterVitepress",
5-
"Rocket"
6-
])
7-
using MedEye3d
8-
using Rocket
9-
using Documenter
10-
using DocumenterVitepress
1+
using Documenter, DocumenterVitepress
112

12-
13-
DocMeta.setdocmeta!(MedEye3d, :DocTestSetup, :(using MedEye3d); recursive=true)
14-
15-
makedocs(;
16-
modules=[MedEye3d, MedEye3d.SegmentationDisplay, MedEye3d.ReactingToInput, MedEye3d.ReactOnKeyboard, MedEye3d.ReactOnMouseClickAndDrag, MedEye3d.ReactToScroll, MedEye3d.PrepareWindow, MedEye3d.TextureManag, MedEye3d.DisplayWords, MedEye3d.Uniforms, MedEye3d.ShadersAndVerticiesForText, MedEye3d.ShadersAndVerticies, MedEye3d.OpenGLDisplayUtils, MedEye3d.CustomFragShad, MedEye3d.PrepareWindowHelpers, MedEye3d.StructsManag, MedEye3d.ForDisplayStructs, MedEye3d.DataStructs, MedEye3d.BasicStructs, MedEye3d.ModernGlUtil
17-
# ,MedEye3d.MaskDiffrence
18-
, MedEye3d.KeyboardVisibility, MedEye3d.OtherKeyboardActions, MedEye3d.KeyboardMouseHelper, MedEye3d.WindowControll, MedEye3d.ChangePlane],
19-
repo=Remotes.GitHub("JuliaHealth", "MedEye3d.jl"),
20-
authors="Jakub-Mitura <jakubmitura14@gmail.com>, Divyansh-Goyal <divital2004@gmail.com> and contributors",
21-
sitename="MedEye3d.jl",
3+
makedocs(;
4+
sitename = "MedEye3d.jl",
5+
authors = "Jakub Mitura <jakub.mitura14@gmail>, Beata E. Chrapko and Divyansh Goyal <divital2004@gmail.com>",
226
format=DocumenterVitepress.MarkdownVitepress(
23-
repo="https://github.com/JuliaHealth/MedEye3d.jl",
7+
repo = "github.com/JuliaHealth/MedEye3d.jl",
8+
devbranch = "master",
9+
devurl = "dev",
2410
),
11+
warnonly = true,
12+
draft = false,
13+
source = "src",
14+
build = "build",
2515
pages=[
26-
"Home" => "index.md",
27-
"Tutorials" => "tutorials.md",
28-
"Contributing" => "contributing.md"
29-
],
16+
"Manual" => [
17+
"Get Started" => "manual/get_started.md",
18+
"Code" => "manual/code_example.md"
19+
],
20+
"Developers' documentation" => [
21+
"Visualization Playbook" => "devs/playbook.md"
22+
],
23+
"api" => "api.md"
24+
],
3025
)
3126

32-
deploydocs(;
33-
repo="github.com/JuliaHealth/MedEye3d.jl",
34-
target="build", # this is where Vitepress stores its output
35-
devbranch="master",
36-
branch="gh-pages",
37-
push_preview=true
27+
# This is the critical part that creates the version structure
28+
DocumenterVitepress.deploydocs(;
29+
repo = "github.com/JuliaHealth/MedImages.jl",
30+
devbranch = "master",
31+
push_preview = true,
3832
)

docs/package.json

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
{
2-
"devDependencies": {
3-
"markdown-it": "^14.1.0",
4-
"markdown-it-mathjax3": "^4.3.2",
5-
"vitepress": "^1.0.2",
6-
"vitepress-plugin-tabs": "^0.5.0"
7-
},
82
"scripts": {
93
"docs:dev": "vitepress dev build/.documenter",
104
"docs:build": "vitepress build build/.documenter",
115
"docs:preview": "vitepress preview build/.documenter"
126
},
137
"dependencies": {
14-
"@shikijs/transformers": "^1.1.7",
15-
"markdown-it-footnote": "^4.0.0"
8+
"@nolebase/vitepress-plugin-enhanced-readabilities": "^2.14.0",
9+
"markdown-it": "^14.1.0",
10+
"markdown-it-footnote": "^4.0.0",
11+
"markdown-it-mathjax3": "^4.3.2",
12+
"vitepress": "^1.6.3",
13+
"vitepress-plugin-tabs": "^0.6.0"
1614
}
1715
}

docs/src/.vitepress/config.mts

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
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: 'REPLACE_ME_DOCUMENTER_VITEPRESS',// TODO: replace this in makedocs!
15+
}
16+
17+
const navTemp = {
18+
nav: 'REPLACE_ME_DOCUMENTER_VITEPRESS',
19+
}
20+
21+
const nav = [
22+
...navTemp.nav,
23+
{
24+
component: 'VersionPicker'
25+
}
26+
]
27+
28+
// https://vitepress.dev/reference/site-config
29+
export default defineConfig({
30+
base: 'REPLACE_ME_DOCUMENTER_VITEPRESS',// TODO: replace this in makedocs!
31+
title: 'REPLACE_ME_DOCUMENTER_VITEPRESS',
32+
description: 'REPLACE_ME_DOCUMENTER_VITEPRESS',
33+
lastUpdated: true,
34+
cleanUrls: true,
35+
outDir: 'REPLACE_ME_DOCUMENTER_VITEPRESS', // This is required for MarkdownVitepress to work correctly...
36+
head: [
37+
['link', { rel: 'icon', href: 'REPLACE_ME_DOCUMENTER_VITEPRESS_FAVICON' }],
38+
['script', {src: `${getBaseRepository(baseTemp.base)}versions.js`}],
39+
// ['script', {src: '/versions.js'], for custom domains, I guess if deploy_url is available.
40+
['script', {src: `${baseTemp.base}siteinfo.js`}]
41+
],
42+
43+
vite: {
44+
define: {
45+
__DEPLOY_ABSPATH__: JSON.stringify('REPLACE_ME_DOCUMENTER_VITEPRESS_DEPLOY_ABSPATH'),
46+
},
47+
resolve: {
48+
alias: {
49+
'@': path.resolve(__dirname, '../components')
50+
}
51+
},
52+
optimizeDeps: {
53+
exclude: [
54+
'@nolebase/vitepress-plugin-enhanced-readabilities/client',
55+
'vitepress',
56+
'@nolebase/ui',
57+
],
58+
},
59+
ssr: {
60+
noExternal: [
61+
// If there are other packages that need to be processed by Vite, you can add them here.
62+
'@nolebase/vitepress-plugin-enhanced-readabilities',
63+
'@nolebase/ui',
64+
],
65+
},
66+
},
67+
markdown: {
68+
math: true,
69+
config(md) {
70+
md.use(tabsMarkdownPlugin),
71+
md.use(mathjax3),
72+
md.use(footnote)
73+
},
74+
theme: {
75+
light: "github-light",
76+
dark: "github-dark"}
77+
},
78+
themeConfig: {
79+
outline: 'deep',
80+
logo: 'REPLACE_ME_DOCUMENTER_VITEPRESS',
81+
search: {
82+
provider: 'local',
83+
options: {
84+
detailedView: true
85+
}
86+
},
87+
nav,
88+
sidebar: 'REPLACE_ME_DOCUMENTER_VITEPRESS',
89+
editLink: 'REPLACE_ME_DOCUMENTER_VITEPRESS',
90+
socialLinks: [
91+
{ icon: 'github', link: 'REPLACE_ME_DOCUMENTER_VITEPRESS' }
92+
],
93+
footer: {
94+
message: 'Made with <a href="https://luxdl.github.io/DocumenterVitepress.jl/dev/" target="_blank"><strong>DocumenterVitepress.jl</strong></a><br>',
95+
copyright: `© Copyright ${new Date().getUTCFullYear()}.`
96+
}
97+
}
98+
})

0 commit comments

Comments
 (0)