added ability to modify root gophermap with "burrow root"

This commit is contained in:
James Tomasino 2018-07-15 20:02:15 -04:00
parent e81fa7d8bd
commit e3f15046b2
3 changed files with 38 additions and 8 deletions

View File

@ -49,6 +49,10 @@ by including a `.template` file in your recipe box directory.
`$EDITOR`. By default it will provide you a template, but you can override this `$EDITOR`. By default it will provide you a template, but you can override this
by including a `.template` file in your topics directory. by including a `.template` file in your topics directory.
- `root` will open your gopher hole's root gophermap for editing. This will
remove any `type i` formatting and allow comments to be added in natural text.
You will still need to create links in the proper gophermap formatting.
- `rss` will automatically generate an RSS feed of your most recent phlog - `rss` will automatically generate an RSS feed of your most recent phlog
entries and output it to the root of your gopher directory. This can be entries and output it to the root of your gopher directory. This can be
automatically generated by using the config option `config_phlog_autorss`. automatically generated by using the config option `config_phlog_autorss`.

35
burrow
View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
version="v1.5.4" version="v1.6.0"
configfiles="$HOME/.config/burrow/config $HOME/.config/burrow $HOME/.burrow" configfiles="$HOME/.config/burrow/config $HOME/.config/burrow $HOME/.burrow"
@ -48,6 +48,7 @@ arg_create_config=0
arg_edit_config=0 arg_edit_config=0
arg_update_git=0 arg_update_git=0
arg_rss=0 arg_rss=0
arg_root=0
# silence directory movements # silence directory movements
push_d () { push_d () {
@ -66,6 +67,7 @@ COMMANDS:
phlog Create new phlog entry phlog Create new phlog entry
recipe Add new recipe to box recipe Add new recipe to box
topic Add or update a topic topic Add or update a topic
root Edit your root gophermap
rss Generate an rss feed of recent phlog entries rss Generate an rss feed of recent phlog entries
create-config Create a default configuration file create-config Create a default configuration file
edit-config Edit your configuration file edit-config Edit your configuration file
@ -142,6 +144,7 @@ parse_input () {
"edit-config") arg_edit_config=1 ;; "edit-config") arg_edit_config=1 ;;
"update-git") arg_update_git=1 ;; "update-git") arg_update_git=1 ;;
"rss") arg_rss=1 ;; "rss") arg_rss=1 ;;
"root") arg_root=1 ;;
*) printf "Unknown command: %s\\n" "$arg";; *) printf "Unknown command: %s\\n" "$arg";;
esac esac
done done
@ -405,8 +408,13 @@ make_post_paths () {
post_dir="${config_dir_gopher}${post_type}/$(date +%Y%m%d)-$title_slug" post_dir="${config_dir_gopher}${post_type}/$(date +%Y%m%d)-$title_slug"
post_path="${config_gopher_root}${post_type}/$(date +%Y%m%d)-$title_slug" post_path="${config_gopher_root}${post_type}/$(date +%Y%m%d)-$title_slug"
else else
post_dir="${config_dir_gopher}${post_type}/$title_slug" if [ -z "title_slug" ]; then
post_path="${config_gopher_root}${post_type}/$title_slug" post_dir="${config_dir_gopher}${post_type}"
post_path="${config_gopher_root}${post_type}"
else
post_dir="${config_dir_gopher}${post_type}/$title_slug"
post_path="${config_gopher_root}${post_type}/$title_slug"
fi
fi fi
post_file="${post_dir}/gophermap" post_file="${post_dir}/gophermap"
post_file_path="${post_path}" post_file_path="${post_path}"
@ -437,10 +445,14 @@ make_post () {
mkdir -p "${config_dir_gopher}${post_type}" mkdir -p "${config_dir_gopher}${post_type}"
fi fi
printf "%s" "$query" if [ ! -z "$query" ]; then
read -r title printf "%s" "$query"
if [ -z "$title" ]; then read -r title
die "Cancelled." 0 if [ -z "$title" ]; then
die "Cancelled." 0
fi
else
title=""
fi fi
make_post_paths make_post_paths
@ -620,6 +632,15 @@ main () {
update_git update_git
fi fi
if [ $arg_root -gt 0 ]; then
make_post "" \
"" \
true \
false \
true \
false
fi
if [ $arg_recipe -gt 0 ]; then if [ $arg_recipe -gt 0 ]; then
make_post "What is the name of your recipe? " \ make_post "What is the name of your recipe? " \
"$config_dir_recipebox" \ "$config_dir_recipebox" \

View File

@ -1,4 +1,4 @@
.TH BURROW 1 "15 Jul 2018" "version 1.5.4" .TH BURROW 1 "15 Jul 2018" "version 1.6.0"
.SH NAME .SH NAME
burrow \- a helper for building and managing a gopher hole burrow \- a helper for building and managing a gopher hole
.SH SYNOPSIS .SH SYNOPSIS
@ -29,6 +29,11 @@ by including a
.I .template .I .template
file in your topics directory. file in your topics directory.
.TP .TP
.B root
Open your gopher hole's root gophermap for editing. This will remove any
type 'i' formatting and allow comments to be added in natural text. You will
still need to create links in the proper gophermap formatting.
.TP
.B rss .B rss
Automatically generate an RSS feed of your most recent phlog Automatically generate an RSS feed of your most recent phlog
entries and output it to the root of your gopher directory. This can be entries and output it to the root of your gopher directory. This can be