From 1866dd507d0e36ef4cadef454424865358f435ca Mon Sep 17 00:00:00 2001 From: Louie S Date: Tue, 19 Sep 2023 15:16:16 -0400 Subject: NSIS docset --- src/Info.plist | 8 +++++--- src/icon.png | Bin 0 -> 1241 bytes src/icon@2x.png | Bin 0 -> 2754 bytes src/icon_orig.png | Bin 0 -> 2410 bytes src/index_sub_pages.sh | 25 +++++++++++++++++++++++++ src/lib/insert | 2 +- 6 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 src/icon.png create mode 100644 src/icon@2x.png create mode 100644 src/icon_orig.png create mode 100755 src/index_sub_pages.sh (limited to 'src') 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 @@ CFBundleIdentifier - + NSIS CFBundleName - + NSIS DocSetPlatformFamily - + nsis + dashIndexFilePath + Docs/Contents.html isDashDocset diff --git a/src/icon.png b/src/icon.png new file mode 100644 index 0000000..db5e987 Binary files /dev/null and b/src/icon.png differ diff --git a/src/icon@2x.png b/src/icon@2x.png new file mode 100644 index 0000000..c9288a3 Binary files /dev/null and b/src/icon@2x.png differ diff --git a/src/icon_orig.png b/src/icon_orig.png new file mode 100644 index 0000000..14ccc71 Binary files /dev/null and b/src/icon_orig.png differ 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 "
  • " "$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\");" } -- cgit