Skip to content

Commit

Permalink
Update documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanseefeld committed Jun 27, 2018
1 parent 2987d32 commit 22c8251
Show file tree
Hide file tree
Showing 41 changed files with 6,602 additions and 203 deletions.
55 changes: 55 additions & 0 deletions .ci/upload_docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/bin/bash
set -e # Exit with nonzero exit code if anything fails

SOURCE_BRANCH="master"
TARGET_BRANCH="gh-pages"

# Pull requests and commits to other branches shouldn't try to deploy, just build to verify
if [ "$TRAVIS_PULL_REQUEST" != "false" ] || \
[ "$TRAVIS_BRANCH" != master -a \
"$TRAVIS_BRANCH" != develop -a \
"$TRAVIS_BRANCH" != doc -a \
"$TRAVIS_BRANCH" != ci ]; then
echo "No docs to upload."
exit 0
fi

if [ -z "$GH_TOKEN" ]; then
echo "Error: GH_TOKEN is undefined"
exit 1
fi

# Save some useful information
REPO=`git config remote.origin.url`
SHA=`git rev-parse --verify HEAD`

# doc happens to contain the "html" tree that we want to push
# into the gh-pages branch. So we step into that directory, create a new repo,
# set the remote appropriately, then commit and push.
cd doc
git init
git config user.name "Travis CI"
git config user.email "travis-ci"

# Make sure 'GH_TOKEN' is set (as 'secure' variable) in .travis.yml
git remote add upstream "https://$GH_TOKEN@github.com/boostorg/gil.git"
git fetch upstream
git reset upstream/gh-pages

# Prepare version.
if [ "$TRAVIS_BRANCH" = develop -o "$TRAVIS_BRANCH" = doc ]; then
mkdir -p develop/doc/
cp ../index.html develop/
cp ../doc/index.html develop/doc/
cp -a html develop/doc/
git add -A develop
else
cp ../index.html .
cp ../doc/index.html doc/
git add -A .
fi
# Commit the new version.
git commit -m "Deploy to GitHub Pages: ${SHA}"

# Now that we're all set up, we can push.
git push -q upstream HEAD:gh-pages
7 changes: 7 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,10 @@ indent_size = 2
indent_style = space
trim_trailing_whitespace = true
insert_final_newline = true

[*.rst]
indent_size = 4
indent_style = space
max_line_length = 80
trim_trailing_whitespace = true
insert_final_newline = true
39 changes: 34 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ branches:
only:
- master
- develop
- doc
- ci

env:
global:
- secure: "UHit2f6Hq2pkHvx8rfrQvFacYiQKVO3vrCbNuDi/VSAIzQjRnqCqE06y4vpXLMsXf62TvBeCBStIuI8g+HP8B+f39oGb/9Om+yIgN/yes47R4sLFKFbRiOS6sfCIefJp7Kx7GSFf81xWxStpIU4QaSsk8Dlt5xyurTWXFSde+lQ="

matrix:
- BOGUS_JOB=true

Expand Down Expand Up @@ -103,6 +107,13 @@ matrix:
- os: osx
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++11 VARIANT=release

- env: DOC=1
addons:
apt:
packages:
- python-sphinx
- doxygen

install:
- cd ..
- git clone -b master --depth 1 https://github.com/boostorg/boost.git boost-root
Expand All @@ -111,17 +122,35 @@ install:
- git submodule update --init libs/config
- git submodule update --init tools/boostdep
- cp -r $TRAVIS_BUILD_DIR/* libs/gil
- cp -r $TRAVIS_BUILD_DIR/.ci libs/gil
- python tools/boostdep/depinst/depinst.py gil
- ./bootstrap.sh
- ./b2 headers

script:
- |-
echo "using $TOOLSET : : $COMPILER : <cxxflags>-std=$CXXSTD ;" > ~/user-config.jam
- ./b2 libs/gil/test toolset=$TOOLSET variant=$VARIANT
- ./b2 libs/gil/toolbox/test toolset=$TOOLSET variant=$VARIANT
- ./b2 libs/gil/numeric/test toolset=$TOOLSET variant=$VARIANT
- ./b2 libs/gil/io/test//simple toolset=$TOOLSET variant=$VARIANT
if [ "$DOC" ]; then
echo "using doxygen ;" > ~/user-config.jam
./b2 libs/gil/doc
else
echo "using $TOOLSET : : $COMPILER : <cxxflags>-std=$CXXSTD ;" > ~/user-config.jam
./b2 libs/gil/test toolset=$TOOLSET variant=$VARIANT
./b2 libs/gil/toolbox/test toolset=$TOOLSET variant=$VARIANT
./b2 libs/gil/numeric/test toolset=$TOOLSET variant=$VARIANT
./b2 libs/gil/io/test//simple toolset=$TOOLSET variant=$VARIANT
fi
after_success:
# Upload docs only when building upstream.
- |
if [ "$DOC" -a \
"$TRAVIS_REPO_SLUG" = "boostorg/gil" -a \
"$TRAVIS_PULL_REQUEST" = "false" ]; then
export GH_TOKEN
cd libs/gil
.ci/upload_docs.sh
fi
notifications:
email:
Expand Down
64 changes: 64 additions & 0 deletions doc/Jamfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Copyright (c) 2018 Stefan Seefeld
#
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

import doxygen ;
import os ;
import path ;

.doxygen = [ doxygen.name ] ;
.doxygen ?= doxygen ;

#doxygen/gil_standalone/gil_boost.doxygen
make reference : doxyfile
: @make_doxygen
: <location>html
<dependency>$(headers)
;

rule make_doxygen ( targets * : sources * : properties * )
{
LIB_DIR on $(targets) =
[ path.native [ path.parent [ path.root
[ on $(sources[1]) return $(SEARCH) ] [ path.pwd ] ] ] ] ;
}

if [ os.name ] = NT
{
actions make_doxygen
{
SET LIB_DIR=$(LIB_DIR)
chdir "$(>:D)" && "$(.doxygen)" $(>:D=)
}
}
else
{
actions make_doxygen
{
export LIB_DIR=$(LIB_DIR)
cd $(>:D) && "$(.doxygen)" $(>:D=)
}
}

make html
: index.rst
: @sphinx-build
: <location>.
<dependency>reference
;

if [ os.name ] = NT
{
actions sphinx-build { chdir "$(>:D)" && make clean && make html}
}
else
{
actions sphinx-build { make -C "$(>:D)" clean html}
}

###############################################################################
alias boostdoc ;
explicit boostdoc ;
alias boostrelease : html ;
explicit boostrelease ;
133 changes: 133 additions & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# Makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build
HTMLDIR = html

# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .

.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest

all: html

help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"

clean:
-rm -rf $(BUILDDIR)/*

html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(HTMLDIR)
@echo
@echo "Build finished. The HTML pages are in $(HTMLDIR)."

dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."

singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."

pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."

json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."

htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."

qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/BoostNumPy.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/BoostNumPy.qhc"

devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/BoostNumPy"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/BoostNumPy"
@echo "# devhelp"

epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."

latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."

latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
make -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."

text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."

man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."

changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."

linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."

doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."
Binary file added doc/_static/boost-gil.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 22c8251

Please sign in to comment.