From 1476eaba0070cfb92b8721c101b5942828d2a7d6 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Tue, 12 Nov 2024 16:23:12 +1300 Subject: [PATCH 1/3] Docs: Add fallback for missing furo_ys This is mainly intended for (latex)pdf builds which do not use the furo-ys html theme, where the yosys script syntax highlighting can safely fallback to plaintext. This effectively makes `furo-ys` an optional dependency to simplify distro-package maintainability. See also #4725. --- docs/source/conf.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 0de8cd445..c625d2814 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -87,5 +87,9 @@ def setup(app: Sphinx) -> None: from util.RtlilLexer import RtlilLexer app.add_lexer("RTLIL", RtlilLexer) - from furo_ys.lexers.YoscryptLexer import YoscryptLexer - app.add_lexer("yoscrypt", YoscryptLexer) + try: + from furo_ys.lexers.YoscryptLexer import YoscryptLexer + app.add_lexer("yoscrypt", YoscryptLexer) + except ModuleNotFoundError: + from pygments.lexers.special import TextLexer + app.add_lexer("yoscrypt", TextLexer) From 44b68fb4987dd746d5dd3c7ab751fdfd7f7a464f Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Wed, 20 Nov 2024 12:18:17 +1300 Subject: [PATCH 2/3] Docs: Add check for envvar to disable todos --- docs/source/conf.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/source/conf.py b/docs/source/conf.py index c625d2814..1f8a886e6 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -56,6 +56,9 @@ if os.getenv("READTHEDOCS"): else: release = yosys_ver todo_include_todos = False +elif os.getenv("YOSYS_DOCS_RELEASE"): + release = yosys_ver + todo_include_todos = False else: release = yosys_ver todo_include_todos = True From e649c1a8e1eebb4acb34af55c7e1b2f4fdeadaf9 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Wed, 20 Nov 2024 12:31:12 +1300 Subject: [PATCH 3/3] Docs: Accept empty string for release envvar --- docs/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 1f8a886e6..b9a908167 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -56,7 +56,7 @@ if os.getenv("READTHEDOCS"): else: release = yosys_ver todo_include_todos = False -elif os.getenv("YOSYS_DOCS_RELEASE"): +elif os.getenv("YOSYS_DOCS_RELEASE") is not None: release = yosys_ver todo_include_todos = False else: