Skip to content

Commit

Permalink
Update Appdata XML and add screenshot (#2229)
Browse files Browse the repository at this point in the history
  • Loading branch information
vkbo authored Feb 5, 2025
1 parent 85b953b commit 589bc7c
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 25 deletions.
40 changes: 21 additions & 19 deletions setup/novelwriter.appdata.xml
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>novelwriter</id>
<metadata_license>GPL-3.0</metadata_license>
<project_license>GPL-3.0</project_license>
<name>novelWriter</name>
<summary>A markdown-like text editor for planning and writing novels</summary>
<description>
<p>{description}</p>
</description>
<launchable type="desktop-id">novelwriter.desktop</launchable>
<url type="homepage">https://novelwriter.io/</url>
<screenshots>
<screenshot type="default">
<image>https://novelwriter.io/images/screenshot-multi.png</image>
</screenshot>
</screenshots>
<provides>
<id>novelwriter.desktop</id>
</provides>
</component>
<id>io.novelwriter.novelWriter</id>
<metadata_license>GPL-3.0</metadata_license>
<project_license>GPL-3.0</project_license>
<developer_name>Veronica Berglyd Olsen</developer_name>
<name>novelWriter</name>
<summary>A plain text editor for planning and writing novels</summary>
<description>
<p>{description}</p>
</description>
<launchable type="desktop-id">novelwriter.desktop</launchable>
<url type="homepage">https://novelwriter.io/</url>
<screenshots>
<screenshot type="default">
<image>https://raw.githubusercontent.com/vkbo/novelWriter/refs/heads/main/setup/screenshot.png</image>
</screenshot>
</screenshots>
<provides>
<mediatype>application/x-novelwriter-project</mediatype>
<id>novelwriter.desktop</id>
</provides>
</component>
Binary file added setup/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 3 additions & 6 deletions utils/build_appimage.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
import sys

from utils.common import (
ROOT_DIR, SETUP_DIR, copyPackageFiles, copySourceCode, extractVersion,
makeCheckSum, readFile, toUpload, writeFile
ROOT_DIR, SETUP_DIR, appdataXml, copyPackageFiles, copySourceCode,
extractVersion, makeCheckSum, toUpload, writeFile
)


Expand Down Expand Up @@ -113,10 +113,7 @@ def appImage(args: argparse.Namespace) -> None:
# Write Metadata
# ==============

appDescription = readFile(SETUP_DIR / "description_short.txt")
appdataXML = readFile(SETUP_DIR / "novelwriter.appdata.xml")
appdataXML = appdataXML.format(description=appDescription)
writeFile(imgDir / "novelwriter.appdata.xml", appdataXML)
writeFile(imgDir / "novelwriter.appdata.xml", appdataXml())
print("Wrote: novelwriter.appdata.xml")

writeFile(imgDir / "entrypoint.sh", (
Expand Down
9 changes: 9 additions & 0 deletions utils/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,15 @@ def checkAssetsExist() -> bool:
return hasSample and hasManual and hasQmData


def appdataXml() -> str:
"""Generate the appdata XML content."""
raw = readFile(SETUP_DIR / "description_short.txt")
desc = " ".join(raw.strip().splitlines()).strip()
xml = readFile(SETUP_DIR / "novelwriter.appdata.xml")
xml = xml.format(description=desc)
return xml


def readFile(file: Path) -> str:
"""Read an entire file and return as a string."""
return file.read_text(encoding="utf-8")
Expand Down

0 comments on commit 589bc7c

Please sign in to comment.