diff options
| author | Paul Buetow <paul@buetow.org> | 2025-01-19 09:11:29 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-01-19 09:11:29 +0200 |
| commit | 54e617e09027c8339a0f9096d61739ad353a5cf4 (patch) | |
| tree | 1bdfd260bc91d1b1f65acd14933f5aec3e9d2fb8 | |
| parent | f15224d720b8a3e29527ab913801503160fdaf8e (diff) | |
rename gemtexter enable back as it is gemtexter related
| -rw-r--r-- | README.md | 10 | ||||
| -rw-r--r-- | internal/config/args.go | 2 | ||||
| -rw-r--r-- | internal/main.go | 6 | ||||
| -rw-r--r-- | internal/summary/summary.go | 8 |
4 files changed, 16 insertions, 10 deletions
@@ -222,10 +222,16 @@ The key factors in message selection are: For my blog, I want to post a summary of all the social messages posted over the last couple of months. For an example, have a look here: https://foo.zone/gemfeed/2025-01-01-posts-from-october-to-december-2024.html. To accomplish this, run: ```sh -gos --summaryFor 202410,202411,202412 +gos --geminiSummaryFor 202410,202411,202412 ``` -This outputs the summary for the three months specified, as shown in the example. The summary contains posts from all social media networks but removes duplicates. +This outputs the summary for the three months specified, as shown in the example. The summary has posts from all social media networks but removes duplicates. + +Also add the `--gemtexterEnable` flag, if you are using [Gemtexter](https://codeberg.org/snonux/gemtexter): + +```sh +gos --gemtexterEnable --geminiSummaryFor 202410,202411,202412 +``` ## More options diff --git a/internal/config/args.go b/internal/config/args.go index e226058..77711b6 100644 --- a/internal/config/args.go +++ b/internal/config/args.go @@ -22,7 +22,7 @@ type Args struct { Secrets Secrets OAuth2Browser string GeminiSummaryFor []string - GeminiEnable bool + GemtexterEnable bool GeminiCapsule string ComposeEntry bool } diff --git a/internal/main.go b/internal/main.go index d3e079e..90ed197 100644 --- a/internal/main.go +++ b/internal/main.go @@ -15,6 +15,7 @@ import ( func Main(composeEntryDefault bool) { dry := flag.Bool("dry", false, "Dry run") version := flag.Bool("version", false, "Display version") + composeEntry := flag.Bool("compose", composeEntryDefault, "Compose a new entry") gosDir := flag.String("gosDir", filepath.Join(os.Getenv("HOME"), ".gosdir"), "Gos' queue and DB directory") cacheDir := flag.String("cacheDir", filepath.Join(*gosDir, "cache"), "Go's cache dir") browser := flag.String("browser", "firefox", "OAuth2 browser") @@ -27,9 +28,8 @@ func Main(composeEntryDefault bool) { pauseDays := flag.Int("pauseDays", 3, "How many days until next post can be posted?") lookback := flag.Int("lookback", 30, "How many days look back in time for posting history") geminiSummaryFor := flag.String("GeminiSummaryFor", "", "Generate a summary in Gemini Gemtext format, format is coma separated string of months, e.g. 202410,202411") - geminiEnable := flag.Bool("geminiEnable", true, "Add special Gemtexter tags to the Gemini summary") geminiCapsule := flag.String("geminiCapsule", "foo.zone", "Address of the Gemini capsule. Used by geminiEnable to detect internal links") - composeEntry := flag.Bool("compose", composeEntryDefault, "Compose a new entry") + gemtexterEnable := flag.Bool("gemtexterEnable", false, "Add special Gemtexter (the static site generator) tags to the Gemini Gemtext summary") flag.Parse() secrets, err := config.NewSecrets(secretsConfigPath) @@ -49,7 +49,7 @@ func Main(composeEntryDefault bool) { CacheDir: *cacheDir, Secrets: secrets, OAuth2Browser: *browser, - GeminiEnable: *geminiEnable, + GemtexterEnable: *gemtexterEnable, GeminiCapsule: *geminiCapsule, ComposeEntry: *composeEntry, } diff --git a/internal/summary/summary.go b/internal/summary/summary.go index 8b27f49..2cd88ac 100644 --- a/internal/summary/summary.go +++ b/internal/summary/summary.go @@ -24,7 +24,7 @@ func Run(ctx context.Context, args config.Args) error { }) title := fmt.Sprintf("Posts for %s", strings.Join(args.GeminiSummaryFor, " ")) - gemtext, err := fmt.Print(generateGemtext(entries, title, args.GeminiEnable)) + gemtext, err := fmt.Print(generateGemtext(args, entries, title)) if err != nil { return err } @@ -33,7 +33,7 @@ func Run(ctx context.Context, args config.Args) error { return nil } -func generateGemtext(entries []entry.Entry, title string, geminiEnable bool) (string, error) { +func generateGemtext(args config.Args, entries []entry.Entry, title string) (string, error) { var ( sb strings.Builder currentDateStr string @@ -41,7 +41,7 @@ func generateGemtext(entries []entry.Entry, title string, geminiEnable bool) (st sb.WriteString("# ") sb.WriteString(title) - if geminiEnable { + if args.GemtexterEnable { sb.WriteString("\n\n<< template::inline::toc") } @@ -77,7 +77,7 @@ func generateGemtext(entries []entry.Entry, title string, geminiEnable bool) (st } } - if geminiEnable { + if args.GemtexterEnable { sb.WriteString("\n\nOther related posts:") sb.WriteString("\n\n<< template::inline::index posts-from") sb.WriteString("\n\n") |
