Skip to content

Commit 1476eab

Browse files
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.
1 parent 3afb772 commit 1476eab

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

docs/source/conf.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,5 +87,9 @@ def setup(app: Sphinx) -> None:
8787
from util.RtlilLexer import RtlilLexer
8888
app.add_lexer("RTLIL", RtlilLexer)
8989

90-
from furo_ys.lexers.YoscryptLexer import YoscryptLexer
91-
app.add_lexer("yoscrypt", YoscryptLexer)
90+
try:
91+
from furo_ys.lexers.YoscryptLexer import YoscryptLexer
92+
app.add_lexer("yoscrypt", YoscryptLexer)
93+
except ModuleNotFoundError:
94+
from pygments.lexers.special import TextLexer
95+
app.add_lexer("yoscrypt", TextLexer)

0 commit comments

Comments
 (0)