Relates to https://github.com/shaarli/Shaarli/issues/1153
Signed-off-by: VirtualTam <virtualtam@flibidi.net>
+# Docker-ignore
+# Note: .git/ is kept for HTML documentation generation
+tests
+
# Shaarli runtime resources
cache/*
data/*
# Shaarli runtime resources
cache/*
data/*
# Stage 1:
# - Get Shaarli sources
# Stage 1:
# - Get Shaarli sources
+# - Build documentation
+FROM dalibo/pandocker:stable as docs
+ADD . /pandoc/shaarli
+RUN cd /pandoc/shaarli \
+ && make htmldoc \
+ && rm -rf .git
+
+# Stage 2:
# - Resolve PHP dependencies with Composer
FROM composer:latest as composer
# - Resolve PHP dependencies with Composer
FROM composer:latest as composer
+COPY --from=docs /pandoc/shaarli /app/shaarli
RUN cd shaarli \
&& composer --prefer-dist --no-dev install
RUN cd shaarli \
&& composer --prefer-dist --no-dev install
# - Shaarli image
FROM debian:jessie
LABEL maintainer="Shaarli Community"
# - Shaarli image
FROM debian:jessie
LABEL maintainer="Shaarli Community"
# - install Xdebug for PHPUnit code coverage reports:
# - see http://xdebug.org/docs/install
# - enable in php.ini
# - install Xdebug for PHPUnit code coverage reports:
# - see http://xdebug.org/docs/install
# - enable in php.ini
BIN = vendor/bin
PHP_SOURCE = index.php application tests plugins
BIN = vendor/bin
PHP_SOURCE = index.php application tests plugins
htmlpages:
@for file in `find doc/ -maxdepth 1 -name "*.md"`; do \
base=`basename $$file .md`; \
htmlpages:
@for file in `find doc/ -maxdepth 1 -name "*.md"`; do \
base=`basename $$file .md`; \
- sed -i "1i #$${base//-/ }" $$file; \
+ sed -i "1i # $${base//-/ }" $$file; \
awk 'BEGIN { FS = "[\\[\\]]{2}" }'\
'm = /\[/ { t=$$2; gsub(/ /, "-", $$2); print $$1"["t"]("$$2".html)"$$3 }'\
'!m { print $$0 }' $$file > doc/tmp.md; \
mv doc/tmp.md $$file; \
awk 'BEGIN { FS = "[\\[\\]]{2}" }'\
'm = /\[/ { t=$$2; gsub(/ /, "-", $$2); print $$1"["t"]("$$2".html)"$$3 }'\
'!m { print $$0 }' $$file > doc/tmp.md; \
mv doc/tmp.md $$file; \
- pandoc -f markdown_github -t html5 -s \
+ pandoc -f gfm \
+ -t html5 \
+ -s \
-c "github-markdown.css" \
-c "github-markdown.css" \
- -T Shaarli -M pagetitle:"$${base//-/ }" -B doc/sidebar.html \
+ -T Shaarli \
+ -M pagetitle:"$${base//-/ }" \
+ -B doc/sidebar.html \
-o doc/$$base.html $$file; \
done;
-o doc/$$base.html $$file; \
done;