_optdoc

PlasmaCalcs.tools.docs_tools._optdoc(s)

return s, but cleaned up with inspect.cleandoc() then replacing newlines with ‘ ‘.

The result is suitable for internally-represented multiline documentation for options,
to convert them to a single-line format for display.
Especially relevant for …_MODE_OPTIONS dicts, which might be like:
MY_MODE_OPTIONS = {
‘option1’: _optdoc(“””short description of option 1.
Longer description of option 1
with more details, which may span multiple lines”””)
‘option2’: “””single-line description doesn’t need _optdoc”””
}
Using _optdoc means, e.g. print(MY_MODE_OPTIONS) will be easy to read later.
Without _optdoc, it is harder to read, with lots of newline characters and weird spacing.