This is an automated email from the ASF dual-hosted git repository. tomaz pushed a commit to branch apidocs_improvements in repository https://gitbox.apache.org/repos/asf/libcloud.git
The following commit(s) were added to refs/heads/apidocs_improvements by this push: new 6b23b7bd5 Add :orphan: tag to apidocs/modules.rst to avoid warnings during the docs build. 6b23b7bd5 is described below commit 6b23b7bd58ecf5410f95313a1f6a40dc3d44329c Author: Tomaz Muraus <to...@tomaz.me> AuthorDate: Tue Aug 8 23:00:11 2023 +0200 Add :orphan: tag to apidocs/modules.rst to avoid warnings during the docs build. --- docs/conf.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 9e6f4cba9..0232e4415 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -303,10 +303,21 @@ suppress_warnings = [ ] +def add_orphan_tag_to_apidocs(app, docname, source): + """ + Add :orphan: tag to apidocs/modules.rst file to avoid errors during docs build. + """ + + if docname == "apidocs/modules": + source[0] = ":orphan:" + "\n\n" + source[0] + + # Taken and based from code in the sphinx project (BSD 2.0 license) # https://github.com/sphinx-doc/sphinx/blob/master/doc/conf.py def linkify_issues_in_changelog(app, docname, source): - """Linkify issue references like #123 in changelog to GitHub.""" + """ + Linkify issue references in changelog to GitHub and Jira. + """ if docname == "changelog": changelog_path = os.path.join(BASE_DIR, "../CHANGES.rst") @@ -361,3 +372,4 @@ def run_apidoc(_): def setup(app): app.connect("builder-inited", run_apidoc) app.connect("source-read", linkify_issues_in_changelog) + app.connect("source-read", add_orphan_tag_to_apidocs)