diff options
author | VirtualTam <virtualtam@flibidi.net> | 2018-06-17 13:00:03 +0200 |
---|---|---|
committer | VirtualTam <virtualtam@flibidi.net> | 2018-06-17 13:00:03 +0200 |
commit | 754ee049fb090ba2f212a3beab6c452aaefeb8fd (patch) | |
tree | 96de6fa934bee99ff59a7c756596ee0df6c38f60 | |
parent | 35927142d7440f6a7c360e53b2beb3a6834835f0 (diff) | |
download | Shaarli-754ee049fb090ba2f212a3beab6c452aaefeb8fd.tar.gz Shaarli-754ee049fb090ba2f212a3beab6c452aaefeb8fd.tar.zst Shaarli-754ee049fb090ba2f212a3beab6c452aaefeb8fd.zip |
docker: generate the HTML documentation
Relates to https://github.com/shaarli/Shaarli/issues/1153
Signed-off-by: VirtualTam <virtualtam@flibidi.net>
-rw-r--r-- | .dockerignore | 4 | ||||
-rw-r--r-- | Dockerfile | 12 | ||||
-rw-r--r-- | Makefile | 11 |
3 files changed, 22 insertions, 5 deletions
diff --git a/.dockerignore b/.dockerignore index c92a2a14..9a18e085 100644 --- a/.dockerignore +++ b/.dockerignore | |||
@@ -1,3 +1,7 @@ | |||
1 | # Docker-ignore | ||
2 | # Note: .git/ is kept for HTML documentation generation | ||
3 | tests | ||
4 | |||
1 | # Shaarli runtime resources | 5 | # Shaarli runtime resources |
2 | cache/* | 6 | cache/* |
3 | data/* | 7 | data/* |
@@ -1,12 +1,20 @@ | |||
1 | # Stage 1: | 1 | # Stage 1: |
2 | # - Get Shaarli sources | 2 | # - Get Shaarli sources |
3 | # - Build documentation | ||
4 | FROM dalibo/pandocker:stable as docs | ||
5 | ADD . /pandoc/shaarli | ||
6 | RUN cd /pandoc/shaarli \ | ||
7 | && make htmldoc \ | ||
8 | && rm -rf .git | ||
9 | |||
10 | # Stage 2: | ||
3 | # - Resolve PHP dependencies with Composer | 11 | # - Resolve PHP dependencies with Composer |
4 | FROM composer:latest as composer | 12 | FROM composer:latest as composer |
5 | ADD . /app/shaarli | 13 | COPY --from=docs /pandoc/shaarli /app/shaarli |
6 | RUN cd shaarli \ | 14 | RUN cd shaarli \ |
7 | && composer --prefer-dist --no-dev install | 15 | && composer --prefer-dist --no-dev install |
8 | 16 | ||
9 | # Stage 2: | 17 | # Stage 3: |
10 | # - Shaarli image | 18 | # - Shaarli image |
11 | FROM debian:jessie | 19 | FROM debian:jessie |
12 | LABEL maintainer="Shaarli Community" | 20 | LABEL maintainer="Shaarli Community" |
@@ -11,6 +11,7 @@ | |||
11 | # - install Xdebug for PHPUnit code coverage reports: | 11 | # - install Xdebug for PHPUnit code coverage reports: |
12 | # - see http://xdebug.org/docs/install | 12 | # - see http://xdebug.org/docs/install |
13 | # - enable in php.ini | 13 | # - enable in php.ini |
14 | SHELL := /bin/bash | ||
14 | 15 | ||
15 | BIN = vendor/bin | 16 | BIN = vendor/bin |
16 | PHP_SOURCE = index.php application tests plugins | 17 | PHP_SOURCE = index.php application tests plugins |
@@ -203,14 +204,18 @@ htmlsidebar: | |||
203 | htmlpages: | 204 | htmlpages: |
204 | @for file in `find doc/ -maxdepth 1 -name "*.md"`; do \ | 205 | @for file in `find doc/ -maxdepth 1 -name "*.md"`; do \ |
205 | base=`basename $$file .md`; \ | 206 | base=`basename $$file .md`; \ |
206 | sed -i "1i #$${base//-/ }" $$file; \ | 207 | sed -i "1i # $${base//-/ }" $$file; \ |
207 | awk 'BEGIN { FS = "[\\[\\]]{2}" }'\ | 208 | awk 'BEGIN { FS = "[\\[\\]]{2}" }'\ |
208 | 'm = /\[/ { t=$$2; gsub(/ /, "-", $$2); print $$1"["t"]("$$2".html)"$$3 }'\ | 209 | 'm = /\[/ { t=$$2; gsub(/ /, "-", $$2); print $$1"["t"]("$$2".html)"$$3 }'\ |
209 | '!m { print $$0 }' $$file > doc/tmp.md; \ | 210 | '!m { print $$0 }' $$file > doc/tmp.md; \ |
210 | mv doc/tmp.md $$file; \ | 211 | mv doc/tmp.md $$file; \ |
211 | pandoc -f markdown_github -t html5 -s \ | 212 | pandoc -f gfm \ |
213 | -t html5 \ | ||
214 | -s \ | ||
212 | -c "github-markdown.css" \ | 215 | -c "github-markdown.css" \ |
213 | -T Shaarli -M pagetitle:"$${base//-/ }" -B doc/sidebar.html \ | 216 | -T Shaarli \ |
217 | -M pagetitle:"$${base//-/ }" \ | ||
218 | -B doc/sidebar.html \ | ||
214 | -o doc/$$base.html $$file; \ | 219 | -o doc/$$base.html $$file; \ |
215 | done; | 220 | done; |
216 | 221 | ||