diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Info.plist | 8 | ||||
-rw-r--r-- | src/icon.png | bin | 0 -> 1241 bytes | |||
-rw-r--r-- | src/icon@2x.png | bin | 0 -> 2754 bytes | |||
-rw-r--r-- | src/icon_orig.png | bin | 0 -> 2410 bytes | |||
-rwxr-xr-x | src/index_sub_pages.sh | 25 | ||||
-rw-r--r-- | src/lib/insert | 2 |
6 files changed, 31 insertions, 4 deletions
diff --git a/src/Info.plist b/src/Info.plist index 111baae..4b831c3 100644 --- a/src/Info.plist +++ b/src/Info.plist @@ -3,11 +3,13 @@ <plist version="1.0"> <dict> <key>CFBundleIdentifier</key> - <string><!-- VALUE --></string> + <string>NSIS</string> <key>CFBundleName</key> - <string><!-- VALUE --></string> + <string>NSIS</string> <key>DocSetPlatformFamily</key> - <string><!-- VALUE --></string> + <string>nsis</string> + <key>dashIndexFilePath</key> + <string>Docs/Contents.html</string> <key>isDashDocset</key> <true/> </dict> diff --git a/src/icon.png b/src/icon.png Binary files differnew file mode 100644 index 0000000..db5e987 --- /dev/null +++ b/src/icon.png diff --git a/src/icon@2x.png b/src/icon@2x.png Binary files differnew file mode 100644 index 0000000..c9288a3 --- /dev/null +++ b/src/icon@2x.png diff --git a/src/icon_orig.png b/src/icon_orig.png Binary files differnew file mode 100644 index 0000000..14ccc71 --- /dev/null +++ b/src/icon_orig.png diff --git a/src/index_sub_pages.sh b/src/index_sub_pages.sh new file mode 100755 index 0000000..9a3c8c3 --- /dev/null +++ b/src/index_sub_pages.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env sh + +# shellcheck source=./lib/create_table +. "$(dirname "$0")"/lib/create_table +# shellcheck source=./lib/insert +. "$(dirname "$0")"/lib/insert + +DB_PATH="$1" +shift +CONTENTS="$1" +shift + +insert_sub_page() { + LINK="$1" + NAME="$(echo "$LINK" | pup -p 'a text{}' | sed 's/\"\"//g' | tr -d \\n)" + PAGE_PATH="$(echo "$LINK" | pup -p 'a attr{href}')" + + insert "$DB_PATH" "$NAME" "Guide" "$PAGE_PATH" +} + +create_table "$DB_PATH" + +grep -Eo "<li><a href.*</a></li>" "$CONTENTS" | while read -r line; do + insert_sub_page "$line" +done diff --git a/src/lib/insert b/src/lib/insert index 31c1b4c..8100c1e 100644 --- a/src/lib/insert +++ b/src/lib/insert @@ -4,5 +4,5 @@ insert() { TYPE="$3" PAGE_PATH="$4" - sqlite3 "$DB_PATH" "INSERT INTO searchIndex(name, type, path) VALUES (\"$NAME\",\"$TYPE\",\"$PAGE_PATH\");" + sqlite3 "$DB_PATH" "INSERT INTO searchIndex(name, type, path) VALUES (\"$NAME\",\"$TYPE\",\"Docs/$PAGE_PATH\");" } |