2015-07-19 23:11:05 +00:00
|
|
|
FROM docs/base:latest
|
2015-06-08 00:58:53 +00:00
|
|
|
MAINTAINER Mary Anthony <mary@docker.com> (@moxiegirl)
|
2015-04-01 18:28:34 +00:00
|
|
|
|
2015-08-05 05:55:21 +00:00
|
|
|
ENV PROJECT=registry
|
|
|
|
|
2015-06-08 00:58:53 +00:00
|
|
|
# To get the git info for this repo
|
2015-04-01 18:28:34 +00:00
|
|
|
COPY . /src
|
|
|
|
|
2015-08-05 05:55:21 +00:00
|
|
|
COPY . /docs/content/$PROJECT/
|
|
|
|
|
|
|
|
# Processing GitHub Markdown
|
|
|
|
# 1 Remove <!--[metadata]> and <![end-metadata]-->
|
|
|
|
# 2 Remove any leading combination of dots and slashes (./, ../, ../../, etc)
|
|
|
|
# 3 Prepend /$PROJECT to all links, remove any trailing .md, only for non http:// links and non internal anchors
|
|
|
|
|
|
|
|
RUN find /docs/content/$PROJECT -type f -name "*.md" -not -name "*.compare.md" -exec sed -i.old \
|
|
|
|
-e '/^<!\(--\)\{0,1\}\[\(end-\)\{0,1\}metadata\]\(--\)\{0,1\}>/g' \
|
|
|
|
-e 's/\(\][(]\)\(\.*\/\)*/\1/g' \
|
|
|
|
-e 's/\(\][(]\)\([A-Za-z0-9_/-]\{1,\}\)\(\.md\)\{0,1\}\(#\{0,1\}\(#[A-Za-z0-9_-]*\)\{0,1\}\)[)]/\1\/'$PROJECT'\/\2\4)/g' \
|
|
|
|
{} \;
|
2015-06-08 00:58:53 +00:00
|
|
|
|
2015-08-05 05:55:21 +00:00
|
|
|
# Prepare the compare file and expect an empty diff against test.md
|
|
|
|
RUN sed -i.old -e 's/\/placeholder\//\/'$PROJECT'\//g' /docs/content/$PROJECT/test.compare.md && diff -u /docs/content/$PROJECT/test.md /docs/content/$PROJECT/test.compare.md
|