Browse Source

[Doc] Building docs following Docs Contrib Guide

Baseline changes to comply with OpenStack Documentation
Contributor Guide [0] starting with the following sections:

- Project guide setup
  - [1] sphinx-quickstart
  - [2] doc/source/ layout
- Building documentation
  - [3] tox -e docs
- Using documentation tools
  - [4] openstackdocstheme
- Use build-openstack-docs-pti job template for docs

[0] https://docs.openstack.org/doc-contrib-guide
[1] http://www.sphinx-doc.org/en/master/usage/quickstart.html
[2] https://docs.openstack.org/doc-contrib-guide/project-guides.html
[3] https://docs.openstack.org/doc-contrib-guide/docs-builds.html
[4] https://docs.openstack.org/openstackdocstheme/

Story: 2002708
Task: 26510

Story: 2002813
Task: 26509

Change-Id: I30a92b228540eebd0f991e0c90675bc12d925894
Signed-off-by: Abraham Arce <abraham.arce.moreno@intel.com>
Abraham Arce 7 months ago
parent
commit
6019a07f29
6 changed files with 179 additions and 1 deletions
  1. 3
    0
      .gitignore
  2. 2
    0
      .zuul.yaml
  3. 2
    0
      doc/requirements.txt
  4. 148
    0
      doc/source/conf.py
  5. 15
    0
      doc/source/index.rst
  6. 9
    1
      tox.ini

+ 3
- 0
.gitignore View File

@@ -21,3 +21,6 @@ develop-eggs
21 21
 dist
22 22
 eggs
23 23
 sdist
24
+
25
+# Sphinx documentation
26
+doc/build/

+ 2
- 0
.zuul.yaml View File

@@ -1,5 +1,7 @@
1 1
 ---
2 2
 - project:
3
+    templates:
4
+      - build-openstack-docs-pti
3 5
     check:
4 6
       jobs:
5 7
         - openstack-tox-linters

+ 2
- 0
doc/requirements.txt View File

@@ -0,0 +1,2 @@
1
+sphinx>=1.6.2
2
+openstackdocstheme>=1.19.0 # Apache-2.0

+ 148
- 0
doc/source/conf.py View File

@@ -0,0 +1,148 @@
1
+# -*- coding: utf-8 -*-
2
+#
3
+# Configuration file for the Sphinx documentation builder.
4
+#
5
+# This file does only contain a selection of the most common options. For a
6
+# full list see the documentation:
7
+# http://www.sphinx-doc.org/en/master/config
8
+
9
+# -- Path setup --------------------------------------------------------------
10
+
11
+# If extensions (or modules to document with autodoc) are in another
12
+# directory,
13
+# add these directories to sys.path here. If the directory is relative to the
14
+# documentation root, use os.path.abspath to make it absolute, like shown
15
+# here.
16
+#
17
+# import os
18
+# import sys
19
+# sys.path.insert(0, os.path.abspath('.'))
20
+
21
+
22
+# -- Project information -----------------------------------------------------
23
+
24
+project = u'stx-config'
25
+copyright = u'2018, StarlingX'
26
+author = u'StarlingX'
27
+
28
+# The short X.Y version
29
+version = u''
30
+# The full version, including alpha/beta/rc tags
31
+release = u'0.1'
32
+
33
+
34
+# -- General configuration ---------------------------------------------------
35
+
36
+# If your documentation needs a minimal Sphinx version, state it here.
37
+#
38
+# needs_sphinx = '1.0'
39
+
40
+# Add any Sphinx extension module names here, as strings. They can be
41
+# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
42
+# ones.
43
+extensions = ['openstackdocstheme'
44
+              ]
45
+
46
+# Add any paths that contain templates here, relative to this directory.
47
+templates_path = ['_templates']
48
+
49
+# The suffix(es) of source filenames.
50
+# You can specify multiple suffix as a list of string:
51
+#
52
+# source_suffix = ['.rst', '.md']
53
+source_suffix = '.rst'
54
+
55
+# The master toctree document.
56
+master_doc = 'index'
57
+
58
+bug_project = '1027'
59
+bug_tag = 'stx.bug'
60
+
61
+# The language for content autogenerated by Sphinx. Refer to documentation
62
+# for a list of supported languages.
63
+#
64
+# This is also used if you do content translation via gettext catalogs.
65
+# Usually you set "language" from the command line for these cases.
66
+language = None
67
+
68
+# List of patterns, relative to source directory, that match files and
69
+# directories to ignore when looking for source files.
70
+# This pattern also affects html_static_path and html_extra_path .
71
+exclude_patterns = []
72
+
73
+# The name of the Pygments (syntax highlighting) style to use.
74
+pygments_style = 'sphinx'
75
+
76
+
77
+# -- Options for HTML output -------------------------------------------------
78
+
79
+# The theme to use for HTML and HTML Help pages.  See the documentation for
80
+# a list of builtin themes.
81
+#
82
+html_theme = 'openstackdocs'
83
+
84
+# Theme options are theme-specific and customize the look and feel of a theme
85
+# further.  For a list of options available for each theme, see the
86
+# documentation.
87
+#
88
+# html_theme_options = {}
89
+
90
+# Add any paths that contain custom static files (such as style sheets) here,
91
+# relative to this directory. They are copied after the builtin static files,
92
+# so a file named "default.css" will overwrite the builtin "default.css".
93
+# html_static_path = ['_static']
94
+
95
+# Custom sidebar templates, must be a dictionary that maps document names
96
+# to template names.
97
+#
98
+# The default sidebars (for documents that don't match any pattern) are
99
+# defined by theme itself.  Builtin themes are using these templates by
100
+# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
101
+# 'searchbox.html']``.
102
+#
103
+# html_sidebars = {}
104
+
105
+
106
+# -- Options for HTMLHelp output ---------------------------------------------
107
+
108
+# Output file base name for HTML help builder.
109
+htmlhelp_basename = 'stx-configdoc'
110
+
111
+
112
+# -- Options for LaTeX output ------------------------------------------------
113
+
114
+latex_elements = {
115
+    # The paper size ('letterpaper' or 'a4paper').
116
+    #
117
+    # 'papersize': 'letterpaper',
118
+
119
+    # The font size ('10pt', '11pt' or '12pt').
120
+    #
121
+    # 'pointsize': '10pt',
122
+
123
+    # Additional stuff for the LaTeX preamble.
124
+    #
125
+    # 'preamble': '',
126
+
127
+    # Latex figure (float) alignment
128
+    #
129
+    # 'figure_align': 'htbp',
130
+}
131
+
132
+# Grouping the document tree into LaTeX files. List of tuples
133
+# (source start file, target name, title,
134
+#  author, documentclass [howto, manual, or own class]).
135
+latex_documents = [
136
+    (master_doc, 'stx-config.tex', u'stx-config Documentation',
137
+     u'StarlingX', 'manual'),
138
+]
139
+
140
+
141
+# -- Options for manual page output ------------------------------------------
142
+
143
+# One entry per manual page. List of tuples
144
+# (source start file, name, description, authors, manual section).
145
+man_pages = [
146
+    (master_doc, 'stx-config', u'stx-config Documentation',
147
+     [author], 1)
148
+]

+ 15
- 0
doc/source/index.rst View File

@@ -0,0 +1,15 @@
1
+stx-config Documentation
2
+========================
3
+
4
+StarlingX System Configuration Management
5
+
6
+.. toctree::
7
+   :maxdepth: 2
8
+   :caption: Contents:
9
+
10
+
11
+
12
+Indices and tables
13
+==================
14
+
15
+* :ref:`search`

+ 9
- 1
tox.ini View File

@@ -5,7 +5,7 @@ skipsdist = True
5 5
 
6 6
 [testenv]
7 7
 basepython = python3
8
-install_command = pip install -U {opts} {packages}
8
+install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/pike} {opts} {packages}
9 9
 setenv = VIRTUAL_ENV={envdir}
10 10
          OS_STDOUT_CAPTURE=1
11 11
          OS_STDERR_CAPTURE=1
@@ -46,3 +46,11 @@ description = Dummy environment to allow flake8 to be run in subdir tox
46 46
 
47 47
 [testenv:pylint]
48 48
 description = Dummy environment to allow pylint to be run in subdir tox
49
+
50
+[testenv:docs]
51
+basepython = python3
52
+deps = -r{toxinidir}/doc/requirements.txt
53
+commands =
54
+    rm -rf doc/build
55
+    sphinx-build -a -E -W -d doc/build/doctrees -b html doc/source doc/build/html
56
+whitelist_externals = rm

Loading…
Cancel
Save