Implement artifact-level render command with Markdown output and update docs

This commit is contained in:
2026-05-24 22:55:56 +00:00
parent a90859114a
commit c37ea70dcb
28 changed files with 1619 additions and 99 deletions

39
internal/cli/render.go Normal file
View File

@@ -0,0 +1,39 @@
package cli
import (
"github.com/spf13/cobra"
"gitea.maximumdirect.net/eric/seriatim/internal/config"
"gitea.maximumdirect.net/eric/seriatim/internal/render"
)
func newRenderCommand() *cobra.Command {
opts := config.RenderOptions{
Title: config.DefaultRenderTitle,
IncludeTimestamps: true,
}
cmd := &cobra.Command{
Use: "render",
Short: "Render a seriatim transcript artifact into human-readable output",
RunE: func(cmd *cobra.Command, args []string) error {
cfg, err := config.NewRenderConfig(opts)
if err != nil {
return err
}
return render.Run(cmd.Context(), cfg)
},
}
flags := cmd.Flags()
flags.StringVar(&opts.InputFile, "input-file", "", "input seriatim transcript artifact JSON file")
flags.StringVar(&opts.OutputFile, "output-file", "", "rendered output file path")
flags.StringVar(&opts.Format, "format", "", "output format (markdown)")
flags.StringVar(&opts.Title, "title", config.DefaultRenderTitle, "document title")
flags.BoolVar(&opts.IncludeTimestamps, "include-timestamps", true, "include segment timestamps")
flags.BoolVar(&opts.IncludeSegmentIDs, "include-segment-ids", false, "include segment IDs")
flags.BoolVar(&opts.IncludeMetadata, "include-metadata", false, "include artifact metadata")
return cmd
}