summaryrefslogtreecommitdiff
path: root/extension/background.js
diff options
context:
space:
mode:
authorOmar Rizwan <omar@omar.website>2021-09-13 06:17:46 -0700
committerOmar Rizwan <omar@omar.website>2021-09-13 06:17:46 -0700
commitc5228d4ac0befd194d7a8d910087d9f25d099e22 (patch)
treeb374b06055a2771542ff3c2664a7be6c110d716a /extension/background.js
parentb8258aaa019de66081444dedd3c6020f53a5296f (diff)
downloadTabFS-c5228d4ac0befd194d7a8d910087d9f25d099e22.tar.gz
TabFS-c5228d4ac0befd194d7a8d910087d9f25d099e22.zip
extension: Improve routes.html w icons, top text.
Diffstat (limited to 'extension/background.js')
-rw-r--r--extension/background.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/extension/background.js b/extension/background.js
index 2b20fc6..5eba68b 100644
--- a/extension/background.js
+++ b/extension/background.js
@@ -675,22 +675,26 @@ Routes["/runtime/routes.html"] = makeRouteWithContents(async () => {
return null; // did not find
}
return `
+<!doctype html>
<html>
<head>
+ <meta charset="utf-8">
<style>
dt:not(:first-of-type) { margin-top: 1em; }
</style>
</head>
<body>
+ <p>This page is automatically generated from <a href="https://github.com/osnr/TabFS/blob/master/extension/background.js">extension/background.js in the TabFS source code</a>.</p>
+ <p>It documents each of the folders and files that TabFS serves up from your browser.</p>
<p>(work in progress)</p>
<dl>
- ` + Object.entries(Routes).map(([path, {usage, description, __isInfill}]) => {
+ ` + Object.entries(Routes).map(([path, {usage, description, __isInfill, readdir}]) => {
if (__isInfill) { return ''; }
let usages = usage ? (Array.isArray(usage) ? usage : [usage]) : [];
usages = usages.map(u => u.replace('\$0', path.substring(1) /* drop leading / */));
const lineRange = findRouteLineRange(path);
return `
- <dt>${path.substring(1)}</dt>
+ <dt>${readdir ? '&#x1F4C1;' : '&#x1F4C4;'} ${path.substring(1)}</dt>
${description ? `<dd>Description: ${description}</dd>` :
'<dd style="background-color: #f99">No description found!</dd>'}
${usages.length > 0 ? `<dd>Usage: