33# SPDX-FileCopyrightText: NONE
44# SPDX-License-Identifier: CC0-1.0
55
6- # Configuration file for the Sphinx documentation builder
7- # For the full list of built-in configuration values, see the documentation: https://www.sphinx-doc.org/en/master/usage/configuration.html
6+ # Configuration file for the Sphinx documentation builder.
7+ # For the full list of built-in configuration values, see the documentation:
8+ # https://www.sphinx-doc.org/en/master/usage/configuration.html
89
910import os
1011import shutil
1415from sphinx import addnodes
1516from sphinx .util import logging
1617
18+ logger = logging .getLogger (__name__ )
19+
20+ # Root of the documentation directory (the directory containing this file)
21+ _DOCS_DIR = os .path .dirname (os .path .abspath (__file__ ))
22+
23+ # Root of the repository (one level above docs/)
24+ _REPO_ROOT = os .path .normpath (os .path .join (_DOCS_DIR , '..' ))
25+
1726
1827def get_version ():
19- props_path = os .path .join (os . path . dirname ( __file__ ), '..' , 'zip-content' , 'module.prop' )
28+ props_path = os .path .join (_REPO_ROOT , 'zip-content' , 'module.prop' )
2029
2130 if os .path .exists (props_path ):
2231 with open (props_path , 'r' ) as f :
@@ -91,8 +100,6 @@ def setup(app):
91100 }
92101
93102
94- logger = logging .getLogger (__name__ )
95-
96103# Project information
97104project = 'Google sync add-on'
98105author = 'ale5000'
@@ -119,9 +126,11 @@ def setup(app):
119126"""
120127
121128# Options for source files
129+ exclude_patterns = ['CONTRIBUTORS.md' ]
122130master_doc = 'index'
123131source_suffix = {
124- '.rst' : 'restructuredtext'
132+ '.rst' : 'restructuredtext' ,
133+ '.md' : 'markdown'
125134}
126135
127136# Options for HTML output
@@ -135,9 +144,10 @@ def setup(app):
135144}
136145
137146# Options for LaTeX output (e.g., PDF)
138- if 'latex_elements' not in locals ():
139- latex_elements = {}
147+ latex_elements = {}
140148
141149# The 'openany' option allows chapters to begin on the next available page;
142150# this prevents unwanted blank pages by allowing starts on even or odd pages
143- latex_elements ['extraclassoptions' ] = (latex_elements .get ('extraclassoptions' , '' ) + ',openany' ).strip (',' )
151+ latex_elements .update ({
152+ 'extraclassoptions' : 'openany'
153+ })
0 commit comments