ytdl-sub/tools/docgen/static_variables.py
Jesse Bannon 57fd6901e4
[DEV] Linter: Use ruff over black and isort (#1445)
Will eventually replace pylint with ruff
2026-03-09 11:39:01 -07:00

24 lines
818 B
Python

from pathlib import Path
from tools.docgen.docgen import DocGen
from tools.docgen.utils import get_function_docs, section, static_methods
from ytdl_sub.entries.variables.override_variables import SubscriptionVariables
class StaticVariablesDocGen(DocGen):
LOCATION = Path("docs/source/config_reference/scripting/static_variables.rst")
DOCSTRING_LOCATION = "src/ytdl_sub/entries/variables/override_variables.py"
@classmethod
def generate(cls) -> str:
docs = section("Static Variables", level=0)
docs += section("Subscription Variables", level=1)
for name in static_methods(SubscriptionVariables):
docs += get_function_docs(
function_name=name,
obj=SubscriptionVariables,
level=2,
)
return docs