mirror of
https://github.com/Igglybuff/awesome-piracy.git
synced 2025-02-18 13:24:21 -05:00
add missing TOC items + bookmarks.html
This commit is contained in:
parent
99d49abf25
commit
6f84293ebc
1473
bookmarks.html
Normal file
1473
bookmarks.html
Normal file
File diff suppressed because it is too large
Load Diff
41
create-bookmarks.sh
Executable file
41
create-bookmarks.sh
Executable file
@ -0,0 +1,41 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
script_dir=$(dirname "$(readlink -f "$0")")
|
||||||
|
|
||||||
|
if [ -e "${script_dir}/bookmarks.html" ]; then
|
||||||
|
rm "${script_dir}/bookmarks.html"
|
||||||
|
fi
|
||||||
|
|
||||||
|
cat "${script_dir}/readme.md" | tail -n +152 | head -n -9 > "${script_dir}/readme-copy.html"
|
||||||
|
lines=$(cat "${script_dir}/readme-copy.html")
|
||||||
|
touch "${script_dir}/bookmarks.html"
|
||||||
|
|
||||||
|
echo "<TITLE>Bookmarks</TITLE>" >> "${script_dir}/bookmarks.html"
|
||||||
|
echo "<H1>Bookmarks</H1>" >> "${script_dir}/bookmarks.html"
|
||||||
|
echo "<DL><p>" >> "${script_dir}/bookmarks.html"
|
||||||
|
echo "<DT><H3>Awesome Piracy</H3>" >> "${script_dir}/bookmarks.html"
|
||||||
|
echo "<DL><p>" >> "${script_dir}/bookmarks.html"
|
||||||
|
|
||||||
|
while read -r line; do
|
||||||
|
if [[ "$line" == *'##'* ]]; then
|
||||||
|
heading_text=$(echo $line | sed 's/\#//g')
|
||||||
|
html_text="</DL></p>
|
||||||
|
<DT><H3>${heading_text:1}</H3>
|
||||||
|
<DL><p>"
|
||||||
|
echo "$html_text" >> "${script_dir}/bookmarks.html"
|
||||||
|
elif [[ "$line" == *'['* ]]; then
|
||||||
|
item_name=$(echo "$line" | cut -d"]" -f1 | cut -d"[" -f2)
|
||||||
|
url="$(echo $line | cut -d")" -f1 | cut -d"(" -f2)"
|
||||||
|
html_text="<DT><A HREF=\"$url\">$item_name</A>"
|
||||||
|
echo "$html_text" >> "${script_dir}/bookmarks.html"
|
||||||
|
fi
|
||||||
|
done <<< "$lines"
|
||||||
|
|
||||||
|
echo "</DL></DL><p>" >> "${script_dir}/bookmarks.html"
|
||||||
|
sed -i '7d' "${script_dir}/bookmarks.html"
|
||||||
|
|
||||||
|
if [ -e "${script_dir}/readme-copy.html" ]; then
|
||||||
|
rm "${script_dir}/readme-copy.html"
|
||||||
|
fi
|
@ -4,6 +4,9 @@
|
|||||||
|
|
||||||
## Contents
|
## Contents
|
||||||
- [Preamble](#preamble)
|
- [Preamble](#preamble)
|
||||||
|
- [Mirrors](#mirrors)
|
||||||
|
- [How to use this list](#how-to-use-this-list)
|
||||||
|
- [Emoji](#emoji)
|
||||||
- [Background Information](#background-information)
|
- [Background Information](#background-information)
|
||||||
- [VPNs](#vpns)
|
- [VPNs](#vpns)
|
||||||
- [VPN Guides and Tutorials](#vpn-guides-and-tutorials)
|
- [VPN Guides and Tutorials](#vpn-guides-and-tutorials)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user