From c3a1c3dc3a1584aba06b019a1ce6add37b8b0610 Mon Sep 17 00:00:00 2001 From: Chris Lenk Date: Mon, 18 Sep 2017 13:29:14 -0400 Subject: [PATCH] Include IPython notebooks in Sphinx docs Note: The first cell in each .ipynb file contains code to suppress tracebacks in output cells. Thus cells that generate exceptions will only output the error, without the traceback, which makes the documentation easier to read. --- docs/conf.py | 1 + docs/creating.ipynb | 3 ++- docs/index.rst | 7 ++++++- docs/markings.ipynb | 3 ++- docs/overview.rst | 2 +- docs/parsing.ipynb | 3 ++- docs/serializing.ipynb | 3 ++- docs/versioning.ipynb | 3 ++- requirements.txt | 1 + 9 files changed, 19 insertions(+), 7 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index e863486..7f00421 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,5 +1,6 @@ extensions = [ 'sphinx-prompt', + 'nbsphinx', ] templates_path = ['_templates'] source_suffix = '.rst' diff --git a/docs/creating.ipynb b/docs/creating.ipynb index 8272e8c..bdcf1d7 100644 --- a/docs/creating.ipynb +++ b/docs/creating.ipynb @@ -4,7 +4,8 @@ "cell_type": "code", "execution_count": 7, "metadata": { - "collapsed": true + "collapsed": true, + "nbsphinx": "hidden" }, "outputs": [], "source": [ diff --git a/docs/index.rst b/docs/index.rst index 7e8723d..da338c8 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -11,8 +11,13 @@ Welcome to stix2's documentation! :caption: Contents: overview - roadmap + creating + serializing + parsing + versioning + markings datastore_api + roadmap contributing diff --git a/docs/markings.ipynb b/docs/markings.ipynb index 041e17b..f8256c3 100644 --- a/docs/markings.ipynb +++ b/docs/markings.ipynb @@ -4,7 +4,8 @@ "cell_type": "code", "execution_count": 1, "metadata": { - "collapsed": true + "collapsed": true, + "nbsphinx": "hidden" }, "outputs": [], "source": [ diff --git a/docs/overview.rst b/docs/overview.rst index 643253c..9802843 100644 --- a/docs/overview.rst +++ b/docs/overview.rst @@ -66,7 +66,7 @@ The **Environment Layer** adds several components that make it easier to handle STIX 2 data as part of a larger application and as part of a larger cyber threat intelligence ecosystem. -- ``Data Source``s represent locations from which STIX data can be retrieved, +- ``Data Source``\s represent locations from which STIX data can be retrieved, such as a TAXII server, database, or local filesystem. The Data Source API abstracts differences between these storage location, giving a common API to get objects by ID or query by various properties, as well as allowing diff --git a/docs/parsing.ipynb b/docs/parsing.ipynb index 9086035..107aead 100644 --- a/docs/parsing.ipynb +++ b/docs/parsing.ipynb @@ -4,7 +4,8 @@ "cell_type": "code", "execution_count": 2, "metadata": { - "collapsed": true + "collapsed": true, + "nbsphinx": "hidden" }, "outputs": [], "source": [ diff --git a/docs/serializing.ipynb b/docs/serializing.ipynb index b6d5e05..4ca5b61 100644 --- a/docs/serializing.ipynb +++ b/docs/serializing.ipynb @@ -4,7 +4,8 @@ "cell_type": "code", "execution_count": 2, "metadata": { - "collapsed": true + "collapsed": true, + "nbsphinx": "hidden" }, "outputs": [], "source": [ diff --git a/docs/versioning.ipynb b/docs/versioning.ipynb index 8f107df..fbf445a 100644 --- a/docs/versioning.ipynb +++ b/docs/versioning.ipynb @@ -4,7 +4,8 @@ "cell_type": "code", "execution_count": 5, "metadata": { - "collapsed": true + "collapsed": true, + "nbsphinx": "hidden" }, "outputs": [], "source": [ diff --git a/requirements.txt b/requirements.txt index 605bc54..93328de 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ bumpversion +nbsphinx pre-commit pytest pytest-cov