summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2022-07-30 11:53:28 +0100
committerPaul Buetow <paul@buetow.org>2022-07-30 11:53:28 +0100
commita2e70af791382c5b90c04588ef1f767e433e4d08 (patch)
tree73e2387167d9ae9e4851117dbbad4692654e8588
parent4b1875a6d7e8c682e6ae6ebe46a81cf614db5b29 (diff)
add content filter option
-rw-r--r--README.md10
-rwxr-xr-xgemtexter8
2 files changed, 14 insertions, 4 deletions
diff --git a/README.md b/README.md
index 8fb184b..34a1675 100644
--- a/README.md
+++ b/README.md
@@ -100,3 +100,13 @@ Have also a look at the generated `atom.xml` files. They make sense (at least) f
If you use git, you can use `./gemtexter --publish`, which does a `--generate` followed by a `--git-add` and a `--git-sync`.
It is up to you to set up a Gemini server for the Gemtext, a Webserver for the HTML or a GitHub page for the Markdown format (or both).
+
+## Content filter
+
+Once your capsule reaches a certain size it can become anoying to re-generate everything if you only want to modify one single Gemtext file. The following will add a filter to only generate the files matching a regular expression:
+
+```
+./gemtexter --generate '.*hello.*'
+```
+
+This will help you to quickly review the results once in a while. Once you are happy you should always re-generate the whole capsule before publishing it!
diff --git a/gemtexter b/gemtexter
index e91f149..a2b3e11 100755
--- a/gemtexter
+++ b/gemtexter
@@ -4,6 +4,8 @@
# by Paul Buetow 2021, 2022
declare -r ARG="$1"; shift
+declare -r CONTENT_FILTER="$1"; shift
+
declare -r VERSION=1.1
declare -r VERSION_DESCR=prerelease
declare DATE=date
@@ -91,12 +93,10 @@ END
}
main () {
- local -r arg="$1"; shift
-
check_dependencies
setup
- case $arg in
+ case $ARG in
--test)
LOG_VERBOSE=yes
assert::shellcheck
@@ -140,5 +140,5 @@ main () {
return 0
}
-main "$ARG"
+main
exit $?