* Add a mkdocs extension to generate the --help output * Add the correct setuptools syntax for relative requirements * docs: use macro plugin instead * docs: remove indirection in docs Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
14 lines
334 B
Python
14 lines
334 B
Python
import subprocess
|
|
from typing import Any
|
|
|
|
# Requires Python 3.7+
|
|
|
|
|
|
def define_env(env: Any) -> None:
|
|
"Hook function for mkdocs-macros"
|
|
|
|
@env.macro
|
|
def subprocess_run(*args: str) -> str:
|
|
"Run a subprocess and return the stdout"
|
|
return subprocess.run(args, check=True, capture_output=True, text=True).stdout
|