Skip to content

Commit

Permalink
Sphinx doc build
Browse files Browse the repository at this point in the history
Fix doc building process using Sphinx.
  • Loading branch information
Akrog committed Aug 2, 2018
1 parent 968e4c4 commit b538ae2
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ coverage.xml

# Sphinx documentation
docs/_build/
docs/modules.rst
docs/ember_csi.rst

# PyBuilder
target/
Expand Down
25 changes: 24 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

import sys
import os
import recommonmark
from recommonmark import transform as md_transform

# If extensions (or modules to document with autodoc) are in another
# directory, add these directories to sys.path here. If the directory is
Expand All @@ -31,6 +33,14 @@
# version is used.
sys.path.insert(0, project_root)

import modulefaker

for module in ('cinderlib', 'google', 'google.protobuf', 'eventlet',
'kubernetes', 'grpc', 'concurrent', 'os_brick',
'os_brick.initiator', 'oslo_concurrency'):
modulefaker.fake_module(module)


import ember_csi

# -- General configuration ---------------------------------------------
Expand All @@ -45,8 +55,12 @@
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

source_parsers = {
'.md': 'recommonmark.parser.CommonMarkParser',
}

# The suffix of source filenames.
source_suffix = '.rst'
source_suffix = ['.rst', '.md']

# The encoding of source files.
#source_encoding = 'utf-8-sig'
Expand Down Expand Up @@ -273,3 +287,12 @@

# If true, do not generate a @detailmenu in the "Top" node's menu.
#texinfo_no_detailmenu = False

github_doc_root = 'https://github.com/akrog/ember-csi/tree/master/docs/'

def setup(app):
app.add_config_value('recommonmark_config', {
'url_resolver': lambda url: github_doc_root + url,
'auto_toc_tree_section': 'Contents',
}, True)
app.add_transform(md_transform.AutoStructify)
1 change: 1 addition & 0 deletions docs/history.md
1 change: 0 additions & 1 deletion docs/history.rst

This file was deleted.

3 changes: 2 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ Contents:
installation
usage
contributing
authorshistory
authors
history

Indices and tables
==================
Expand Down
1 change: 1 addition & 0 deletions docs/readme.md
1 change: 0 additions & 1 deletion docs/readme.rst

This file was deleted.

6 changes: 3 additions & 3 deletions ember_csi/cl_crd.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
environmental variable is "crd".
All Ember-CSI containers (node and controllers) must have the following
RBACs:
RBACs::
# Allow listing and creating CRDs
- apiGroups: ['apiextensions.k8s.io']
Expand All @@ -17,7 +17,7 @@
verbs: ["*"]
Our Custom Resource Objects can be listed with their singular, plural, and
short names:
short names::
kubectl get vol
kubectl get volume
Expand All @@ -36,7 +36,7 @@
kubectl get keyvalues
Since they are added to the all and ember categories we can also see them
with:
with::
kubectl get all
kubectl get ember
Expand Down
4 changes: 3 additions & 1 deletion ember_csi/rpdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
Expand Down
5 changes: 5 additions & 0 deletions requirements_docs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Sphinx==1.6.5
recommonmark==0.4.0
git+https://github.com/akrog/modulefaker.git#egg=modulefaker
git+https://github.com/akrog/cindermock.git
git+https://github.com/akrog/nosbrickmock.git

0 comments on commit b538ae2

Please sign in to comment.