Skip to content

Commit

Permalink
feat: added docfx build in nox file
Browse files Browse the repository at this point in the history
  • Loading branch information
vi3k6i5 committed Apr 7, 2021
1 parent ecb0eec commit a816ab9
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 9 deletions.
9 changes: 9 additions & 0 deletions docs/_static/custom.css
@@ -0,0 +1,9 @@
div#python2-eol {
border-color: red;
border-width: medium;
}

/* Ensure minimum width for 'Parameters' / 'Returns' column */
dl.field-list > dt {
min-width: 100px
}
5 changes: 4 additions & 1 deletion docs/api-reference.rst
Expand Up @@ -3,4 +3,7 @@ API Reference

The following classes and methods constitute the Django Spanner API.

[this page is under construction]
.. toctree::
:maxdepth: 1

schema-api
2 changes: 1 addition & 1 deletion docs/conf.py
Expand Up @@ -173,7 +173,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
Expand Down
8 changes: 8 additions & 0 deletions docs/index.rst
@@ -1,5 +1,13 @@
.. include:: README.rst

Usage Documentation
-------------------
.. toctree::
:maxdepth: 1
:titlesonly:

schema-usage

API Documentation
-----------------
.. toctree::
Expand Down
8 changes: 8 additions & 0 deletions docs/schema-api.rst
@@ -0,0 +1,8 @@
Schema API
=====================

.. automodule:: django_spanner.schema
:members:
:inherited-members:


4 changes: 4 additions & 0 deletions docs/schema-usage.rst
@@ -0,0 +1,4 @@
Schema
####################################

[this page is under construction]
17 changes: 10 additions & 7 deletions noxfile.py
Expand Up @@ -79,7 +79,7 @@ def default(session):
"--cov-append",
"--cov-config=.coveragerc",
"--cov-report=",
"--cov-fail-under=20",
"--cov-fail-under=25",
os.path.join("tests", "unit"),
*session.posargs
)
Expand Down Expand Up @@ -109,12 +109,13 @@ def docs(session):
"""Build the docs for this library."""

session.install("-e", ".[tracing]")
session.install("sphinx", "alabaster", "recommonmark")
session.install("sphinx", "alabaster", "recommonmark", "django==2.2")

shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True)
# Warnings as errors is disabled for `sphinx-build` because django module
# has warnings.
session.run(
"sphinx-build",
"-W", # warnings as errors
"-T", # show full traceback on exception
"-N", # no colors
"-b",
Expand All @@ -130,11 +131,13 @@ def docs(session):
def docfx(session):
"""Build the docfx yaml files for this library."""

session.install("-e", ".[tracing]")
# sphinx-docfx-yaml supports up to sphinx version 1.5.5.
# https://github.com/docascode/sphinx-docfx-yaml/issues/97
session.install("-e", ".")
session.install(
"sphinx==1.5.5", "alabaster", "recommonmark", "sphinx-docfx-yaml"
"sphinx",
"alabaster",
"recommonmark",
"sphinx-docfx-yaml",
"django==2.2",
)

shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True)
Expand Down

0 comments on commit a816ab9

Please sign in to comment.