mirror of https://github.com/YosysHQ/yosys.git
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.
This commit is contained in:
parent
3afb7725f1
commit
1476eaba00
|
@ -87,5 +87,9 @@ def setup(app: Sphinx) -> None:
|
||||||
from util.RtlilLexer import RtlilLexer
|
from util.RtlilLexer import RtlilLexer
|
||||||
app.add_lexer("RTLIL", RtlilLexer)
|
app.add_lexer("RTLIL", RtlilLexer)
|
||||||
|
|
||||||
|
try:
|
||||||
from furo_ys.lexers.YoscryptLexer import YoscryptLexer
|
from furo_ys.lexers.YoscryptLexer import YoscryptLexer
|
||||||
app.add_lexer("yoscrypt", YoscryptLexer)
|
app.add_lexer("yoscrypt", YoscryptLexer)
|
||||||
|
except ModuleNotFoundError:
|
||||||
|
from pygments.lexers.special import TextLexer
|
||||||
|
app.add_lexer("yoscrypt", TextLexer)
|
||||||
|
|
Loading…
Reference in New Issue