Skip to content

Commit

Permalink
doc: use :config:datatype: in generated docs
Browse files Browse the repository at this point in the history
Use :config:datatype: in generated config directives table and descriptions.
  • Loading branch information
joergsteffens committed Nov 30, 2021
1 parent d4c41ca commit a8a5e84
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions docs/manuals/scripts/generate-resoure-descriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ def getConvertedResourceDirectives(self, daemon, resourcename):
strings["required"] = "True"
result += " :required: {required}\n".format(**strings)

result += " :type: :ref:`{datatype}<DataType{datatype}>` \n".format(**strings)
result += " :type: :config:datatype:`{datatype}`\n".format(**strings)

if data.get("default_value"):
result += " :default: {default}\n".format(**strings)
Expand Down Expand Up @@ -558,11 +558,9 @@ def getRows(self, daemon, resourcename, subtree, link):
strings["directive_link"] = link % strings

if data.get("equals"):
strings["datatype"] = "= %(datatype)s" % {"datatype": data["datatype"]}
strings["datatype"] = "= :config:datatype:`{datatype}`\ ".format(**data)
else:
strings["datatype"] = "\{ %(datatype)s \}" % {
"datatype": data["datatype"]
}
strings["datatype"] = "{{ :config:datatype:`{datatype}`\ }}".format(**data)

extra = []
if data.get("alias"):
Expand All @@ -577,9 +575,6 @@ def getRows(self, daemon, resourcename, subtree, link):
strings["mc"] = "** "
strings["extra"] = ", ".join(extra)

strings["t_datatype"] = '"{}"'.format(
self.getStringsWithModifiers("datatype", strings)
)
strings["t_default"] = '"{}"'.format(
self.getStringsWithModifiers("default", strings)
)
Expand All @@ -589,7 +584,7 @@ def getRows(self, daemon, resourcename, subtree, link):

# result+=' %(directive_link)-60s, %(t_datatype)-20s, %(t_default)-20s, %(t_extra)s\n' % ( strings )
result += (
" %(directive_link)-60s, %(t_datatype)s, %(t_default)s, %(t_extra)s\n"
" %(directive_link)-60s, %(datatype)s, %(t_default)s, %(t_extra)s\n"
% (strings)
)

Expand Down

0 comments on commit a8a5e84

Please sign in to comment.