Docs: Enable kbd transform when building dirhtml with sphinx

This commit is contained in:
pagedown 2021-12-11 23:02:53 +08:00
parent 5084f843c9
commit 0a1390a7f6
No known key found for this signature in database
GPG Key ID: E921CF18AC8FF6EB

View File

@ -22,8 +22,11 @@ from pygments.token import ( # type: ignore
Comment, Keyword, Literal, Name, Number, String, Whitespace
)
from sphinx import addnodes, version_info # type: ignore
from sphinx.builders.html.transforms import KeyboardTransform # type: ignore
from sphinx.util.logging import getLogger # type: ignore
KeyboardTransform.builders = ('html', 'dirhtml') # type: ignore
kitty_src = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
if kitty_src not in sys.path:
sys.path.insert(0, kitty_src)