diff --git a/CHANGELOG.md b/CHANGELOG.md index 29b6aa6e5..48bfe74ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,3 +19,4 @@ Changed for individual apps are listed in `apps/appname/ChangeLog` * If `bin/pre-publish.sh` has been run and recent.csv created, add 'Sort By' chip * New 'espruinotools' which fixes pretokenise issue when ID follows ID (fix #416) * Improve upload of binary files +* App description can now be markdown diff --git a/README.md b/README.md index 04854c99e..ac4fc716d 100644 --- a/README.md +++ b/README.md @@ -217,7 +217,7 @@ and which gives information about the app for the Launcher. "name": "Readable name", // readable name "shortName": "Short name", // short name for launcher "icon": "icon.png", // icon in apps/ - "description": "...", // long description + "description": "...", // long description (can contain markdown) "type":"...", // optional(if app) - 'app'/'widget'/'launch'/'bootloader' "tags": "", // comma separated tag list for searching diff --git a/js/index.js b/js/index.js index 34975f3a1..363081a15 100644 --- a/js/index.js +++ b/js/index.js @@ -52,6 +52,11 @@ function showReadme(appid) { } httpGet(appPath+app.readme).then(show).catch(()=>show("Failed to load README.")); } +function getAppDescription(app) { + let appPath = `apps/${app.id}/`; + let markedOptions = { baseUrl : appPath }; + return marked(app.description, markedOptions); +} function handleCustomApp(appTemplate) { // Pops up an IFRAME that allows an app to be customised if (!appTemplate.custom) throw new Error("App doesn't have custom HTML"); @@ -259,7 +264,7 @@ function refreshLibrary() {
${escapeHtml(app.name)} ${versionInfo}
-${escapeHtml(app.description)}${app.readme?`
${readme}`:""}
${getAppDescription(app)}${app.readme?`
${readme}`:""}
${escapeHtml(app.name)} (${version.text})
-${escapeHtml(app.description)}
+${getAppDescription(app)}