From a2e70af791382c5b90c04588ef1f767e433e4d08 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 30 Jul 2022 11:53:28 +0100 Subject: add content filter option --- README.md | 10 ++++++++++ gemtexter | 8 ++++---- 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 $? -- cgit v1.2.3