about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2021-02-06 14:04:44 -0600
committerCase Duckworth2021-02-06 14:04:44 -0600
commit49f6fc03a42e7b875f691f7476e956923f731a62 (patch)
tree3db6cdb8536806664eed8ac93eb60b87bbf81a16
parentAdd README (diff)
downloadshatom-49f6fc03a42e7b875f691f7476e956923f731a62.tar.gz
shatom-49f6fc03a42e7b875f691f7476e956923f731a62.zip
Rename to shatom
-rw-r--r--README.md10
-rwxr-xr-xshatom (renamed from gemshimfeed)30
2 files changed, 20 insertions, 20 deletions
diff --git a/README.md b/README.md index c2c1bc6..92ab758 100644 --- a/README.md +++ b/README.md
@@ -1,9 +1,9 @@
1# gemshimfeed 1# shatom
2## an Atom feed generator in (mostly) POSIX shell 2## an Atom feed generator in (mostly) POSIX shell
3 3
4Because of [this post in the Gemini mailing list](https://lists.orbitalfox.eu/archives/gemini/2020/003407.html), 4Because of [this post in the Gemini mailing list](https://lists.orbitalfox.eu/archives/gemini/2020/003407.html),
5which bemoans the inability to generate Atom feeds using bare-bones computers, 5which bemoans the inability to generate Atom feeds using bare-bones computers,
6I present `gemshimfeed`, a shell program that purports to do just that. 6I present `shatom`, a shell program that purports to do just that.
7 7
8It has minimal dependencies (see DEPENDENCIES, below), 8It has minimal dependencies (see DEPENDENCIES, below),
9and is completely modifiable by the user with the config file 9and is completely modifiable by the user with the config file
@@ -25,12 +25,12 @@ you're writing another script.
25 25
26## CONFIG 26## CONFIG
27 27
28All of the functions and variables defined in `gemshimfeed` 28All of the functions and variables defined in `shatom`
29can be overwritten by a config file, by default 29can be overwritten by a config file, by default
30`gemshimfeed.conf.sh` in the current directory. 30`shatom.conf.sh` in the current directory.
31As may be obvious from the file's extension, it's a shell script, 31As may be obvious from the file's extension, it's a shell script,
32so you can redefine (and in fact, *should* redefine) 32so you can redefine (and in fact, *should* redefine)
33all the variables and functions in `gemshimfeed` to suit your needs. 33all the variables and functions in `shatom` to suit your needs.
34 34
35Here's a convenient list: 35Here's a convenient list:
36 36
diff --git a/gemshimfeed b/shatom index 3025182..48b99ff 100755 --- a/gemshimfeed +++ b/shatom
@@ -8,12 +8,12 @@ usage() {
8 cat <<END 8 cat <<END
9$0: generate an Atom feed from directories of files 9$0: generate an Atom feed from directories of files
10INVOCATION: 10INVOCATION:
11 $0 [-h] [-c CONFIG] DIRECTORY... 11 $0 [-h] [-c CONFIG] DIRECTORY...
12 12
13OPTIONS: 13OPTIONS:
14 -h show this help 14 -h show this help
15 -c CONFIG change the CONFIG file. 15 -c CONFIG change the CONFIG file.
16 Default: $PWD/gemshimfeed.conf.sh 16 Default: $PWD/$0.conf.sh
17END 17END
18} 18}
19 19
@@ -57,12 +57,12 @@ entry_url() {
57} 57}
58 58
59entry_title() { 59entry_title() {
60 awk '/^#+[ ]\S/{ 60 awk '/^#+[ ]\S/{
61 for(i=2;i<=NF;i++) { 61 for(i=2;i<=NF;i++) {
62 printf $i; 62 printf $i;
63 if (i!=NF) printf " "; 63 if (i!=NF) printf " ";
64 } 64 }
65 printf "\n";exit}' "$1" 65 printf "\n";exit}' "$1"
66} 66}
67 67
68entry_summary() { 68entry_summary() {
@@ -83,9 +83,9 @@ entry_updated() {
83 # possibly using ls(1). 83 # possibly using ls(1).
84 stat -c '%y' "$1" | 84 stat -c '%y' "$1" |
85 awk '{ 85 awk '{
86 sub(/\..*/,"",$2); 86 sub(/\..*/,"",$2);
87 sub(/[0-9][0-9]/,"&:",$3); 87 sub(/[0-9][0-9]/,"&:",$3);
88 print $1"T"$2$3;}' 88 print $1"T"$2$3;}'
89} 89}
90 90
91# ATOM FUNCTIONS 91# ATOM FUNCTIONS
@@ -99,7 +99,7 @@ atom_header() {
99<link href="$FEED_URL" rel="self" /> 99<link href="$FEED_URL" rel="self" />
100<link href="$SITE_URL" /> 100<link href="$SITE_URL" />
101<id>$FEED_ID</id> 101<id>$FEED_ID</id>
102<generator uri="https://git.sr.ht/~acdw/gemshimfeed" version="infinite">GemShimFeed</generator> 102<generator uri="https://git.sr.ht/~acdw/shatom" version="infinite">shatom</generator>
103<rights>$FEED_COPYRIGHT</rights> 103<rights>$FEED_COPYRIGHT</rights>
104<updated>$FEED_UPDATED</updated> 104<updated>$FEED_UPDATED</updated>
105END 105END
@@ -132,7 +132,7 @@ END
132} 132}
133 133
134main() { 134main() {
135 CONFIGFILE="$PWD/gemshimfeed.conf.sh" 135 CONFIGFILE="$PWD/$0.conf.sh"
136 case "$1" in 136 case "$1" in
137 -h) 137 -h)
138 usage 138 usage