From ce921b48b50b8dd074968f578199fc0d51efcda9 Mon Sep 17 00:00:00 2001 From: Martin Beroiz Date: Tue, 30 May 2017 18:58:38 -0500 Subject: [PATCH] better conf.py for docs --- docs/conf.py | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index d84c780..e039467 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -14,12 +14,12 @@ import sys import os -from recommonmark.parser import CommonMarkParser +# from recommonmark.parser import CommonMarkParser # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath('../astroalign')) +sys.path.insert(0, os.path.abspath('..')) # -- General configuration ------------------------------------------------ @@ -40,7 +40,7 @@ templates_path = ['_templates'] source_parsers = { - '.md': CommonMarkParser, +# '.md': CommonMarkParser, } # The suffix(es) of source filenames. @@ -56,17 +56,24 @@ # General information about the project. project = u'astroalign' -copyright = u'2016, Martin Beroiz' +copyright = u'2017, Martin Beroiz' author = u'Martin Beroiz' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # +# Get the version from astroalign file itself (not imported) +with file(os.path.join('..', 'astroalign.py')) as f: + for line in f: + if line.startswith('__version__'): + _, _, __version__ = line.replace("'", '').split() + break + # The short X.Y version. -version = u'1.0a1' +version = __version__ # The full version, including alpha/beta/rc tags. -release = u'1.0a1' +release = __version__ # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -117,6 +124,10 @@ napoleon_google_docstring = True napoleon_numpy_docstring = False +# -- Options for autodoc -------------------------------------------------- + +autodoc_mock_imports = ["scipy", "numpy", "skimage", "sep"] + # -- Options for HTML output ---------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for @@ -150,7 +161,7 @@ # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +# html_static_path = ['_static'] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied