Skip to content

Commit 58e33b9

Browse files
committed
add target for building the documentation locally
1 parent 5b5d5a8 commit 58e33b9

File tree

5 files changed

+65
-1
lines changed

5 files changed

+65
-1
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.pdf

Makefile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,18 @@ clean:
9292
docker ps -a | grep o2r | awk '{print $1}' | xargs docker rm -f
9393
docker images | grep o2r | awk '{print $3}' | xargs docker rmi --force
9494

95-
release:
95+
build_documentation:
96+
rm *.pdf
97+
docker build --tag docbuilder --file etc/Dockerfile.documentations .
98+
docker run -it -v $(CURDIR)/architecture:/doc:rw docbuilder make build pdf
99+
docker run -it -v $(CURDIR)/o2r-web-api:/doc:rw docbuilder make build pdf
100+
docker run -it -v $(CURDIR)/erc-spec:/doc:rw docbuilder make build pdf_tinytex
101+
mv architecture/site/*.pdf .
102+
mv erc-spec/*.pdf .
103+
mv o2r-web-api/*.pdf .
104+
echo "ERC, architecture, and web API documentation created, see files PDF files in the project root directory"
105+
106+
release: build_documentation
96107
git clone --recursive https://github.com/o2r-project/reference-implementation
97108
# TODO build all images, export them to files
98109

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,13 @@ docker volume ls
166166
docker volume inspect reference-implementation_o2r_test_storage
167167
```
168168

169+
## Read documentation
170+
171+
This repository also contains specification and documentation projects.
172+
These documentations are created in Markdown format and can be rendered to HTML and PDF documents using the make target `build_documentation`, which relies on a local `Dockerfile` for the rendering runtime environment.
173+
The PDF files are moved to the project root directory.
174+
The HTML files can be found in the respective projects in the `site` directory.
175+
169176
## Reproducibility
170177

171178
This repository serves the goal to make the developments of the o2r project reproducible, not only by running the reference implementation (see above) but also by creating an archivable package of the software.

etc/Dockerfile.documentations

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#
2+
# A Dockerfile for an environment to build the documentation contained in this repository
3+
#
4+
5+
FROM rocker/verse
6+
7+
# System dependencies
8+
RUN apt-get update && apt-get install -y --no-install-recommends \
9+
python3-pip \
10+
python3-setuptools \
11+
# next one needed by one of the tex packages
12+
xzdec \
13+
# next one needed for untaring wkhtmltox
14+
xz-utils \
15+
libssl1.0-dev
16+
17+
# ERC spec, see erc-spec/.travis.yml
18+
19+
# need newer pandoc
20+
RUN wget https://github.com/jgm/pandoc/releases/download/2.1.1/pandoc-2.1.1-linux.tar.gz \
21+
&& tar -xvzf pandoc*.tar.gz --strip-components 1 -C /usr/local/
22+
23+
RUN tlmgr init-usertree \
24+
&& tlmgr install xcolor mdframed needspace
25+
RUN pip3 install --upgrade pip \
26+
&& pip3 install \
27+
mkdocs \
28+
pymdown-extensions \
29+
mkdocs-pandoc \
30+
pandoc-latex-admonition \
31+
git+https://github.com/o2r-project/mkdocs-combine.git
32+
33+
# architecture, see architecture/.travis.yml
34+
RUN pip3 install mkdocs mkdocs-cinder markdown-include
35+
RUN apt-get update && apt-get install -y --no-install-recommends \
36+
xfonts-base xfonts-75dpi
37+
RUN wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz \
38+
&& tar -xvf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz \
39+
&& mv wkhtmltox/bin/wkhtmltopdf /usr/bin/wkhtmltopdf
40+
41+
VOLUME /doc
42+
WORKDIR /doc
43+
44+
USER 1000

0 commit comments

Comments
 (0)