aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorVirtualTam <virtualtam@flibidi.net>2018-06-17 13:00:03 +0200
committerVirtualTam <virtualtam@flibidi.net>2018-06-17 13:00:03 +0200
commit754ee049fb090ba2f212a3beab6c452aaefeb8fd (patch)
tree96de6fa934bee99ff59a7c756596ee0df6c38f60
parent35927142d7440f6a7c360e53b2beb3a6834835f0 (diff)
downloadShaarli-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--.dockerignore4
-rw-r--r--Dockerfile12
-rw-r--r--Makefile11
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
3tests
4
1# Shaarli runtime resources 5# Shaarli runtime resources
2cache/* 6cache/*
3data/* 7data/*
diff --git a/Dockerfile b/Dockerfile
index 5e03814c..e8067031 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,12 +1,20 @@
1# Stage 1: 1# Stage 1:
2# - Get Shaarli sources 2# - Get Shaarli sources
3# - Build documentation
4FROM dalibo/pandocker:stable as docs
5ADD . /pandoc/shaarli
6RUN 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
4FROM composer:latest as composer 12FROM composer:latest as composer
5ADD . /app/shaarli 13COPY --from=docs /pandoc/shaarli /app/shaarli
6RUN cd shaarli \ 14RUN 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
11FROM debian:jessie 19FROM debian:jessie
12LABEL maintainer="Shaarli Community" 20LABEL maintainer="Shaarli Community"
diff --git a/Makefile b/Makefile
index 60aec9a0..47f3530f 100644
--- a/Makefile
+++ b/Makefile
@@ -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
14SHELL := /bin/bash
14 15
15BIN = vendor/bin 16BIN = vendor/bin
16PHP_SOURCE = index.php application tests plugins 17PHP_SOURCE = index.php application tests plugins
@@ -203,14 +204,18 @@ htmlsidebar:
203htmlpages: 204htmlpages:
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