diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-02-25 17:56:55 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-02-25 17:56:55 -0800 |
| commit | 87795b46f2bc732bd11067805709161bdc00d6b6 (patch) | |
| tree | 892f3bcea1a14df5dde8dba413d394f5ccb0a0e0 /docs/publish.sh | |
| parent | 545942f7ace7cde8a1b8a6a5289cecc185b08fbc (diff) | |
| download | nng-87795b46f2bc732bd11067805709161bdc00d6b6.tar.gz nng-87795b46f2bc732bd11067805709161bdc00d6b6.tar.bz2 nng-87795b46f2bc732bd11067805709161bdc00d6b6.zip | |
More man page reorganization.
Man pages need special handling, and we can have other kinds of documentation
like initial starting guides, etc., which would have different processing
applied. So lets move them off into their own directory.
Diffstat (limited to 'docs/publish.sh')
| -rwxr-xr-x | docs/publish.sh | 115 |
1 files changed, 0 insertions, 115 deletions
diff --git a/docs/publish.sh b/docs/publish.sh deleted file mode 100755 index 8ef60b58..00000000 --- a/docs/publish.sh +++ /dev/null @@ -1,115 +0,0 @@ -#!/bin/bash -# -# Copyright 2018 Staysail Systems, Inc. <info@staysail.tech> -# Copyright 2018 Capitar IT Group BV <info@capitar.com> -# This software is supplied under the terms of the MIT License, a -# copy of which should be located in the distribution where this -# file was obtained (LICENSE.txt). A copy of the license may also be -# found online at https://opensource.org/licenses/MIT. -# -# -# This program attempts to publish updated documentation to our gh-pages -# branch. -# -# We read the .version file from ../.version. -# -# The docs are published into the gh-pages branch, in a directory -# called man/v<version>. -# -# This script requires asciidoctor, pygments, git, and a UNIX shell. -# - -tmpdir=$(mktemp -d) -srcdir=$(dirname $0) -dstdir=${tmpdir}/pages -cd ${srcdir} -VERSION=$(cat ../.version) -MANMANUAL="NNG Reference Manual" -MANSOURCE="NNG" -LAYOUT=refman -dstman=${dstdir}/man/v${VERSION} -name=nng - -giturl="${GITURL:-git@github.com:nanomsg/nng}" - -cleanup() { - echo "DELETING ${tmpdir}" - rm -rf ${tmpdir} -} - -mkdir -p ${tmpdir} - -trap cleanup 0 - -echo git clone ${giturl} ${dstdir} || exit 1 -git clone ${giturl} ${dstdir} || exit 1 - -(cd ${dstdir}; git checkout gh-pages) - -[ -d ${dstman} ] || mkdir -p ${dstman} - -dirty= -for input in $(find . -name '*.adoc'); do - adoc=${input#./} - html=${adoc%.adoc}.html - output=${dstman}/${html} - - status=$(git status -s $input ) - when=$(git log -n1 --format='%ad' '--date=format-local:%s' $input ) - cat <<EOF > ${output} ---- -version: ${VERSION} -layout: ${LAYOUT} ---- -EOF - - if [ -n "$when" ] - then - epoch="SOURCE_DATE_EPOCH=${when}" - else - epoch= - dirty=yes - fi - if [ -n "$status" ] - then - echo "File $adoc is not checked in!" - dirty=yes - fi - - - env ${epoch} asciidoctor \ - -dmanpage \ - -amansource="${MANSOURCE}" \ - -amanmanual="${MANMANUAL}" \ - -anofooter=yes \ - -askip-front-matter \ - -atoc=left \ - -asource-highlighter=pygments \ - -aicons=font \ - -bhtml5 \ - -o - ${adoc} >> ${output} - chmod 0644 ${output} - - if [ $? -ne 0 ] - then - echo "Failed to process $adoc !" - fails=yes - fi - - - (cd ${dstman}; git add ${html}) -done - -if [ -n "$dirty" ] -then - echo "Repository has uncommited documentation. Aborting." - exit 1 -fi - -if [ -n "$fails" ] -then - echo "Failures formatting documentation. Aborting." - exit 1 -fi - -(cd ${dstman}; git commit -m "man page updates for ${VERSION}"; git push origin gh-pages) |
