42 lines
1.1 KiB
Text
42 lines
1.1 KiB
Text
|
|
cd snippet
|
|
rm -f library.html
|
|
let snippets = ls | each {
|
|
let title = (
|
|
cat $in.name |
|
|
grep "<h1>" |
|
|
str replace -ar "<.*?>" "" |
|
|
str replace -ar "\\[\\[[+!](.*?)\\]\\]" "$1"
|
|
)
|
|
if ($title | str contains "Redirecting to") {
|
|
return {
|
|
str: ""
|
|
title: $title
|
|
}
|
|
}
|
|
{
|
|
str: ("<li><a href=https://eep.li/!" + ($in.name | str replace ".html" "") + ">" + $title + "</a></li>")
|
|
title: $title
|
|
}
|
|
} | sort-by title
|
|
cd ../schedule
|
|
let schedules = ls | each {
|
|
let title = (
|
|
cat $in.name |
|
|
grep "<h1>" |
|
|
str replace -ar "<.*?>" "" |
|
|
str replace -ar "\\[\\[[+!](.*?)\\]\\]" "$1"
|
|
)
|
|
if ($title | str contains "Redirecting to") {
|
|
return {
|
|
str: ""
|
|
title: $title
|
|
}
|
|
}
|
|
{
|
|
str: ("<li><a href=https://eep.li/" + ($in.name | str replace ".html" "") + ">" + $title + "</a></li>")
|
|
title: $title
|
|
}
|
|
} | sort-by title
|
|
cd ../snippet
|
|
("<<header>> <h1> Meta: Library </h1> This page provides a list of all snippets that are currently available: <p> <ul>" + ($snippets.str | str join) + "</ul> <h2> Schedules </h2> <ul> " + ($schedules.str | str join) + " </ul>") | save library.html
|