Skip to content

Commit 2a020f3

Browse files
ManuthorHatemMn
andauthored
feat: migrate mkdocs to mdbook (#130)
* chore: migrate documentation from MkDocs to mdBook - Remove MkDocs config files (mkdocs.yml, includes.yml, theme_overrides/) - Add mdBook build config (book.toml) - Add Cosmian/doc-theme as git submodule (documentation/theme) - Update README rendering sections to mdBook * fix(audit): ignore RUSTSEC-2026-0194 and 0195 (quick-xml, blocked on cosmian_kmip) * docs: add nav.yml for standalone mdBook builds * ci: merge doc wf into build.yml * fix: mdbook build * fix: deny advisories and doc build - deny.toml: ignore RUSTSEC-2026-0173/0194/0195 (no upgrades available) - documentation/book.toml: use src = docs (tracked dir, was pointing to gitignored src/) * fix: documentation build in CI - main_base.yml: add submodules: recursive to build-documentation checkout (theme submodule contains required CSS/JS and scripts) - book.toml: remove unused [preprocessor.tabs] (no docs use tab syntax, and the path was wrong - pointed outside the repo) * fix: mdbook build * fix: reenable TOC and fix Markdown lints * fix: replace Cosmian by Eviden everywhere * fix: fix build and linkcheck issues * fix:fix --------- Co-authored-by: HatemMn <19950216+HatemMn@users.noreply.github.com>
1 parent d75cdb7 commit 2a020f3

23 files changed

Lines changed: 349 additions & 1145 deletions

.cargo/audit.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@
66
ignore = [
77
"RUSTSEC-2023-0071", # rsa
88
"RUSTSEC-2024-0436", # unmaintained paste
9+
"RUSTSEC-2026-0194", # quick-xml: quadratic runtime on duplicate attrs — fixed in >=0.41.0; blocked on cosmian_kmip upgrade
10+
"RUSTSEC-2026-0195", # quick-xml: unbounded NS-decl allocation DoS — fixed in >=0.41.0; blocked on cosmian_kmip upgrade
911
]

.github/workflows/main_base.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,19 @@ jobs:
9898
repo: Cosmian/public_documentation
9999
ref: main
100100
token: ${{ secrets.PAT_TOKEN }}
101+
102+
build-documentation:
103+
name: Build documentation
104+
runs-on: ubuntu-latest
105+
steps:
106+
- uses: actions/checkout@v4
107+
with:
108+
submodules: recursive
109+
110+
- name: Install mdBook toolchain
111+
run: curl -fsSL https://raw.githubusercontent.com/Cosmian/doc-theme/main/scripts/setup-mdbook.sh | sh
112+
113+
- name: Build documentation
114+
run: |
115+
export PATH="$HOME/.cargo/bin:$PATH"
116+
cd documentation && mdbook build

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@
55
[submodule "test_data"]
66
path = test_data
77
url = https://github.com/Cosmian/test_data.git
8+
[submodule "documentation/theme"]
9+
path = documentation/theme
10+
url = git@github.com:Cosmian/doc-theme.git

.markdownlint.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,7 @@ MD007:
1111
MD024:
1212
# Allow heading duplication if under different parent headings
1313
siblings_only: true
14+
15+
# Heading structure requirements (see also kms/.github/.markdownlint.yaml for consistency)
16+
MD041: true # First heading in a file must be a top-level heading (#)
17+
MD025: true # Only one top-level heading (#) per file

.pre-commit-config.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ repos:
3434
rev: v0.44.0
3535
hooks:
3636
- id: markdownlint-fix
37-
args: [--disable=MD013, --disable=MD041, --disable=MD046, --fix]
37+
args: [--disable=MD013, --disable=MD046, --fix]
38+
# MD041 (first heading must be #) and MD025 (only one # per file) are intentionally enabled
39+
# SUMMARY.md uses empty links for mdBook section separators (valid mdBook syntax)
40+
exclude: documentation/docs/SUMMARY\.md
3841

3942
- repo: https://github.com/tcort/markdown-link-check
4043
rev: v3.13.7

0 commit comments

Comments
 (0)