From 4526c8a171dbe40762c116e5b8a404f20131d2b1 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 7 Jul 2025 23:25:10 +0300 Subject: feat: add comprehensive showcase generation with metadata and images MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add --showcase flag to generate project showcases using Claude - Extract repository metadata (languages, commits, LOC, dates, license) - Support image extraction from README files (local and remote) - Add caching with --force flag to regenerate - Add exclude_from_showcase config option - Add standalone showcase mode (--showcase without sync) - Sort projects by recent activity (avg age of last 100 commits) - Output in Gemini Gemtext template format (.gmi.tpl) - Fix backup location fetching when --backup flag not set 🤖 Generated with Claude Code Co-Authored-By: Claude --- internal/cli/showcase_handler.go | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 internal/cli/showcase_handler.go (limited to 'internal/cli/showcase_handler.go') diff --git a/internal/cli/showcase_handler.go b/internal/cli/showcase_handler.go new file mode 100644 index 0000000..a3dfd26 --- /dev/null +++ b/internal/cli/showcase_handler.go @@ -0,0 +1,35 @@ +package cli + +import ( + "fmt" + "log" + + "codeberg.org/snonux/gitsyncer/internal/config" + "codeberg.org/snonux/gitsyncer/internal/showcase" +) + +// HandleShowcase handles the showcase generation after syncing +func HandleShowcase(cfg *config.Config, flags *Flags) int { + // Determine which repositories to process + var repoFilter []string + if flags.SyncRepo != "" { + // Only process the specific repository that was synced + repoFilter = []string{flags.SyncRepo} + fmt.Printf("\nGenerating showcase for %s...\n", flags.SyncRepo) + } else { + // Process all repositories for --sync-all or public sync operations + fmt.Println("\nGenerating project showcase for all repositories...") + } + + // Create showcase generator + generator := showcase.New(cfg, flags.WorkDir) + + // Generate showcase with optional filter + if err := generator.GenerateShowcase(repoFilter, flags.Force); err != nil { + log.Printf("ERROR: Failed to generate showcase: %v\n", err) + return 1 + } + + fmt.Println("Showcase generated successfully!") + return 0 +} \ No newline at end of file -- cgit v1.2.3