🐛 fixes anchors for days

This commit is contained in:
Jan Andrle 2024-07-17 16:51:51 +02:00
parent 33d83aaa4f
commit 65628c1f0d
Signed by: jaandrle
GPG Key ID: B3A25AED155AFFAB
4 changed files with 10 additions and 18 deletions

View File

@ -1,7 +1,7 @@
# menicka-cron # menicka-cron
<!-- generated --> <!-- generated -->
[pondělí](#pondeli) · [úterý](#utery) · [středa](#streda) · [čtvrtek](#ctvrtek) · [pátek](#patek) · [sobota](#sobota) · [neděle](#nedele) [pondělí](#pondělí) · [úterý](#úterý) · [středa](#středa) · [čtvrtek](#čtvrtek) · [pátek](#pátek) · [sobota](#sobota) · [neděle](#neděle)
## pondělí ## pondělí
- [🏭 Jídelna Čakovice](https://www.menicka.cz/api/iframe/?id=8542&continuous=true): — - [🏭 Jídelna Čakovice](https://www.menicka.cz/api/iframe/?id=8542&continuous=true): —

16
cli.mjs
View File

@ -12,20 +12,12 @@ $.api()
const menicka= await Promise.allSettled([ menickoCukrovarka(), menickoGlobus(), menickoMamafoodbistro() ]) const menicka= await Promise.allSettled([ menickoCukrovarka(), menickoGlobus(), menickoMamafoodbistro() ])
.then(results=> results.filter(p=> p.status!=="rejected").map(p=> p.value)); .then(results=> results.filter(p=> p.status!=="rejected").map(p=> p.value));
const days= { const days= [ "pondělí", "úterý", "středa", "čtvrtek", "pátek", "sobota", "neděle" ];
pondeli: "pondělí", let out= days
utery: "úterý", .map((v)=> `[${v}](#${v})`)
streda: "středa",
ctvrtek: "čtvrtek",
patek: "pátek",
sobota: "sobota",
nedele: "neděle"
};
let out= Object.entries(days)
.map(([ k, v ])=> `[${v}](#${k})`)
.join(" · "); .join(" · ");
for(const day of Object.values(days)){ for(const day of days){
out+= `\n\n## ${day}\n`; out+= `\n\n## ${day}\n`;
out+= menicka.map(dayToMd(day)).join("\n"); out+= menicka.map(dayToMd(day)).join("\n");
} }

8
package-lock.json generated
View File

@ -1,21 +1,21 @@
{ {
"name": "menicka-cron", "name": "menicka-cron",
"version": "1.0.0", "version": "1.0.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "menicka-cron", "name": "menicka-cron",
"version": "1.0.0", "version": "1.0.1",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"jsdom": "^24.1.0" "jsdom": "~24.1"
}, },
"bin": { "bin": {
"menicka-cron": "cli.mjs" "menicka-cron": "cli.mjs"
}, },
"peerDependencies": { "peerDependencies": {
"nodejsscript": "^1.0.1" "nodejsscript": "~1.0"
} }
}, },
"node_modules/@types/glob": { "node_modules/@types/glob": {

View File

@ -1,6 +1,6 @@
{ {
"name": "menicka-cron", "name": "menicka-cron",
"version": "1.0.0", "version": "1.0.1",
"description": "", "description": "",
"bin": "cli.mjs", "bin": "cli.mjs",
"scripts": { "scripts": {