[AppStream] Additional markup support in descriptions

Simon McVittie smcv at collabora.com
Fri Jul 26 13:44:06 UTC 2019


On Fri, 26 Jul 2019 at 14:35:19 +0200, Matthias Klumpp wrote:
> Am Fr., 26. Juli 2019 um 05:32 Uhr schrieb Robert Ancell
> > - code <code> or <pre> or <pre><code> (CommonMark uses options 1 and 3, but it's probably simpler to just only <code> or <pre> in AppStream. I'm not enough of an XML expert to work out the differences between these tags).
> 
> <code> makes sense to me, if it isn't overused. Would code be inline
> monospace, or rather be a code block?

You're welcome to support or not-support each of those in Appstream as
you wish, but for each one you do support, I think it would be wise to
make it mean the same thing it does in HTML.

<code> is an inline element like <em> to be applied to characters/words,
for example "please run <code>apt-get clean</code> occasionally". In
Markdown you get this from backquotes: "please run `apt-get clean`
occasionally".

<pre> is a block in which significant whitespace is preserved.
The example XML in
https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-categories
is a <pre> block.

<pre><code> is a <pre> block whose contents are semantically marked
as being code (as opposed to some other use you might have had for <pre>).

In Markdown you get either <pre> or <pre><code> (it isn't immediately
clear which one you should get) by indenting by 4 spaces or 1 tab, or
in a common non-standard extension popularized by Github, by putting
``` lines above and below ("fenced blocks").

    smcv


More information about the AppStream mailing list