Assume parent dir as project root
Ideally, this will become a configuration param. * Makefile: Build news with ../NEWS * tools/webdoc: Use ../ rather than checking out `master'website
parent
9d6ed8a6b2
commit
00206270eb
2
Makefile
2
Makefile
|
@ -72,7 +72,7 @@ $(outdir)/%.html: %.html $(header) $(footer) tools/page-parse | $(outdir)
|
||||||
|
|
||||||
# requires git-weblog from mikegerwitz's git-supp package
|
# requires git-weblog from mikegerwitz's git-supp package
|
||||||
news:
|
news:
|
||||||
tools/news-fmt < NEWS \
|
tools/news-fmt < ../NEWS \
|
||||||
| cat $(header) $(header_news) - $(footer) \
|
| cat $(header) $(header_news) - $(footer) \
|
||||||
| sed 's/\(<body\)/\1 class="news"/' \
|
| sed 's/\(<body\)/\1 class="news"/' \
|
||||||
> "$(outdir)/news.html"
|
> "$(outdir)/news.html"
|
||||||
|
|
40
tools/webdoc
40
tools/webdoc
|
@ -26,31 +26,6 @@
|
||||||
# manual/easejs.html single-page HTML
|
# manual/easejs.html single-page HTML
|
||||||
##
|
##
|
||||||
|
|
||||||
# ensure that we are within the git repository (otherwise, we cannot generate
|
|
||||||
# content from master)
|
|
||||||
git rev-parse --git-dir >/dev/null 2>/dev/null || {
|
|
||||||
echo "This command may only be run from within the git repository" >&2
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
# we do not want to switch branches if it may risk losing changes
|
|
||||||
[ "$( git status --short | grep -v '??' )" ] && {
|
|
||||||
# auto-stashing can be used during development to test this script without
|
|
||||||
# fighting with git
|
|
||||||
if [ -z "$WEBDOC_AUTOSTASH" ]; then
|
|
||||||
echo "Working tree is dirty; please stash or commit changes" >&2
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
# automatically stash changes
|
|
||||||
echo "Stashing changes before switching branches..." >&2
|
|
||||||
git stash save 'Stashed by webdoc'
|
|
||||||
|
|
||||||
# on exit, pop the stash
|
|
||||||
trap 'git stash pop' EXIT
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
path_dest=webroot/manual
|
path_dest=webroot/manual
|
||||||
path_doc="$(pwd)/doc-cp"
|
path_doc="$(pwd)/doc-cp"
|
||||||
path_img="$path_doc/img"
|
path_img="$path_doc/img"
|
||||||
|
@ -101,13 +76,14 @@ webify()
|
||||||
}
|
}
|
||||||
|
|
||||||
# generate the documentation from the master branch
|
# generate the documentation from the master branch
|
||||||
git checkout "${WEBDOC_BRANCH:-master}" \
|
(
|
||||||
&& autoreconf -fvi \
|
cd .. \
|
||||||
&& ./configure \
|
&& autoreconf -fvi \
|
||||||
&& make html html-single \
|
&& ./configure \
|
||||||
&& cp -rl doc "$path_doc" \
|
&& make html html-single \
|
||||||
&& git checkout - \
|
&& cp -rl doc "$path_doc"
|
||||||
&& pwd \
|
) \
|
||||||
|
&& pwd \
|
||||||
&& ln -sfv "$path_doc/easejs-single.html" "$path_doc_multi/easejs.html" \
|
&& ln -sfv "$path_doc/easejs-single.html" "$path_doc_multi/easejs.html" \
|
||||||
&& for path in $( find "$path_doc_multi" -name '*.htm?' )
|
&& for path in $( find "$path_doc_multi" -name '*.htm?' )
|
||||||
do
|
do
|
||||||
|
|
Loading…
Reference in New Issue