diff --git a/setup/novelwriter.appdata.xml b/setup/novelwriter.appdata.xml index 98a6e33b..e03329f9 100644 --- a/setup/novelwriter.appdata.xml +++ b/setup/novelwriter.appdata.xml @@ -1,21 +1,23 @@ - novelwriter - GPL-3.0 - GPL-3.0 - novelWriter - A markdown-like text editor for planning and writing novels - -

{description}

-
- novelwriter.desktop - https://novelwriter.io/ - - - https://novelwriter.io/images/screenshot-multi.png - - - - novelwriter.desktop - -
\ No newline at end of file + io.novelwriter.novelWriter + GPL-3.0 + GPL-3.0 + Veronica Berglyd Olsen + novelWriter + A plain text editor for planning and writing novels + +

{description}

+
+ novelwriter.desktop + https://novelwriter.io/ + + + https://raw.githubusercontent.com/vkbo/novelWriter/refs/heads/main/setup/screenshot.png + + + + application/x-novelwriter-project + novelwriter.desktop + + diff --git a/setup/screenshot.png b/setup/screenshot.png new file mode 100644 index 00000000..4a4bb2eb Binary files /dev/null and b/setup/screenshot.png differ diff --git a/utils/build_appimage.py b/utils/build_appimage.py index f4fd45fe..72a30afe 100644 --- a/utils/build_appimage.py +++ b/utils/build_appimage.py @@ -27,8 +27,8 @@ import subprocess 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 ) @@ -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", ( diff --git a/utils/common.py b/utils/common.py index ae7a3b68..e5b85613 100644 --- a/utils/common.py +++ b/utils/common.py @@ -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")