From 348388efb66ab7dbfe42539de613ccc80310eb7b Mon Sep 17 00:00:00 2001 From: umarcor Date: Mon, 7 Feb 2022 17:36:20 +0100 Subject: doc/conf: add interpshinx target 'vasg' --- doc/conf.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'doc/conf.py') diff --git a/doc/conf.py b/doc/conf.py index 4071310a5..b01d17329 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -191,10 +191,11 @@ extensions = [ # Sphinx.Ext.InterSphinx # ============================================================================== intersphinx_mapping = { - 'python': ('https://docs.python.org/3.6/', None), - 'cosim': ('https://ghdl.github.io/ghdl-cosim', None), - 'poc': ('https://poc-library.readthedocs.io/en/release', None), + 'python': ('https://docs.python.org/3.6/', None), + 'cosim': ('https://ghdl.github.io/ghdl-cosim', None), + 'poc': ('https://poc-library.readthedocs.io/en/release', None), 'vhdlmodel': ('https://vhdl.github.io/pyVHDLModel', None), + 'vasg': ('https://ieee-p1076.gitlab.io', None) } -- cgit v1.2.3 From d275c83869d154f2f6529f1e64391f90de9ee64b Mon Sep 17 00:00:00 2001 From: umarcor Date: Mon, 7 Feb 2022 17:52:26 +0100 Subject: doc: use theme_overrides and class 'shield' to fix the width of SHIELDs --- doc/conf.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc/conf.py') diff --git a/doc/conf.py b/doc/conf.py index b01d17329..fc1888b6a 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -86,6 +86,9 @@ html_theme_options = { 'home_breadcrumbs': False, 'vcs_pageview_mode': 'blob', } +html_css_files = [ + "theme_overrides.css", +] html_static_path = ['_static'] # '/public' will contain the output from gnatdoc -- cgit v1.2.3 From ea18eb25e53567a979d40d6cc2d69e1d3e289c93 Mon Sep 17 00:00:00 2001 From: umarcor Date: Mon, 7 Feb 2022 18:20:07 +0100 Subject: doc/conf: fall back to 'alabaster' if '_theme' does not exist --- doc/conf.py | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) (limited to 'doc/conf.py') diff --git a/doc/conf.py b/doc/conf.py index fc1888b6a..8b01b32c7 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -2,10 +2,14 @@ import sys from os.path import abspath from pathlib import Path -from json import loads +from json import loads as json_loads from pyTooling.Packaging import extractVersionInformation + +ROOT = Path(__file__).resolve().parent + + # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. @@ -79,16 +83,24 @@ except Exception as ex: # ============================================================================== # Options for HTML output # ============================================================================== -html_theme = "_theme" -html_theme_path = ["."] -html_theme_options = { - 'logo_only': True, - 'home_breadcrumbs': False, - 'vcs_pageview_mode': 'blob', -} -html_css_files = [ - "theme_overrides.css", -] +html_context = {} +ctx = ROOT / "context.json" +if ctx.is_file(): + html_context.update(json_loads(ctx.open("r").read())) + +if (ROOT / "_theme").is_dir(): + html_theme_path = ["."] + html_theme = "_theme" + html_theme_options = { + "logo_only": True, + "home_breadcrumbs": False, + "vcs_pageview_mode": "blob", + } + html_css_files = [ + "theme_overrides.css", + ] +else: + html_theme = "alabaster" html_static_path = ['_static'] # '/public' will contain the output from gnatdoc @@ -97,10 +109,6 @@ html_extra_path = [str(Path(__file__).resolve().parent.parent / 'public')] # F html_logo = str(Path(html_static_path[0]) / 'logo.png') html_favicon = str(Path(html_static_path[0]) / 'icon.png') -html_context = {} -ctx = Path(__file__).resolve().parent / 'context.json' -if ctx.is_file(): - html_context.update(loads(ctx.open('r').read())) # ============================================================================== # Options for manual page output -- cgit v1.2.3 From 6a694dd839a18cdf0382753fffc17aa1fbd41f9d Mon Sep 17 00:00:00 2001 From: umarcor Date: Mon, 7 Feb 2022 19:28:23 +0100 Subject: doc: use extlinks more --- doc/conf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'doc/conf.py') diff --git a/doc/conf.py b/doc/conf.py index 8b01b32c7..bae26d1ec 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -241,11 +241,11 @@ todo_link_only = True # Sphinx.Ext.ExtLinks # ============================================================================== extlinks = { - 'wikipedia': ('https://en.wikipedia.org/wiki/%s', None), + 'wikipedia': ('https://en.wikipedia.org/wiki/%s', ''), 'ghdlsharp': ('https://github.com/ghdl/ghdl/issues/%s', '#'), 'ghdlissue': ('https://github.com/ghdl/ghdl/issues/%s', 'issue #'), 'ghdlpull': ('https://github.com/ghdl/ghdl/pull/%s', 'pull request #'), - 'ghdlsrc': ('https://github.com/ghdl/ghdl/blob/master/src/%s', None) + 'ghdlsrc': ('https://github.com/ghdl/ghdl/blob/master/src/%s', '') } -- cgit v1.2.3