set up mkdocs

This commit is contained in:
Julien Fastré 2025-06-30 14:38:30 +02:00
parent 9fcc601730
commit 96a7cbe954
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB
116 changed files with 128 additions and 17 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
build/*
*-manual.pdf
.venv/

3
Dockerfile Normal file
View File

@ -0,0 +1,3 @@
FROM nginx:alpine
LABEL authors="Julien Fastré"

1
admin/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
site/*

43
admin/mkdocs.yml Normal file
View File

@ -0,0 +1,43 @@
---
site_name: "Manuel admnistrateur Chill"
site_url: https://manuel.chill.social/administrateur/
repo_url: https://gitea.champs-libres.be/Chill-project/manuals
repo_name: Chill-project/manuals
theme:
name: material
features:
- content.code.copy
- content.code.select
- content.code.annotate
nav:
- Accueil: index.md
- Génération de document: generation-documents.md
markdown_extensions:
- markdown_include.include
# code layout
- pymdownx.highlight:
anchor_linenums: true
line_spans: __span
pygments_lang_class: true
use_pygments: true
linenums: true
- pymdownx.inlinehilite
- pymdownx.snippets
- pymdownx.superfences
# admonition
- admonition
- pymdownx.details
- pymdownx.superfences
# use emojis
- attr_list
- pymdownx.emoji:
emoji_index: !!python/name:material.extensions.emoji.twemoji
emoji_generator: !!python/name:material.extensions.emoji.to_svg
# footnotes
- footnotes
# https://squidfunk.github.io/mkdocs-material/reference/formatting/?h=key#adding-keyboard-keys
- pymdownx.critic
- pymdownx.caret
- pymdownx.keys
- pymdownx.mark
- pymdownx.tilde

View File

@ -4,7 +4,8 @@ set -e
# enter the current directory
cd "$(dirname $0)"
export PANDOC_DIR="/pandoc/cl"
export PANDOC_DIR="$(pwd)/pandoc/cl"
export OUTPUT_DIR="$(pwd)"
if [ -z $1 ]; then
@ -59,7 +60,9 @@ else
exit 1;
fi
cd $kind
export PDF_TEMPLATE="$(pwd)/eisvogel.latex"
cd $kind/docs
export ARGS="
--from markdown
@ -67,14 +70,12 @@ export ARGS="
--resource-path ./.
--metadata-file ./metadata.yaml
"
export PDF_TEMPLATE="./../eisvogel.latex"
export LATEX_ARGS="
--metadata=footer-left:$(date +%d-%m-%Y)
--template ${PDF_TEMPLATE}
--lua-filter "..${PANDOC_DIR}/boxes.lua"
--lua-filter "${PANDOC_DIR}/boxes.lua"
"
if [ $target = "latex" ]; then
pandoc $ARGS $LATEX_ARGS \
--to latex \
@ -83,18 +84,7 @@ elif [ $target = "pdf" ]; then
pandoc $ARGS $LATEX_ARGS \
--to pdf \
--pdf-engine xelatex \
-o "./../$kind-manual.pdf" \
-o "${OUTPUT_DIR}/$kind-manual.pdf" \
$files
elif [ $target = "html" ]; then
# check target directory exists
if [ ! -d "./../build/html" ]; then
echo "create build/html directory"
mkdir -p "./../build/html"
fi
pandoc $ARGS \
--to html \
-o ./../build/html/index.html \
$files
fi

3
requirements.txt Normal file
View File

@ -0,0 +1,3 @@
mkdocs
markdown-include
mkdocs-material

1
user/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
site/*

Some files were not shown because too many files have changed in this diff Show More