Skip to content

Commit

Permalink
Trying something different
Browse files Browse the repository at this point in the history
  • Loading branch information
john-science committed Jan 30, 2025
1 parent db57bfd commit 008396d
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions doc/user/inputs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1605,27 +1605,30 @@ through ``self.cs``.
cs = settings.Settings()

# User textwrap to split up long words that mess up the table.
ws = " "
ws2 = ws + " "
ws3 = ws2 + " "
wrapper = textwrap.TextWrapper(width=25, subsequent_indent='')
wrapper2 = textwrap.TextWrapper(width=10, subsequent_indent='')
content = '\n.. rst-class:: break_before, ssp-landscape, break_after\n\n'
content += '.. list-table:: ARMI Settings\n'
content += ' :widths: 25 25 10 25\n'
content += ' :class: ssp-tinier \n'
content += ' :header-rows: 1\n'
content += ' \n * - Name\n - Description\n - Default\n - Options\n'
content = '\n.. container:: break_before ssp-landscape\n\n'
content += ws + '.. list-table:: ARMI Settings\n'
content += ws2 + ':widths: 25 25 10 25\n'
content += ws2 + ':class: ssp-tinier \n'
content += ws2 + ':header-rows: 1\n\n'
content += ws2 + '* - Name\n' + ws3 + '- Description\n' + ws3 + '- Default\n' + ws3 + '- Options\n'

for setting in sorted(cs.values(), key=lambda s: s.name):
content += ' * - {}\n'.format(' '.join(wrapper.wrap(setting.name)))
content += ws2 + '* - {}\n'.format(' '.join(wrapper.wrap(setting.name)))
description = escapeSpecialCharacters(str(setting.description) or "")
content += " - {}\n".format(" ".join(wrapper.wrap(description)))
content += ws3 + "- {}\n".format(" ".join(wrapper.wrap(description)))
default = str(getattr(setting, 'default', None)).split("/")[-1]
options = str(getattr(setting,'options','') or '')
if looks_like_path(default):
# We don't want to display default file paths in this table.
default = ""
options = ""
content += ' - {}\n'.format(' '.join(['``{}``'.format(wrapped) for wrapped in wrapper2.wrap(default)]))
content += ' - {}\n'.format(' '.join(['``{}``'.format(wrapped) for wrapped in wrapper.wrap(options)]))
content += ws3 + '- {}\n'.format(' '.join(['``{}``'.format(wrapped) for wrapped in wrapper2.wrap(default)]))
content += ws3 + '- {}\n'.format(' '.join(['``{}``'.format(wrapped) for wrapped in wrapper.wrap(options)]))

content += '\n'

Expand Down

0 comments on commit 008396d

Please sign in to comment.