Skip to content

Commit 5c4590f

Browse files
committed
docs: try to fix colors
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 90ec5b7 commit 5c4590f

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

docs/main.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ def subprocess_run(*args: str) -> str:
2121
env["PYTHON_COLORS"] = "1"
2222
output = subprocess.run(args, check=True, capture_output=True, text=True, env=env).stdout
2323
rich_text = rich.text.Text.from_ansi(output)
24-
console = rich.console.Console(record=True)
24+
console = rich.console.Console(record=True, force_terminal=True)
2525
console.print(rich_text)
2626
page = console.export_html(inline_styles=True)
27-
text = re.search(r"<body.*?>(.*?)</body>", page, re.DOTALL | re.IGNORECASE).group(1)
28-
return text.strip()
27+
result = re.search(r"<body.*?>(.*?)</body>", page, re.DOTALL | re.IGNORECASE)
28+
assert result
29+
txt = result.group(1).strip()
30+
return txt.replace("code ", 'code class="nohighlight" ')

noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def bump_version(session: nox.Session) -> None:
173173
session.install_and_run_script("bin/bump_version.py")
174174

175175

176-
@nox.session(default=False, python="3.12")
176+
@nox.session(default=False)
177177
def docs(session: nox.Session) -> None:
178178
"""
179179
Build the docs. Will serve unless --non-interactive

0 commit comments

Comments
 (0)