@ai-ecoverse/slicc-man 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/site.mjs +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -134,7 +134,7 @@ Pages, the sitemap and the topic index are cached:
|
|
|
134
134
|
|
|
135
135
|
Each site has its own directory in the cache, named by the base URL's host and port (`www.sliccy.com`, `127.0.0.1-8080`), with one JSON file per page, `sitemap.json` and `index.json`. A cached copy is fresh for the response's `Cache-Control` `max-age` (the site sends 4 hours), and 4 hours without one. A stale copy is revalidated with `If-Modified-Since` (the response's `Last-Modified`): `304` keeps it and makes it fresh again, `200` replaces it, and `404` drops it, so the topic has no page. When the site can't be reached, or answers 5xx, a cached copy is shown however old, after one line on stderr, `<cmd>: <url>: <reason>; showing the copy cached <date>`. With nothing cached, the command prints `<cmd>: <url>: <reason>` and exits 2. The cache is written atomically (a temporary file renamed into place), so two commands at once never see half a page; a cache that can't be written is skipped without a word.
|
|
136
136
|
|
|
137
|
-
`apropos` and `whatis` read the index: every `/man/<topic>` entry of the sitemap, with its description, the first paragraph of its page, rendered as plain text on one line. The index is built from the cached sitemap and pages, fetching what is missing or stale (pages through the same cache, several at a time), and cached itself under the same rules. A page that fails to load is listed without a description.
|
|
137
|
+
`apropos` and `whatis` read the index: every `/man/<topic>` entry of the sitemap, with its description, the first paragraph of its page, rendered as plain text on one line. The index is built from the cached sitemap and pages, fetching what is missing or stale (pages through the same cache, several at a time), and cached itself under the same rules. A page that fails to load is listed without a description; the other pages are still fetched, and an index with a failed page isn't cached, so the next command tries that page again.
|
|
138
138
|
|
|
139
139
|
`SLICC_MAN_URL` overrides the base URL `https://www.sliccy.com`: pages are `$SLICC_MAN_URL/man/<topic>.md` and the sitemap `$SLICC_MAN_URL/sitemap.xml`, whose entries count by their path, whatever their host. The tests point it at a local server.
|
|
140
140
|
|
package/lib/site.mjs
CHANGED
|
@@ -154,12 +154,12 @@ export function site({ url, store, fetch, now = Date.now, name }) {
|
|
|
154
154
|
async function build(list, offline) {
|
|
155
155
|
const entries = new Array(list.length);
|
|
156
156
|
let next = 0;
|
|
157
|
-
let down =
|
|
157
|
+
let down = false;
|
|
158
158
|
async function worker() {
|
|
159
159
|
while (next < list.length) {
|
|
160
160
|
const at = next++;
|
|
161
161
|
const topic = list[at];
|
|
162
|
-
const found = await page(topic, { offline
|
|
162
|
+
const found = await page(topic, { offline });
|
|
163
163
|
if (found.stale || found.offline) down = true;
|
|
164
164
|
entries[at] = { topic, description: found.status === 'ok' ? describe(found.body) : '' };
|
|
165
165
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-ecoverse/slicc-man",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "man, apropos and whatis for SLICC, and scman for SLICC, macOS, Linux and Windows, reading pages from www.sliccy.com/man",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|