Skip to content

Commit

Permalink
Fix #9: Improve documentation build process.
Browse files Browse the repository at this point in the history
  • Loading branch information
tkem committed Apr 7, 2018
1 parent 74b98e3 commit 76b6b59
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
3 changes: 3 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ AC_PROG_CXX
AC_PROG_MKDIR_P
AC_PROG_INSTALL

AC_CHECK_PROGS([DOXYGEN], [doxygen], [false])
AC_CHECK_PROGS([SPHINXBUILD], [sphinx-build], [false])

AC_CANONICAL_BUILD
AC_CANONICAL_HOST

Expand Down
3 changes: 0 additions & 3 deletions docs/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@

EXTRA_DIST = Doxyfile conf.py index.rst requirements.txt

# TODO: detect programs by autoconf
BUILDDIR = build
DOXYGEN = doxygen
PAPER =
SPHINXBUILD = sphinx-build
SPHINXOPTS =

# Internal variables.
Expand Down
11 changes: 9 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import os

def get_version(filename):
from re import findall
with open(filename) as f:
versions = dict(findall(r'AC_INIT\(\[(.*?)\],\s*\[(.*?)\].*\)', f.read()))
return versions['fsmlite']


# https://github.com/rtfd/readthedocs.org/issues/388
if os.environ.get('READTHEDOCS', None) == 'True':
from subprocess import call
Expand All @@ -8,8 +15,8 @@
# TODO: extract from autoconf?
project = 'fsmlite'
author = 'Thomas Kemmer'
version = '0.2'
release = '0.2.1'
version = get_version(b'../configure.ac')
release = version
copyright = '%s, %s' % ('2015-2018', author)

master_doc = 'index'
Expand Down

0 comments on commit 76b6b59

Please sign in to comment.