Rename to shatom

This commit is contained in:
Case Duckworth 2021-02-06 14:04:44 -06:00
parent 29ef191b1b
commit 49f6fc03a4
2 changed files with 20 additions and 20 deletions

View File

@ -1,9 +1,9 @@
# gemshimfeed
# shatom
## an Atom feed generator in (mostly) POSIX shell
Because of [this post in the Gemini mailing list](https://lists.orbitalfox.eu/archives/gemini/2020/003407.html),
which bemoans the inability to generate Atom feeds using bare-bones computers,
I present `gemshimfeed`, a shell program that purports to do just that.
I present `shatom`, a shell program that purports to do just that.
It has minimal dependencies (see DEPENDENCIES, below),
and is completely modifiable by the user with the config file
@ -25,12 +25,12 @@ you're writing another script.
## CONFIG
All of the functions and variables defined in `gemshimfeed`
All of the functions and variables defined in `shatom`
can be overwritten by a config file, by default
`gemshimfeed.conf.sh` in the current directory.
`shatom.conf.sh` in the current directory.
As may be obvious from the file's extension, it's a shell script,
so you can redefine (and in fact, *should* redefine)
all the variables and functions in `gemshimfeed` to suit your needs.
all the variables and functions in `shatom` to suit your needs.
Here's a convenient list:

View File

@ -8,12 +8,12 @@ usage() {
cat <<END
$0: generate an Atom feed from directories of files
INVOCATION:
$0 [-h] [-c CONFIG] DIRECTORY...
$0 [-h] [-c CONFIG] DIRECTORY...
OPTIONS:
-h show this help
-c CONFIG change the CONFIG file.
Default: $PWD/gemshimfeed.conf.sh
-h show this help
-c CONFIG change the CONFIG file.
Default: $PWD/$0.conf.sh
END
}
@ -57,12 +57,12 @@ entry_url() {
}
entry_title() {
awk '/^#+[ ]\S/{
for(i=2;i<=NF;i++) {
printf $i;
if (i!=NF) printf " ";
}
printf "\n";exit}' "$1"
awk '/^#+[ ]\S/{
for(i=2;i<=NF;i++) {
printf $i;
if (i!=NF) printf " ";
}
printf "\n";exit}' "$1"
}
entry_summary() {
@ -83,9 +83,9 @@ entry_updated() {
# possibly using ls(1).
stat -c '%y' "$1" |
awk '{
sub(/\..*/,"",$2);
sub(/[0-9][0-9]/,"&:",$3);
print $1"T"$2$3;}'
sub(/\..*/,"",$2);
sub(/[0-9][0-9]/,"&:",$3);
print $1"T"$2$3;}'
}
# ATOM FUNCTIONS
@ -99,7 +99,7 @@ atom_header() {
<link href="$FEED_URL" rel="self" />
<link href="$SITE_URL" />
<id>$FEED_ID</id>
<generator uri="https://git.sr.ht/~acdw/gemshimfeed" version="infinite">GemShimFeed</generator>
<generator uri="https://git.sr.ht/~acdw/shatom" version="infinite">shatom</generator>
<rights>$FEED_COPYRIGHT</rights>
<updated>$FEED_UPDATED</updated>
END
@ -132,7 +132,7 @@ END
}
main() {
CONFIGFILE="$PWD/gemshimfeed.conf.sh"
CONFIGFILE="$PWD/$0.conf.sh"
case "$1" in
-h)
usage