Skip to content
This repository has been archived by the owner on Aug 13, 2019. It is now read-only.

Fix readthedocs fixes 438 #440

Merged
merged 2 commits into from
May 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions docs/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.
SPHINXOPTS = -W
SPHINXBUILD = sphinx-build
SPHINXPROJ = Buildhub
SOURCEDIR = .
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)
2 changes: 1 addition & 1 deletion docs/_static/theme_overrides.css
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@
word-break: break-word;
word-wrap: break-word;
white-space: pre-wrap;
}
}
4 changes: 2 additions & 2 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ Or the Python client:

import kinto_http

client = kinto_http.Client("https://buildhub.prod.mozaws.net/v1")
client = kinto_http.Client(server_url="https://buildhub.prod.mozaws.net/v1")
records = client.get_records(**{"build.id": "20110110192031", "_limit": 1, "pages": 1},
bucket="build-hub", collection="releases")
print(len(records) >= 1)
Expand All @@ -188,7 +188,7 @@ What is the Mercurial commit ID of a build ID?

.. code-block:: python

client = kinto_http.Client("https://buildhub.prod.mozaws.net/v1")
client = kinto_http.Client(server_url="https://buildhub.prod.mozaws.net/v1")
records = client.get_records(**{"build.id": "20110110192031", "_limit": 1, "pages": 1},
bucket="build-hub", collection="releases")
try:
Expand Down
228 changes: 129 additions & 99 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
# -*- coding: utf-8 -*-
#
# Buildhub documentation build configuration file, created by
# sphinx-quickstart on Mon Feb 2 15:08:06 2015.
# Configuration file for the Sphinx documentation builder.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config

# -- 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.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))

import os
import sys

__HERE__ = os.path.dirname(os.path.abspath(__file__))
# -- Project information -----------------------------------------------------

on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
project = 'Buildhub'
copyright = '2018, Mozilla Product Delivery Team'
author = 'Mozilla Product Delivery Team'

if not on_rtd: # only import and set the theme if we're building docs locally
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# The short X.Y version
version = ''
# The full version, including alpha/beta/rc tags
release = ''

# otherwise, readthedocs.io uses their theme by default, so no need to specify
# it

# 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(os.path.join('..')))
# -- General configuration ---------------------------------------------------

# -- General configuration ------------------------------------------------
keep_warnings = True

# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
Expand All @@ -48,130 +48,160 @@
]

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

templates_path = ['_templates']

# The suffix of source filenames.
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'

# The encoding of source files.
# source_encoding = 'utf-8-sig'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = 'Buildhub'
copyright = '2017 — Mozilla Services'

# 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.
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# The short X.Y version.
version = '7.0'
# The full version, including alpha/beta/rc tags.
release = '7.2.1'
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None

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

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'

# 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']

# Output file base name for HTML help builder.
htmlhelp_basename = 'Buildhubdoc'
def setup(app):
# path relative to _static
app.add_stylesheet('theme_overrides.css')


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

autodoc_member_order = 'bysource'
# Enable nitpicky mode - which ensures that all references in the docs
# resolve.
# See: http://stackoverflow.com/a/30624034/186202
nitpicky = True
nitpick_ignore = [
('py:obj', 'Exception'),
('py:obj', 'bool'),
('py:obj', 'cornice.Service'),
('py:obj', 'dict'),
('py:obj', 'float'),
('py:obj', 'int'),
('py:obj', 'list'),
('py:obj', 'str'),
('py:obj', 'tuple'),
# Member autodoc fails with those:
# kinto.core.resource.schema
('py:class', 'Integer'),
('py:class', 'String'),
# kinto.core.resource
('py:class', 'Model'),
('py:class', 'ResourceSchema'),
('py:class', 'ShareableModel'),
('py:class', 'ShareableViewSet'),
('py:class', 'ViewSet'),
('py:class', 'Sequence')
]
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
# html_theme = 'alabaster'
html_theme = 'sphinx_rtd_theme'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}

# -- Options of extlinks --------------------------------------------------
# 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']

extlinks = {
'github': ('https://github.com/%s/', ''),
'rtd': ('https://%s.readthedocs.io', ''),
'blog': ('http://www.servicedenuages.fr/%s', '')
}
# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# The default sidebars (for documents that don't match any pattern) are
# defined by theme itself. Builtin themes are using these templates by
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
# 'searchbox.html']``.
#
# html_sidebars = {}


# -- Substitutions
# -- Options for HTMLHelp output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'Buildhubdoc'

# --
def setup(app):
# path relative to _static
app.add_stylesheet('theme_overrides.css')

# -- Options for LaTeX output ------------------------------------------------

# -- Options for intersphinx --------------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# -- Options for LaTeX output ---------------------------------------------
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

latex_elements = {}
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
('index', 'Buildhub.tex', 'Buildhub Documentation',
'Mozilla Services — Da French Team', 'manual'),
(master_doc, 'Buildhub.tex', 'Buildhub Documentation',
'Mozilla Product Delivery Team', 'manual'),
]


# -- Options for manual page output ---------------------------------------
# -- Options for manual page output ------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'kinto', 'Buildhub Documentation',
['Mozilla Services — Da French Team'], 1)
(master_doc, 'buildhub', 'Buildhub Documentation',
[author], 1)
]


# -- Options for Texinfo output -------------------------------------------
# -- Options for Texinfo output ----------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'Buildhub', 'Buildhub Documentation',
'Mozilla Services — Storage Team', 'Buildhub',
'A Mozilla project build interface.',
(master_doc, 'Buildhub', 'Buildhub Documentation',
author, 'Buildhub', 'One line description of project.',
'Miscellaneous'),
]


# -- Options of extlinks --------------------------------------------------

extlinks = {
'github': ('https://github.com/%s/', ''),
'rtd': ('https://%s.readthedocs.io', ''),
'blog': ('http://www.servicedenuages.fr/%s', '')
}


# -- Options for autodoc --------------------------------------------------

autodoc_member_order = 'bysource'
# Enable nitpicky mode - which ensures that all references in the docs
# resolve.
# See: http://stackoverflow.com/a/30624034/186202
nitpicky = True
nitpick_ignore = [
('py:obj', 'Exception'),
('py:obj', 'bool'),
('py:obj', 'cornice.Service'),
('py:obj', 'dict'),
('py:obj', 'float'),
('py:obj', 'int'),
('py:obj', 'list'),
('py:obj', 'str'),
('py:obj', 'tuple'),
# Member autodoc fails with those:
# kinto.core.resource.schema
('py:class', 'Integer'),
('py:class', 'String'),
# kinto.core.resource
('py:class', 'Model'),
('py:class', 'ResourceSchema'),
('py:class', 'ShareableModel'),
('py:class', 'ShareableViewSet'),
('py:class', 'ViewSet'),
('py:class', 'Sequence')
]
4 changes: 2 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
docutils<0.13
Sphinx<1.6
sphinx
sphinx-autobuild
sphinx_rtd_theme
sphinxcontrib-httpdomain
2 changes: 1 addition & 1 deletion docs/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ usage() {

case $1 in
build)
sphinx-build -a -W -n -b html -d docs/_build/doctrees docs docs/_build/html
cd docs && make html
;;
*)
exec "$@"
Expand Down