66import subprocess
77from datetime import date
88from docutils import nodes
9- from sphinx .util import logging
109from recommonmark .transform import AutoStructify
1110from recommonmark .parser import CommonMarkParser , splitext , urlparse
1211from sphinx_scylladb_theme .utils import multiversion_regex_builder
1312
14- logger = logging .getLogger (__name__ )
15-
1613# -- General configuration ------------------------------------------------
1714
18- # If your documentation needs a minimal Sphinx version, state it here.
19- #
20- needs_sphinx = '1.8'
2115sys .path .insert (0 , os .path .abspath ('../../' ))
2216
2317# Add any Sphinx extension module names here, as strings. They can be
@@ -86,15 +80,6 @@ def replace_relative_links(app, docname, source):
8680copyright = str (date .today ().year ) + ', ScyllaDB. All rights reserved.'
8781author = u'Scylla Project Contributors'
8882
89- # The version info for the project you're documenting, acts as replacement for
90- # |version| and |release|, also used in various other places throughout the
91- # built documents.
92- #
93- # The short X.Y version.
94- version = u'2.15'
95- # The full version, including alpha/beta/rc tags.
96- release = u'2.15.3'
97-
9883# The language for content autogenerated by Sphinx. Refer to documentation
9984# for a list of supported languages.
10085#
@@ -113,15 +98,6 @@ def replace_relative_links(app, docname, source):
11398# If true, `todo` and `todoList` produce output, else they produce nothing.
11499todo_include_todos = True
115100
116- # Custom lexer
117- from pygments .lexers .shell import BashLexer
118- from sphinx .highlighting import lexers
119- sys .path .insert (0 , os .path .abspath ('../_utils' ))
120- from cql import CQLLexer
121-
122- class DitaaLexer (BashLexer ):
123- pass
124-
125101# Setup Sphinx
126102def setup (app ):
127103 app .add_source_parser (CustomCommonMarkParser )
@@ -141,56 +117,6 @@ def setup(app):
141117 app .connect ('source-read' , replace_relative_links )
142118 app .connect ("builder-inited" , generate_doxygen )
143119
144- #Install custom lexers
145- app .add_lexer ("cql" , CQLLexer ())
146- app .add_lexer ("ditaa" , DitaaLexer ())
147-
148- # Custom variables
149- rst_prolog = """
150- .. |mon_version| replace:: 3.1
151- """
152-
153- # -- Options for HTML output ----------------------------------------------
154-
155- # The theme to use for HTML and HTML Help pages. See the documentation for
156- # a list of builtin themes.
157- #
158- html_theme = 'sphinx_scylladb_theme'
159- html_style = ''
160-
161- # Theme options are theme-specific and customize the look and feel of a theme
162- # further. For a list of options available for each theme, see the
163- # documentation.
164- #
165- html_theme_options = {
166- 'header_links' : [
167- ('C/C++ Driver' , 'https://cpp-driver.docs.scylladb.com/' ),
168- ('Scylla Cloud' , 'https://docs.scylladb.com/scylla-cloud/' ),
169- ('Scylla University' , 'https://university.scylladb.com/' ),
170- ('ScyllaDB Home' , 'https://www.scylladb.com/' )],
171- 'github_issues_repository' : 'scylladb/cpp-driver' ,
172- }
173-
174- extlinks = {}
175-
176- # If not None, a 'Last updated on:' timestamp is inserted at every page
177- # bottom, using the given strftime format.
178- # The empty string is equivalent to '%b %d, %Y'.
179- #
180- html_last_updated_fmt = '%d %B %Y'
181-
182- # Custom sidebar templates, maps document names to template names.
183- #
184- html_sidebars = {'**' : ['side-nav.html' ]}
185-
186- # Output file base name for HTML help builder.
187- htmlhelp_basename = 'ScyllaDocumentationdoc'
188-
189- # URL which points to the root of the HTML documentation.
190- html_baseurl = 'https://cpp-driver.docs.scylladb.com'
191-
192- # Dictionary of values to pass into the template engine’s context for all pages
193- html_context = {'html_baseurl' : html_baseurl }
194120
195121# -- Options for not found extension -------------------------------------------
196122
@@ -255,43 +181,41 @@ def generate_doxygen(app):
255181 DOXYGEN_XML_DIR = breathe_projects [breathe_default_project ]
256182 _generate_doxygen_rst (DOXYGEN_XML_DIR , app .builder .srcdir + '/api' )
257183
258- # -- Options for LaTeX page output ---------------------------------------
259-
260- # Grouping the document tree into LaTeX files. List of tuples
261- # (source start file, target name, title,
262- # author, documentclass [howto, manual, or own class]).
263- latex_documents = [
264- (master_doc , 'ScyllaDocumentation.tex' , u'Scylla Driver Documentation' ,
265- u'Scylla Project Contributors' , 'manual' ),
266- ]
184+ # -- Options for HTML output ----------------------------------------------
267185
268- # -- Options for manual page output ---------------------------------------
186+ # The theme to use for HTML and HTML Help pages. See the documentation for
187+ # a list of builtin themes.
188+ #
189+ html_theme = 'sphinx_scylladb_theme'
269190
270- # One entry per manual page. List of tuples
271- # (source start file, name, description, authors, manual section).
272- man_pages = [
273- (master_doc , 'scylladocumentation' , u'Scylla Driver Documentation' ,
274- [author ], 1 )
275- ]
191+ # Theme options are theme-specific and customize the look and feel of a theme
192+ # further. For a list of options available for each theme, see the
193+ # documentation.
194+ #
195+ html_theme_options = {
196+ 'conf_py_path' : 'docs/source/' ,
197+ 'default_branch' : 'master' ,
198+ 'github_repository' : 'scylladb/cpp-driver' ,
199+ 'github_issues_repository' : 'scylladb/cpp-driver' ,
200+ 'hide_edit_this_page_button' : 'false' ,
201+ 'hide_sidebar_index' : 'false'
202+ }
276203
277- # -- Options for Texinfo output -------------------------------------------
204+ # If not None, a 'Last updated on:' timestamp is inserted at every page
205+ # bottom, using the given strftime format.
206+ # The empty string is equivalent to '%b %d, %Y'.
207+ #
208+ html_last_updated_fmt = '%d %B %Y'
278209
279- # Grouping the document tree into Texinfo files. List of tuples
280- # (source start file, target name, title, author,
281- # dir menu entry, description, category)
282- texinfo_documents = [
283- (master_doc , 'ScyllaDocumentation' , u'Scylla Driver Documentation' ,
284- author , 'ScyllaDocumentation' , 'One line description of project.' ,
285- 'Miscellaneous' ),
286- ]
210+ # Custom sidebar templates, maps document names to template names.
211+ #
212+ html_sidebars = {'**' : ['side-nav.html' ]}
287213
288- # -- Options for Epub output ----------------------------------------------
214+ # Output file base name for HTML help builder.
215+ htmlhelp_basename = 'ScyllaDocumentationdoc'
289216
290- # Bibliographic Dublin Core info.
291- epub_title = project
292- epub_author = author
293- epub_publisher = author
294- epub_copyright = copyright
217+ # URL which points to the root of the HTML documentation.
218+ html_baseurl = 'https://cpp-driver.docs.scylladb.com'
295219
296- # A list of files that should not be packed into the epub file.
297- epub_exclude_files = [ 'search.html' ]
220+ # Dictionary of values to pass into the template engine’s context for all pages
221+ html_context = { 'html_baseurl' : html_baseurl }
0 commit comments