Skip to content

Commit 6a40046

Browse files
committed
Added a script to pre-process the reference pages for publishing
1 parent 5fa0c43 commit 6a40046

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

_reference/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/out/

_reference/gen.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/sh
2+
3+
set -eux
4+
5+
rm -fr out
6+
mkdir out
7+
find . -maxdepth 1 -type f ! -name '*.*' -exec cp {} out/ \;
8+
for i in out/*; do
9+
mv "$i" "$i".html
10+
vim '+1/<head' '+normal 0f<v' '+/End Wayback' '+normal $x' '+%s/\(['"'"'"]\)\/web\/[a-z0-9_]*\/\(https\?:\/\/\)/\1\2/g' '+%s/\(['"'"'"]\)https:\/\/web\.archive\.org\/web\/[a-z0-9_]*\/\(https\?:\/\/\)/\1\2/g' '+%s/http:\/\/\(www\.\)\?open-lldp\.org\/\([a-z_]\)/\2/g' +wq "$i".html
11+
vim '+1/^<\/html>/+1' '+normal dG' '+%s/css\.php[^"]*"/css.css"/g' '+%s/js\.php[^"]*"/js.js"/g' +wq "$i".html
12+
done

0 commit comments

Comments
 (0)