1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
vim -c "colorscheme morning" -c "set nowrap" -c TOhtml -c wqa $0
cat <<- PAGE > ${0%.*}.html
<!DOCTYPE html>
<html>
<head>
<title>links</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="/style.css">
</head>
<body>
<a href="../">../</a>
<p>Links I would like to share with you</p>
<p>last edit: $(date "+%d %B %Y")</p>
<details>
<summary>$(basename $0)</summary>
<article>
<code class="lignes">
<pre>$(seq $(cat $0 | wc -l)| awk '{printf "<span>%s</span>\n", $0'})</pre>
</code>
<code>$(cat $0.html | htmlq "#vimCodeElement, style" --remove-nodes ".LineNr" | grep -vE "^body {" | grep -vE "background-color:.*}$")
</code>
</article>
</details>
<nav>
<hr>
<ul>
$(cat links.md | lowdown | grep "<h1" |
sed -Ee "s/<h([1-5]) id=\"(.*)\"/<li class=\"h\1\"><a href=\"#\2\"/g" \
-Ee "s/<\/h[0-9]>/<\/a><\/li>/g")
</ul>
<hr>
</nav>
<main>
$(cat links.md | lowdown)
</main>
</body>
</html>
PAGE
rm $0.html