Skip to content

Commit

Permalink
DOC: Switch to nbshpinx
Browse files Browse the repository at this point in the history
Simplify setup by using nbsphinx to handle notebooks
  • Loading branch information
bashtage committed Aug 14, 2018
1 parent 837f887 commit cc5c46c
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 10 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Expand Up @@ -7,4 +7,7 @@ build/
dist
.benchmarks/
.cache/
README.rst
README.rst
doc/**/*.ipynb
.pytest_cache
__pycache__
9 changes: 7 additions & 2 deletions .travis.yml
Expand Up @@ -80,8 +80,13 @@ before_install:
- source activate arch-test
- pip install flake8 nbconvert nbformat pytest coverage coveralls pytest-cov codecov pytest-xdist
- if [[ ${STATSMODELS_MASTER} = true ]]; then sh ./ci/statsmodels-master.sh; fi;
- if [[ ${DOCBUILD} = true ]]; then conda install sphinx ipython doctr numpydoc -c conda-forge; fi;
- if [[ ${DOCBUILD} = true ]]; then pip install guzzle_sphinx_theme; fi;
- |
if [[ ${DOCBUILD} = true ]]; then
conda install sphinx ipython numpydoc jupyter seaborn -c conda-forge
pip install doctr nbsphinx guzzle_sphinx_theme -q
sudo apt-get install -y enchant
pip install sphinxcontrib-spelling
fi
- export SRCDIR=${PWD}
- conda list
- export PYTHONHASHSEED=0
Expand Down
Empty file added doc/source/_static/.gitignore
Empty file.
2 changes: 1 addition & 1 deletion doc/source/bootstrap/bootstrap.rst
Expand Up @@ -13,7 +13,7 @@ parameters and the (internally generated) sampling scheme.
.. toctree::
:maxdepth: 1

Examples <bootstrap_examples>
Examples <bootstrap_examples.ipynb>
Confidence Interval Construction <confidence-intervals>
Parameter Covariance Estimation <parameter-covariance-estimation>
Low-level Interface <low-level-interface>
Expand Down
19 changes: 18 additions & 1 deletion doc/source/conf.py
Expand Up @@ -14,13 +14,29 @@

import os
from distutils.version import LooseVersion
import glob
import shutil

import arch
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
# 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('.'))

##########################################################
# Copy Examples
##########################################################
root = os.path.split(os.path.abspath(__file__))[0]
example_path = os.path.join(root, '..','..','examples')
examples = glob.glob(os.path.join(example_path, '*.ipynb'))
for example in examples:
_, filename = os.path.split(example)
mod = filename.split('_')[0]
target = os.path.join(root, mod, filename)
shutil.copyfile(example, target)


# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
Expand All @@ -41,7 +57,8 @@
'sphinx.ext.napoleon',
'sphinx.ext.intersphinx',
'IPython.sphinxext.ipython_console_highlighting',
'IPython.sphinxext.ipython_directive'
'IPython.sphinxext.ipython_directive',
'nbsphinx'
]

# Add any paths that contain templates here, relative to this directory.
Expand Down
2 changes: 1 addition & 1 deletion doc/source/multiple-comparison/multiple-comparisons.rst
Expand Up @@ -11,7 +11,7 @@ which is similar to the size of a test.
.. toctree::
:maxdepth: 1

Examples <multiple-comparison_examples>
Examples <multiple-comparison_examples.ipynb>
Module Reference <multiple-comparison-reference>
Background and References <background>

Expand Down
2 changes: 1 addition & 1 deletion doc/source/unitroot/unitroot.rst
Expand Up @@ -22,7 +22,7 @@ process with an alternative of a unit root.
:maxdepth: 1

Introduction <introduction>
Examples <unitroot_examples>
Examples <unitroot_examples.ipynb>
Unit Root Tests <tests>


6 changes: 3 additions & 3 deletions doc/source/univariate/univariate.rst
Expand Up @@ -7,11 +7,11 @@ Univariate Volatility Models
:maxdepth: 1

Introduction <introduction>
Examples <univariate_volatility_modeling>
Examples <univariate_volatility_modeling.ipynb>
Forecasting <forecasting>
Forecasting Examples <univariate_volatility_forecasting>
Forecasting Examples <univariate_volatility_forecasting.ipynb>
Mean Models <mean>
Volatility Processes <volatility>
Using the Fixed Variance Process <univariate_using_fixed_variance>
Using the Fixed Variance Process <univariate_using_fixed_variance.ipynb>
Distributions <distribution>
Background and References <background>

0 comments on commit cc5c46c

Please sign in to comment.