Skip to content

Commit cac9ea7

Browse files
committed
Add DocumenterVitepress.jl for the docs like Make.jl
1 parent 228f947 commit cac9ea7

9 files changed

Lines changed: 252 additions & 26 deletions

File tree

docs/.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
__site/
2+
.DS_Store
3+
node_modules/
4+
package-lock.json
5+
news.md
6+
src/changelog.md
7+
build/

docs/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
[deps]
22
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
3+
DocumenterVitepress = "4710194d-e776-4893-9690-8d956a29c365"

docs/make.jl

Lines changed: 97 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,97 @@
1-
using Documenter, Comodo
2-
3-
makedocs(
4-
format = Documenter.HTML(
5-
prettyurls = get(ENV, "CI", nothing) == "true",
6-
collapselevel = 2,
7-
size_threshold_warn=1500 * 2^10,
8-
size_threshold=2000 * 2^10,
9-
# assets = ["assets/favicon.ico", "assets/extra_styles.css"],
10-
),
11-
sitename="A Julia package for computational (bio)mechanics and computational design",
12-
authors = "Kevin-Mattheus-Moerman <kevin.moerman@gmail.com>",
13-
pages = [
14-
"Functions" => "functions.md",
15-
]
16-
)
17-
18-
19-
deploydocs(
20-
repo = "https://github.com/COMODO-research/Comodo.jl",
21-
)
1+
# using Documenter, Comodo
2+
3+
# makedocs(
4+
# format = Documenter.HTML(
5+
# prettyurls = get(ENV, "CI", nothing) == "true",
6+
# collapselevel = 2,
7+
# size_threshold_warn=1500 * 2^10,
8+
# size_threshold=2000 * 2^10,
9+
# # assets = ["assets/favicon.ico", "assets/extra_styles.css"],
10+
# ),
11+
# sitename="A Julia package for computational (bio)mechanics and computational design",
12+
# authors = "Kevin-Mattheus-Moerman <kevin.moerman@gmail.com>",
13+
# pages = [
14+
# "Functions" => "functions.md",
15+
# ]
16+
# )
17+
18+
19+
# deploydocs(
20+
# repo = "https://github.com/COMODO-research/Comodo.jl",
21+
# )
22+
23+
24+
# using Comodo
25+
# using Documenter
26+
# using DocumenterVitepress
27+
28+
# DocMeta.setdocmeta!(Comodo, :DocTestSetup, :(using Comodo); recursive=true)
29+
30+
# makedocs(;
31+
# modules=[Comodo],
32+
# authors= "Kevin-Mattheus-Moerman <kevin.moerman@gmail.com>",
33+
# sitename="A Julia package for computational (bio)mechanics and computational design",
34+
# format=DocumenterVitepress.MarkdownVitepress(
35+
# repo = "github.com/Aminofa70/Comodo.jl",
36+
# devbranch="main",
37+
# devurl="dev",
38+
# ),
39+
# pages = [
40+
# "Home" => "index.md",
41+
42+
# "Tutorials" => [
43+
# "Getting started" => "tutorials/getting-started.md",
44+
45+
# "Demos" => [
46+
# "Demo 0001" => "tutorials/demo_0001.md",
47+
# # "Demo 0002" => "tutorials/demo_0002.md",
48+
# ],
49+
# ],
50+
51+
# "API Reference" => "api.md",
52+
# ]
53+
# )
54+
55+
# DocumenterVitepress.deploydocs(;
56+
# repo = "github.com/Aminofa70/Comodo.jl.git",
57+
# target = joinpath(@__DIR__, "build"),
58+
# branch = "gh-pages",
59+
# devbranch = "main",
60+
# push_preview = true,
61+
# )
62+
63+
64+
using Comodo
65+
using Documenter
66+
using DocumenterVitepress
67+
68+
DocMeta.setdocmeta!(Comodo, :DocTestSetup, :(using Comodo); recursive=true)
69+
70+
makedocs(;
71+
modules = Module[],
72+
authors = "Kevin-Mattheus-Moerman <kevin.moerman@gmail.com>",
73+
sitename = "Comodo.jl",
74+
format = DocumenterVitepress.MarkdownVitepress(
75+
repo = "github.com/COMODO-research/Comodo.jl",
76+
devbranch = "main",
77+
devurl = "dev",
78+
),
79+
pages = [
80+
"Home" => "index.md",
81+
"Tutorials" => [
82+
"Getting started" => "tutorials/getting-started.md",
83+
"Demos" => [
84+
"demo_quadplate" => "tutorials/demo_quadplate.md",
85+
],
86+
],
87+
"API Reference" => "api.md",
88+
],
89+
)
90+
91+
DocumenterVitepress.deploydocs(;
92+
repo = "github.com/COMODO-research/Comodo.jl.git",
93+
target = joinpath(@__DIR__, "build"),
94+
branch = "gh-pages",
95+
devbranch = "main",
96+
push_preview = true,
97+
)

docs/package.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"devDependencies": {
3+
"@types/node": "^25.3.5",
4+
"@types/markdown-it-footnote": "^3.0.4"
5+
},
6+
"scripts": {
7+
"docs:dev": "vitepress dev build/.documenter",
8+
"docs:build": "vitepress build build/.documenter",
9+
"docs:preview": "vitepress preview build/.documenter"
10+
},
11+
"dependencies": {
12+
"@nolebase/vitepress-plugin-enhanced-readabilities": "^2.18.2",
13+
"@mdit/plugin-mathjax": "^0.26.1",
14+
"@mdit/plugin-tex": "^0.24.1",
15+
"markdown-it-footnote": "^4.0.0",
16+
"markdown-it": "^14.1.0",
17+
"vitepress": "^1.6.4",
18+
"vitepress-plugin-tabs": "^0.8.0"
19+
}
20+
}

docs/src/api.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# API Reference
2+
3+
```@meta
4+
CurrentModule = Comodo
5+
```
6+
7+
8+
```@autodocs
9+
Modules = [Comodo]
10+
Public = true
11+
Private = false
12+
```

docs/src/functions.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Functions
1+
<!-- # Functions
22
33
## `comododir`
44
```@docs
@@ -894,4 +894,6 @@ Comodo.tri2def
894894
## `polarDecomposition`
895895
```@docs
896896
Comodo.polarDecomposition
897-
```
897+
``` -->
898+
899+

docs/src/index.md

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,44 @@
1-
# Comodo.jl
2-
___________________
1+
```@raw html
2+
---
3+
layout: home
34
4-
- [Functions](https://comodo-research.github.io/Comodo.jl/dev/functions/)
5+
hero:
6+
name: Comodo.jl
7+
text: Mesh with Comodo.jl
8+
tagline: Computational biomechanics and design in Julia
9+
actions:
10+
- theme: brand
11+
text: Getting started
12+
link: /tutorials/getting-started
13+
- theme: alt
14+
text: API Reference
15+
link: /api
16+
- theme: alt
17+
text: View on GitHub
18+
link: https://github.com/COMODO-research/Comodo.jl
19+
---
20+
```
21+
22+
# Welcome to Comodo.jl
23+
24+
Comodo.jl is a Julia package for computational (bio)mechanics and computational design.
25+
26+
## Getting Started
27+
28+
```julia
29+
using Comodo
30+
```
31+
32+
See the tutorial:
33+
34+
[Getting started](tutorials/getting-started.md)
35+
36+
## API Reference
37+
38+
See the API documentation:
39+
40+
[API Reference](api.md)
41+
42+
## GitHub
43+
44+
[View on GitHub](https://github.com/COMODO-research/Comodo.jl)
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Quadrilateral Plate Mesh
2+
3+
This example demonstrates how to generate and visualize a quadrilateral plate mesh using Comodo.jl.
4+
5+
## Load packages
6+
7+
```julia
8+
using Comodo
9+
using Comodo.GLMakie
10+
using Comodo.GeometryBasics
11+
```
12+
13+
## Generate plate mesh
14+
15+
```julia
16+
plateDim = [20.0, 24.0]
17+
plateElem = [11, 16]
18+
orientation = :up
19+
20+
F, V, Eb, Cb = quadplate(plateDim, plateElem; orientation = orientation)
21+
```
22+
23+
## Visualize mesh
24+
25+
```julia
26+
GLMakie.closeall()
27+
28+
cmap = Makie.Categorical(:Spectral)
29+
30+
Ebs, Vbs = separate_vertices(Eb, V)
31+
Cbs_V = simplex2vertexdata(Ebs, Cb)
32+
33+
fig = Figure(size = (1200, 800))
34+
35+
ax1 = AxisGeom( fig[1, 1], title = "Quadrilateral mesh plate", azimuth = -pi/2, elevation = pi/2)
36+
37+
meshplot!(ax1, F, V)
38+
39+
edgeplot!(ax1,Ebs,Vbs;color = Cbs_V,linewidth = 6,colormap = cmap )
40+
41+
Colorbar(fig[1, 2])
42+
43+
fig
44+
```
45+
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
```@raw html
2+
---
3+
layout: doc
4+
title: Getting Started
5+
---
6+
```
7+
8+
# Getting Started
9+
10+
A Julia package for computational (bio)mechanics and computational design
11+
12+
## Installation
13+
14+
```julia
15+
using Pkg
16+
Pkg.add("Comodo")
17+
```
18+
19+
## Basic Usage
20+
21+
```julia
22+
using Comodo
23+
```

0 commit comments

Comments
 (0)