It would be really nice to embed a table in one my...
# plugins
p
It would be really nice to embed a table in one my
help_text
strings. Are there any other help texts that do that? Would it be formatted like a markdown table?
c
not that I’m aware of. closes I know of would be the bullet lists in strutil.
p
I suppose I could indent it like a code block.
Copy code
help = help_text(
        f"""
        Map of install scripts source files for the APK package.

        This maps the script type (key) to the script source file (value).
        The script types are the terms used by nFPM. Alpine linux uses the
        following terms in the APKBUILD file instead:

            | nFPM term   | APKBUILD term  |
            +-------------+----------------+
            | preinstall  | pre-install    |
            | postinstall | post-install   |
            | preupgrade  | pre-upgrade    |
            | postupgrade | post-upgrade   |
            | preremove   | pre-deinstall  |
            | postremove  | post-deinstall |

        ... more docs about field ...
        """
    )
So, you would end up doing:
Copy code
nfpm_apk_package(
    ...
    scripts={
        "preremove": "path/to/script",
    },
)
And I’m trying to clarify that you are using the nFPM term
preremove
even though the native apk term is
pre-deinstall
.
c
wouldn’t it be nice if the softwrap preserved line breaks if it ends with
|
or
+
? that way we could have a properly rendered markdown table, I think..?
and as such, a
markdown_table()
that renders the markdown from a mapping input?
I could look into adding that to our
strutil
module..
p
That would be sweet!
👍 1
A table just seemed the most natural way to present this info.
c
I agree.. and I can see tables being generally useful to have..
b
I don’t know of a help text that does it, but the “enabling backends “ (I think) normal doc page does… so if one can get something working like that, it’s supported by the renderer