INNER CODE UNIT · Python
makeTableRST
KATRIN-Experiment/Kassiopeia · Scripts/gen-bindings-docs.py:181
def makeTableRST(self, level=0, stack=[], nodes=set(), key='', with_sections=False):
global base_url
numCols = 6
colWidths = (80, 240, 80, 160, 80, 40) # in RST the columns all must have the same width
colHeaders = ('element name', 'source files', 'child elements', 'child types', 'attributes', 'attribute types')
headSep = ["-", "~", "^", "'"] # starts at level 3
if not key and self.xml_names:
key = list(self.xml_names)[0]
escapeStr = lambda txt: txt.translate(dict([ (ord(c),f'\{c}') for c in "<>" ])) # escape invalid chars
cleanStr = lambda txt: txt.translate(dict([ (ord(c),f'_') for c in "<>" ])) # strip invalid chars
full_name = cleanStr(f'{self.name}')
if full_name in nodes:
return nodes
nodes.add(full_name)
def printLine(separators):