Merge pull request 'Update mdbook generator' (#4) from clement.freville2/codefirst-docdeployer:feature/mdbook into master

Reviewed-on: maxime.batista/codefirst-docdeployer#4
test-script
Maxime BATISTA 2 years ago
commit 7717618df8

@ -1,7 +1,7 @@
FROM debian:bookworm
LABEL author="Maxime Batista"
RUN apt update && apt -y install sshpass rsync doxygen nodejs npm xdot xdotool
RUN apt update && apt -y install sshpass rsync doxygen nodejs npm xdot xdotool wget
WORKDIR /usr/local
RUN npm install docusaurus

@ -17,7 +17,7 @@ This command generates the documentation and deploys it on your CodeDoc space
- `-b --branch [branch]` pattern of branch names to deploy
- `-l --loc [dir]` location of the documentation sources root - **required**
- `-t --type [docusaurus|doxygen|swagger]` type of documentation generator to use. - **required**
- `-t --type [docusaurus|doxygen|mdbook|swagger]` type of documentation generator to use. - **required**
- `-d --dest [dir]` path to where to put the documentation outputs in your repository's CodeDoc space - **optional <u>!! cannot be absolute !!</u>**
Note !
@ -29,6 +29,7 @@ Usage examples :
/entrypoint.sh -l ./documentation/api/api-swagger.yml -t swagger -d api_documentation
/entrypoint.sh -l ./documentation/app -t docusaurus -d application_documentation
/entrypoint.sh -b main -l ./src/Doxyfile -t doxygen -d sourcecode_documentation
/entrypoint.sh -l ./doc -t mdbook -d book
```
### How to add a custom documentation generator ?

@ -9,8 +9,8 @@ help() {
cat <<EOF
usage: $0
-l --loc [dir] location of the documentation sources root - required
-t --type [docusaurus|doxygen|swagger] type of documentation generator to use. - required
-b --branch [branch] pattern of branch names to deploy - optional
-t --type [docusaurus|doxygen|mdbook|swagger] type of documentation generator to use. - required
-d --dest [dir] path to where to put the documentation outputs in your repository's CodeDoc space - optional !! cannot be absolute !!
EOF
exit 1

@ -3,12 +3,10 @@ GEN_PATH="/docs/book"
generate() {
if [ ! -f "$1"/book.toml ]; then
echo "doxygen generator error : file $1/book.toml is missing" >&2
echo "mdbook generator error : file $1/book.toml is missing" >&2
exit 1
fi
(cd "$1" && mdbook build)
mkdir -p $GEN_PATH
mv "$1"/book/* $GEN_PATH
mdbook build "$1" -d $GEN_PATH
}

Loading…
Cancel
Save