From 005a022307e4e6c124b27568166198fa5a1902a1 Mon Sep 17 00:00:00 2001 From: Marty Sluijtman Date: Thu, 30 Nov 2023 15:46:01 +0100 Subject: [PATCH] Documentation --- src/bin/add-bookmark | 1 + src/completions/_add-bookmark | 8 ++++++++ src/manpages/add-bookmark.1.scd | 29 +++++++++++++++++++++++++++++ src/manpages/irs.1.scd | 6 +++++- 4 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 src/completions/_add-bookmark create mode 100644 src/manpages/add-bookmark.1.scd diff --git a/src/bin/add-bookmark b/src/bin/add-bookmark index 96eb9d2..c8723b1 100755 --- a/src/bin/add-bookmark +++ b/src/bin/add-bookmark @@ -19,6 +19,7 @@ addUrl(){ "$(curl -s "$url" | grep '\(.*\)<\/title>/\1/')" \ >> $bookmarks fi + printf "added '%s' to '%s'" "$url" "$bookmarks" } while getopts chu: flag; do diff --git a/src/completions/_add-bookmark b/src/completions/_add-bookmark new file mode 100644 index 0000000..f161441 --- /dev/null +++ b/src/completions/_add-bookmark @@ -0,0 +1,8 @@ +#compdef _add-bookmark add-bookmark + +_arguments : \ + "(-u -h)-c[take url from clipboard]" \ + "(-c -h)-u[url as argument]:bookmark url:" \ + "(-u -c)-h[print usage and exit]" +_arguments : $arguments + diff --git a/src/manpages/add-bookmark.1.scd b/src/manpages/add-bookmark.1.scd new file mode 100644 index 0000000..80ad297 --- /dev/null +++ b/src/manpages/add-bookmark.1.scd @@ -0,0 +1,29 @@ +add-bookmark(1) + +# NAME + +*add-bookmark* - adds a bookmark to *qutebrowser(1)* bookmarks file. + +# SYNOPSIS + +*copy-bookmark -u|h|c* + +# DESCRIPTION +*qutebrowser(1)* saves its bookmarks in +'*~/.config/qutebrowser/bookmarks/urls*'. +This is a script to be able to add bookmarks to that file without launching +qutebrowser. + +# OPTIONS + +*-u* + URL given as argument + +*-c* + URL read from clipboard + +*-h* + print usage and exit + +# SEE ALSO + *qutebrowser(1)*, *xclip(1)* diff --git a/src/manpages/irs.1.scd b/src/manpages/irs.1.scd index 9d025ca..dd5c0c1 100644 --- a/src/manpages/irs.1.scd +++ b/src/manpages/irs.1.scd @@ -27,6 +27,10 @@ both problems. Adds a bookmark to clipboard using *xclip(1)*, see its own manpage for more information +*add-bookmark* + Adds a bookmark to *qutebrowser(1)*'s list of bookmarks + # SEE ALSO -*open-bookmark(1)*, *xdg-open(1)*, *xclip(1)* +*open-bookmark(1)*, *copy-bookmark(1)*, *add-bookmark(1)*, *xdg-open(1)*, +*xclip(1)*