<div class="help-text">
Game box images can be PNG, GIF, JPEG, SVG, AVIF, or WEBP. Images should be no bigger than 200px × 200px, to not take up too much space on the page.
</div>
<div class="help-text">
Package names are free-form strings, and structures the project into sub-parts. A typical package name would be <code>Module</code>
</div>
<div class="help-text">
<p>
Release numbers <i>must</i> follow the conventions of <a href="https://semver.org">Semantic Versioning</a> - i.e., be of the form <i>Major</i>.<i>Minor</i>.<i>Patch</i> (and optional pre-release or build information attached), where <i>Major</i>. <i>Minor</i>, and <i>Patch</i> are whole, non-negative, numbers.
</p>
<p>
Examples of valid release versions are
</p>
<pre>
1.2.3
10.20.30-alpha
6.4.0-rc1
5.3.8+french
</pre>
</div>
<div class="help-text">
<p>Project names consist solely of the letters <code>a,b,...,z</code>,
<code>A,B,...,Z</code>, digits <code>0,1,...,9</code>, dashes and underscores
<code>-_</code>, and can be no longer than 64 characters. Note that the project
name <i>must</i> start with a letter and <i>cannot</i> contain spaces, punctuation,
or other special characters.
<p>Examples of good project names are
<pre>
afrika_korps_username
battle_of_the_bulge_3rd_ed_username
...
</pre>
</div>
{#if !uploading}
<div class="help-text">
<p>
Remember that the version number of the module set <i>inside</i> the
module <i>must</i> be a valid <a href="https://semver.org">Semantic Version</a>,
e.g., <code>1.2.3</code>. The file name <i>should</i> contain the version number
too, but is not required to. Also file name of should preferably not contain
spaces, punctuation, or special characters other than those in the version number,
and as allowed by <a href="https://semver.org">Semantic Version</a> format.
</p>
<p>
To set the version number in the module, open the module in the editor and
double click the top-level element.
</p>
</div>
{/if}
I think you need to formulate a policy before you start to think about the interface. Currently, as far as I remember, the tags are stored in the DB as key-value pairs in the form key:value, and I think all tags are of this form. Given that is the case, then I would follow that schema and insist on key-value pairs. This will also make sense when searching for projects based on tags - e.g., “find all projects with key=value” or
SELECT project_id FROM tags WHERE key = key AND tag LIKE value
Presumably, when a user adds an image to a README section, that image will be uploaded to the backend. The back-end will then reply with a specific URL into the object storage. This then get’s put into the README editor as
(Discourse replaces with upload://abcdef0123456789.ext, which I guess is then looked up in some DB to get the actual URL.)
This of course means that the MarkDown editor code can do this - i.e., upload images on the fly and place their URL into the text being edited.
I’m not well enough versed in Svelte or the other JS tools you use to give concrete suggestions on code to use, but I guess it can be found.
Another option would be to have a separate image list to which one can upload an image, and then look up the actual object storage URL.
Presumably, the thumb-nail generation would happen in the back-end, which means you could use any available Rust library for this. For example ImageMagick’s Rust binding MagickRust