From a9003d2a9f680b6f7e70363cd7fc8c84c3d32c2b Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Thu, 31 Mar 2022 16:25:33 +0100 Subject: [PATCH 1/3] Clean sphinx config - removes invalid objects.inv entries - reformatted by black on save --- .pre-commit-config.yaml | 4 -- docs/conf.py | 81 ++++++++++++++++------------------------- 2 files changed, 32 insertions(+), 53 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f5e32f0bf..d771d45e1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,10 +5,6 @@ ci: - pip-compile default_language_version: python: python3.8 -exclude: | - (?x)( - ^docs/conf.py$ - ) repos: - repo: https://github.com/pre-commit/mirrors-prettier # keep it before yamllint diff --git a/docs/conf.py b/docs/conf.py index 514684612..4e768e018 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -17,7 +17,6 @@ import molecule - # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. @@ -37,17 +36,17 @@ ] # Add any paths that contain templates here, relative to this directory. -templates_path = ['.templates'] +templates_path = [".templates"] # The suffix of source filenames. -source_suffix = '.rst' +source_suffix = ".rst" # The master toctree document. -master_doc = 'index' +master_doc = "index" # General information about the project. project = "Molecule" -copyright = " %s, Red Hat Inc." % datetime.date.today().year +copyright = f" {datetime.date.today().year}, Red Hat Inc." author = "AUTHORS.rst" github_url = "https://github.com" @@ -83,7 +82,7 @@ # non-false value, then it is used: # today = '' # Else, today_fmt is used as the format for a strftime call. -today_fmt = '%B %d, %Y' +today_fmt = "%B %d, %Y" # List of documents that shouldn't be included in the build. # unused_docs = [] @@ -113,9 +112,9 @@ # show_authors = False # The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'ansible' +pygments_style = "ansible" -highlight_language = 'YAML+Jinja' +highlight_language = "YAML+Jinja" # Substitutions, variables, entities, & shortcuts for text which do not need to link to anything. # For titles which should be a link, use the intersphinx anchors set at the index, chapter, and section levels, such as qi_start_: @@ -133,7 +132,7 @@ # Options for HTML output # ----------------------- -html_theme = 'sphinx_ansible_theme' +html_theme = "sphinx_ansible_theme" html_show_sphinx = False html_favicon = "_static/images/favicon.ico" @@ -144,26 +143,26 @@ "style_nav_header_background": "#5bbdbf", "style_external_links": True, # 'canonical_url': "https://docs.ansible.com/ansible/latest/", - 'vcs_pageview_mode': 'edit', + "vcs_pageview_mode": "edit", "navigation_depth": 3, - 'topbar_links': { - 'AnsibleFest': 'https://www.ansible.com/ansiblefest', - 'Products': 'https://www.ansible.com/tower', - 'Community': 'https://www.ansible.com/community', - 'Webinars & Training': 'https://www.ansible.com/webinars-training', - 'Blog': 'https://www.ansible.com/blog', + "topbar_links": { + "AnsibleFest": "https://www.ansible.com/ansiblefest", + "Products": "https://www.ansible.com/tower", + "Community": "https://www.ansible.com/community", + "Webinars & Training": "https://www.ansible.com/webinars-training", + "Blog": "https://www.ansible.com/blog", }, } html_context = { - 'display_github': 'True', - 'github_user': 'ansible-community', - 'github_repo': 'molecule', - 'github_version': 'main/docs/', - 'current_version': version, - 'latest_version': 'latest', + "display_github": "True", + "github_user": "ansible-community", + "github_repo": "molecule", + "github_version": "main/docs/", + "current_version": version, + "latest_version": "latest", # list specifically out of order to make latest work - 'available_versions': ('latest', ), + "available_versions": ("latest",), } # Add extra CSS styles to the resulting HTML pages @@ -173,10 +172,10 @@ # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". -html_title = f'{project} Documentation' +html_title = f"{project} Documentation" # A shorter title for the navigation bar. Default is the same as html_title. -html_short_title = 'Documentation' +html_short_title = "Documentation" # The name of an image file (within the static path) to place at the top of # the sidebar. @@ -191,11 +190,11 @@ # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +html_static_path = ["_static"] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. -html_last_updated_fmt = '%b %d, %Y' +html_last_updated_fmt = "%b %d, %Y" # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. @@ -229,7 +228,7 @@ # html_file_suffix = '' # Output file base name for HTML help builder. -htmlhelp_basename = 'Poseidodoc' +htmlhelp_basename = "Poseidodoc" # Configuration for sphinx-notfound-pages # with no 'notfound_template' and no 'notfound_context' set, @@ -278,33 +277,17 @@ # If false, no module index is generated. # latex_use_modindex = True -autoclass_content = 'both' +autoclass_content = "both" -# Note: Our strategy for intersphinx mappings is to have the upstream build location as the -# canonical source and then cached copies of the mapping stored locally in case someone is building -# when disconnected from the internet. We then have a script to update the cached copies. -# -# Because of that, each entry in this mapping should have this format: -# name: ('http://UPSTREAM_URL', (None, 'path/to/local/cache.inv')) -# -# The update script depends on this format so deviating from this (for instance, adding a third -# location for the mappning to live) will confuse it. -intersphinx_mapping = {'python': ('https://docs.python.org/2/', (None, '../python2.inv')), - 'python3': ('https://docs.python.org/3/', (None, '../python3.inv')), - 'jinja2': ('http://jinja.palletsprojects.com/', (None, '../jinja2.inv')), - 'ansible_2_9': ('https://docs.ansible.com/ansible/2.9/', (None, '../ansible_2_9.inv')), - 'ansible_2_8': ('https://docs.ansible.com/ansible/2.8/', (None, '../ansible_2_8.inv')), - 'ansible_2_7': ('https://docs.ansible.com/ansible/2.7/', (None, '../ansible_2_7.inv')), - 'ansible_2_6': ('https://docs.ansible.com/ansible/2.6/', (None, '../ansible_2_6.inv')), - 'ansible_2_5': ('https://docs.ansible.com/ansible/2.5/', (None, '../ansible_2_5.inv')), +intersphinx_mapping = { "ansible": ("https://docs.ansible.com/ansible/latest/", None), + "jinja2": ("http://jinja.palletsprojects.com/", None), "pip": ("https://pip.pypa.io/en/latest/", None), "python": ("https://docs.python.org/3", None), - "python2": ("https://docs.python.org/2", None), "testinfra": ("https://testinfra.readthedocs.io/en/latest/", None), - "yamllint": ("http://yamllint.readthedocs.io/en/latest/", None), "virtualenv": ("https://virtualenv.pypa.io/en/latest/", None), - } + "yamllint": ("http://yamllint.readthedocs.io/en/latest/", None), +} linkcheck_workers = 25 # linkcheck_anchors = False From fe3f3e2288a5665b38f259f5cb55f2a8443f178e Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Thu, 31 Mar 2022 16:48:41 +0100 Subject: [PATCH 2/3] Update docs/conf.py Co-authored-by: Daniel Ziegenberg --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 4e768e018..4dfdb9d70 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -286,7 +286,7 @@ "python": ("https://docs.python.org/3", None), "testinfra": ("https://testinfra.readthedocs.io/en/latest/", None), "virtualenv": ("https://virtualenv.pypa.io/en/latest/", None), - "yamllint": ("http://yamllint.readthedocs.io/en/latest/", None), + "yamllint": ("https://yamllint.readthedocs.io/en/latest/", None), } linkcheck_workers = 25 From 4877f317f1b4bdbeabb55318306fac5908526ac9 Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Thu, 31 Mar 2022 16:55:24 +0100 Subject: [PATCH 3/3] More --- docs/conf.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 4dfdb9d70..287517e9a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -46,8 +46,8 @@ # General information about the project. project = "Molecule" -copyright = f" {datetime.date.today().year}, Red Hat Inc." -author = "AUTHORS.rst" +author = "Red Hat Inc" +copyright = f" {datetime.date.today().year}, {author}" github_url = "https://github.com" github_repo_org = "ansible" @@ -256,9 +256,7 @@ # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, document class # [howto/manual]). -latex_documents = [ - (master_doc, "Molecule.tex", "Molecule Documentation", "AUTHORS.rst", "manual") -] +latex_documents = [(master_doc, "Molecule.tex", "Molecule Documentation", "manual")] # The name of an image file (relative to this directory) to place at the top of # the title page. @@ -281,7 +279,7 @@ intersphinx_mapping = { "ansible": ("https://docs.ansible.com/ansible/latest/", None), - "jinja2": ("http://jinja.palletsprojects.com/", None), + "jinja2": ("https://jinja.palletsprojects.com/", None), "pip": ("https://pip.pypa.io/en/latest/", None), "python": ("https://docs.python.org/3", None), "testinfra": ("https://testinfra.readthedocs.io/en/latest/", None),