File: gen_readme_images.py

package info (click to toggle)
pytermgui 7.7.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 19,888 kB
  • sloc: python: 12,931; makefile: 40; sh: 37
file content (22 lines) | stat: -rw-r--r-- 563 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import os
from importlib import reload
from pathlib import Path

from termage import termage

project_root = Path(__file__).parent.parent.resolve()
script_dir = project_root / "utils" / "readme_scripts"
output_dir = project_root / "assets" / "readme"

for script in script_dir.iterdir():
    with open(script, "r") as file:
        code = file.read()

    termage(
        code,
        title=str(script.relative_to(project_root)),
        out=(output_dir / script.stem).with_suffix(".svg"),
        bg="#212121",
    )

    print(f"Generated SVG for {script}.")