bilelmoussaoui / appstream Goto Github PK
View Code? Open in Web Editor NEWAppstream files parser
Home Page: https://bilelmoussaoui.github.io/appstream/appstream
License: MIT License
Appstream files parser
Home Page: https://bilelmoussaoui.github.io/appstream/appstream
License: MIT License
Any file which includes
<translation></translation>
or
<translation/>
Will result in an error when loading as
let element = xmltree::Element::parse(data).unwrap();
let appdata = Component::try_from(&element).unwrap();
For some reason that it is beyond the grasp of the author, this is a very common practice in metainfo files.
Invalid value mediatype passed to attribute type for tag provide
Removing the comment <!-- GNOME Software kudos: https://gitlab.gnome.org/GNOME/gnome-software/-/blob/main/doc/kudos.md -->
makes it parse the file successfully.
Appmeta data file used:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Julian Sparber 2022 <[email protected]> -->
<component type="desktop-application">
<id>@app-id@</id>
<metadata_license>CC0</metadata_license>
<!-- Insert your license of choice here -->
<!-- <project_license>MIT</project_license> -->
<name>App Metadata Editor</name>
<summary>Write a GTK + Rust application</summary>
<description>
<p>A boilerplate template for GTK + Rust. It uses Meson as a build system and has flatpak support by default.</p>
</description>
<screenshots>
<screenshot type="default">
<image>https://gitlab.gnome.org/bilelmoussaoui/app-metadata-editor/raw/master/data/resources/screenshots/screenshot1.png</image>
<caption>Main window</caption>
</screenshot>
</screenshots>
<url type="homepage">https://gitlab.gnome.org/bilelmoussaoui/app-metadata-editor</url>
<url type="bugtracker">https://gitlab.gnome.org/bilelmoussaoui/app-metadata-editor/issues</url>
<content_rating type="oars-1.0" />
<releases>
<release version="0.1.0" date="2019-07-11" />
</releases>
<kudos>
<!--
GNOME Software kudos:
https://gitlab.gnome.org/GNOME/gnome-software/-/blob/main/doc/kudos.md
-->
<kudo>ModernToolkit</kudo>
<kudo>HiDpiIcon</kudo>
</kudos>
<developer_name>Julian Sparber</developer_name>
<update_contact>[email protected]</update_contact>
<translation type="gettext">@gettext-package@</translation>
<launchable type="desktop-id">@[email protected]</launchable>
</component>
The following in Software's metainfo
<requires>
<!-- Adaptive -->
<display_length compare="ge">small</display_length>
</requires>
causes
Error: InvalidTag("id")
https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-custom
I think we should just merge the info from the metadata
(probably a legacy thing) and the custom
tag.
Maybe add support for reading custom
into the existing metadata
field for now and make a braking change in the future to name it custom
to align with the standard?
I am writing an App store application in Rust. It so happened that this application must run on Debian that only provides YAML metadata.
So Flathub moved to relative media URLs. (They are still lacking the media_baseurl
, though.)
media_baseurl
The base URL for media (screenshots, icons, ...) referenced in the metadata file. If this is set, all urls in the document referencing media will be treated relative to the base url.
https://www.freedesktop.org/software/appstream/docs/chap-CatalogData.html#spec-asxml-general
It looks like it could be relatively annoying to directly parse URL fields into absolute URLs because you would have to pass the base URL to decoders all the time. An alternative might be to have an enum with Relative/Absolute where relative URLs have to be made absolute by the API user.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.