Files
rosetta/tools/fixtures/docs_idtech.py
T

22 lines
932 B
Python

# Docs inputs for the id Tech sections of the scene / tilemap / archive pages (tools/fixtures.py; tools/docs_check.py
# explains the inputs), made by the format fixtures' writers: the hand-written UDMF room (udmf.py).
# tests/gen/docs_idtech.luau { files = { [name] = bytes }, vars = { udmfText = "room.udmf", ... } }
import importlib.util, os
INPUTS = ["tools/docs_check.py"]
def mod(ctx, name):
spec = importlib.util.spec_from_file_location("fx_" + name, os.path.join(ctx.root, "tools", name + ".py") if name == "docs_check"
else os.path.join(ctx.root, "tools", "fixtures", name + ".py"))
m = importlib.util.module_from_spec(spec)
spec.loader.exec_module(m)
return m
def generate(ctx):
check = mod(ctx, "docs_check")
files = {"room.udmf": mod(ctx, "udmf").ROOM.encode()}
vars = {"udmfText": "room.udmf"}
check.emit_inputs(ctx, files, vars)