Skip to content

Commit

Permalink
Merge pull request #1 from youngchanpark/doc
Browse files Browse the repository at this point in the history
Added ReadTheDocs build files
  • Loading branch information
youngchanpark committed May 25, 2020
2 parents e3a8fed + 0418e56 commit 697c6f3
Show file tree
Hide file tree
Showing 14 changed files with 724 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ __pycache__
# Distribution
build/
dist/

doc/build/

# Unit test / coverage reports
.coverage
Expand Down
30 changes: 30 additions & 0 deletions doc/.readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Build documentation in the docs/ directory with Sphinx
sphinx:
builder: html
configuration: doc/source/conf.py
fail_on_warning: true


# Optionally build your docs in additional formats such as PDF
formats:
- epub
- pdf

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.7
install:
- requirements: doc/requirements.txt
- method: pip
path: .


build:
image: 3.7
20 changes: 20 additions & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
35 changes: 35 additions & 0 deletions doc/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
26 changes: 26 additions & 0 deletions doc/source/API/testmynb.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
API References
==============

.. toctree::
:maxdepth: 2
:caption: Contents:

Classes
-------
.. autoclass:: testmynb.handler.TestHandler
:members:


.. autoclass:: testmynb.notebook.TestCell
:members:
:show-inheritance:


.. autoclass:: testmynb.notebook.Notebook
:members:
:show-inheritance:


Functions
---------
.. autofunction:: testmynb.handler.find_notebooks
73 changes: 73 additions & 0 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# 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.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))


# -- Project information -----------------------------------------------------

project = 'Test My Notebook'
copyright = '2020, Young-Chan Park'
author = 'Young-Chan Park'

# The full version, including alpha/beta/rc tags
release = '0.0.1'


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

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.napoleon', 'nbsphinx']

# Napoleon settings
napoleon_google_docstring = False
napoleon_numpy_docstring = True
napoleon_include_init_with_doc = False
napoleon_include_private_with_doc = False
napoleon_include_special_with_doc = True
napoleon_use_admonition_for_examples = False
napoleon_use_admonition_for_notes = False
napoleon_use_admonition_for_references = False
napoleon_use_ivar = True
napoleon_use_param = True
napoleon_use_rtype = False

# nbsphinx Settings
highlight_language = 'python3'
nbsphinx_input_prompt = 'In [%s]:'
nbsphinx_output_prompt = 'Out[%s]:'
nbsphinx_codecell_lexer = 'python3'

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'

# 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']
4 changes: 4 additions & 0 deletions doc/source/genindex.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.. This file is a placeholder and will be replaced
Index
=====
26 changes: 26 additions & 0 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
testmynb: Jupyter Notebook Testing Framework
============================================
`testmynb` is a testing framework which runs tests written in Jupyter Notebook code cells.


.. toctree::
:maxdepth: 1
:caption: Table Of Contents:

Install <main/install>
How To Use <main/test_how_to>
Use Case <main/test_why_use_testmynb>
API/testmynb




.. toctree::
:maxdepth: 2
:caption: Appendix

genindex
modindex
search


15 changes: 15 additions & 0 deletions doc/source/main/install.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Installation Guide
==================

Availability
------------
| Python: 3.5, 3.6, 3.7, 3.8, 3.9
| Platforms: Linux, macOS

Run the following command to install `testmynb` from PyPI and check its version.

.. code:: bash
$ pip install testmynb
$ testmynb --version

0 comments on commit 697c6f3

Please sign in to comment.