mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 10:58:28 +00:00
Wrap scenario descriptions in docstrings (#787)
Otherwise, the lines can get kind of long.
This commit is contained in:
parent
f89c6456e3
commit
8ac6f9a198
3 changed files with 16 additions and 5 deletions
|
@ -20,6 +20,7 @@ import json
|
|||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import textwrap
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
|
@ -132,6 +133,10 @@ for index, scenario in enumerate(data["scenarios"]):
|
|||
if scenario["name"] == "example":
|
||||
data["scenarios"].pop(index)
|
||||
|
||||
# Wrap the description onto multiple lines
|
||||
for scenario in data["scenarios"]:
|
||||
scenario["description_lines"] = textwrap.wrap(scenario["description"], width=80)
|
||||
|
||||
# Render the template
|
||||
print("Rendering template...", file=sys.stderr)
|
||||
output = chevron_blue.render(template=TEMPLATE.read_text(), data=data, no_escape=True)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue