From 4eef5628c86e930c48f90cdcbe51bf5a3651c4c4 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Tue, 8 Nov 2022 10:24:07 +0100 Subject: docs: drop custom envvar directive The custom envvar directive is strange. It overloads the global namespace, where there's already a well-known envvar directive, but the envvar role won't resolve to envvars defined using the custom directive. It's not really critical to declare the type and default value here, and many descriptions already include this. Let's just use the plain one, and let the description take care of the details where needed. Reviewed-by: Yonggang Luo Part-of: --- docs/_exts/formatting.py | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'docs/_exts') diff --git a/docs/_exts/formatting.py b/docs/_exts/formatting.py index c7322d47a58..027662552c2 100644 --- a/docs/_exts/formatting.py +++ b/docs/_exts/formatting.py @@ -9,18 +9,6 @@ import sphinx.addnodes from sphinx.util.nodes import split_explicit_title from docutils import nodes, utils -def parse_envvar(env, sig, signode): - envvar, t, default = sig.split(" ", 2) - envvar = envvar.strip().upper() - t = "Type: %s" % t.strip(" <>").lower() - default = "Default: %s" % default.strip(" ()") - signode += sphinx.addnodes.desc_name(envvar, envvar) - signode += docutils.nodes.Text(' ') - signode += sphinx.addnodes.desc_type(t, t) - signode += docutils.nodes.Text(', ') - signode += sphinx.addnodes.desc_annotation(default, default) - return envvar - def parse_opcode(env, sig, signode): opcode, desc = sig.split("-", 1) opcode = opcode.strip().upper() @@ -46,8 +34,6 @@ def ext_role(name, rawtext, text, lineno, inliner, options={}, content=[]): return [pnode], [] def setup(app): - app.add_object_type("envvar", "envvar", "%s (environment variable)", - parse_envvar) app.add_object_type("opcode", "opcode", "%s (TGSI opcode)", parse_opcode) app.add_role('ext', ext_role) -- cgit v1.2.1