From a2b2c74111ceabc8060e7feb33f98559665e60d4 Mon Sep 17 00:00:00 2001 From: jstilley Date: Fri, 31 Jan 2025 09:59:10 -0800 Subject: [PATCH] Just another attempt to fix param tables --- doc/.static/dochelpers.py | 43 ++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/doc/.static/dochelpers.py b/doc/.static/dochelpers.py index 64b2afc70..a8305f9e2 100644 --- a/doc/.static/dochelpers.py +++ b/doc/.static/dochelpers.py @@ -79,7 +79,8 @@ def createListTable( Returns ------- - str: RST list-table string + str + RST list-table string """ # we need valid input data assert len(rows) > 1, "Not enough input data." @@ -110,21 +111,24 @@ def createListTable( def generateParamTable(klass, fwParams, app=None): """ - Return a string containing one or more restructured text list tables containing - parameter descriptions for the passed ArmiObject class. + Return a string containing one or more restructured text list tables containing parameter + descriptions for the passed ArmiObject class. Parameters ---------- klass : ArmiObject subclass The Class for which parameter tables should be generated - fwParams : ParameterDefinitionCollection - A parameter definition collection containing the parameters that are always - defined for the passed ``klass``. The rest of the parameters come from the - plugins registered with the passed ``app`` - + A parameter definition collection containing the parameters that are always defined for the + passed ``klass``. The rest of the parameters come from the plugins registered with the + passed ``app`` app : App, optional The ARMI-based application to draw plugins from. + + Returns + ------- + str + RST-formatted string table """ from armi import apps @@ -142,14 +146,15 @@ def generateParamTable(klass, fwParams, app=None): defs[plugin] = pDefs headerContent = """ - .. list-table:: {} Parameters from {{}} - :class: ssp-tiny - :widths: 30 40 30 - :header-rows: 1 - - * - Name - - Description - - Units + .. container:: break_before ssp-landscape + .. list-table:: {} Parameters from {{}} + :class: ssp-tiny + :widths: 30 40 30 + :header-rows: 1 + + * - Name + - Description + - Units """.format( klass.__name__ ) @@ -161,9 +166,9 @@ def generateParamTable(klass, fwParams, app=None): content.append(f".. _{srcName}-{klass.__name__}-param-table:") pluginContent = headerContent.format(srcName) for pd in pdefs: - pluginContent += f""" * - {pd.name} - - {escapeSpecialCharacters(str(pd.description))} - - {escapeSpecialCharacters(pd.units)} + pluginContent += f""" * - {pd.name} + - {escapeSpecialCharacters(str(pd.description))} + - {escapeSpecialCharacters(pd.units)} """ content.append(pluginContent + "\n")