2 # Sphinx extension providing formatting for Gallium-specific data
3 # (c) Corbin Simpson 2010
4 # Public domain to the extent permitted; contact author for special licensing
9 def parse_envvar(env
, sig
, signode
):
10 envvar
, t
, default
= sig
.split(" ", 2)
11 envvar
= envvar
.strip().upper()
12 t
= " Type: %s" % t
.strip(" <>").lower()
13 default
= " Default: %s" % default
.strip(" ()")
14 signode
+= sphinx
.addnodes
.desc_name(envvar
, envvar
)
15 signode
+= sphinx
.addnodes
.desc_type(t
, t
)
16 signode
+= sphinx
.addnodes
.desc_annotation(default
, default
)
19 def parse_opcode(env
, sig
, signode
):
20 opcode
, desc
= sig
.split("-", 1)
21 opcode
= opcode
.strip().upper()
22 desc
= " (%s)" % desc
.strip()
23 signode
+= sphinx
.addnodes
.desc_name(opcode
, opcode
)
24 signode
+= sphinx
.addnodes
.desc_annotation(desc
, desc
)
28 app
.add_description_unit("envvar", "envvar", "%s (environment variable)",
30 app
.add_description_unit("opcode", "opcode", "%s (TGSI opcode)",