Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Silence output, fix input encoding
  • Loading branch information
AA-Turner committed Jun 13, 2022
commit 917894e77fe7df9b6221726cb58dcaca3ec15e79
15 changes: 13 additions & 2 deletions pyperformance/data-files/benchmarks/bm_docutils/run_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,28 @@
from docutils import core
import pyperf

try:
from docutils.utils.math.math2html import Trace
except ImportError:
pass
else:
Trace.show = lambda message, channel: ... # don't print to console


def build_html(doc_root, out_root):
for file in doc_root.rglob("*.txt"):
try:
dest = out_root / file.relative_to(doc_root).with_suffix(".html")
dest.mkdir(parents=True, exist_ok=True)
dest.parent.mkdir(parents=True, exist_ok=True)
core.publish_file(source_path=str(file),
Comment thread
AA-Turner marked this conversation as resolved.
Outdated
destination_path=str(dest),
reader_name="standalone",
parser_name="restructuredtext",
writer_name="html5")
writer_name="html5",
settings_overrides={
"input_encoding": "utf-8",
"report_level": 5,
})
except docutils.ApplicationError:
...

Expand Down