all repos — bibel @ 9696757c11be9708642553ccb78e5b88e4cb81cf

Unnamed repository; edit this file 'description' to name the repository.

cmd/bibel.go (view raw)

 1package main
 2
 3import (
 4	"fmt"
 5	"os"
 6	"time"
 7
 8	"maxwelljensen/bibel/internal"
 9)
10
11func main() {
12	// Load Bible data
13	biblePath := "books/pol_nbg.json"
14	bibleData, err := bible.LoadBible(biblePath)
15	if err != nil {
16		fmt.Fprintf(os.Stderr, "Error loading Bible data: %v\n", err)
17		os.Exit(1)
18	}
19
20	// Initialize date progression
21	dateProg := bible.NewDateProgression(bibleData)
22
23	// Get current date
24	currentDate := time.Now()
25	
26	// Calculate position for today
27	todayBookmark, err := dateProg.GetPositionForDate(currentDate)
28	if err != nil {
29		fmt.Fprintf(os.Stderr, "Error calculating date position: %v\n", err)
30		os.Exit(1)
31	}
32
33	// Initialize formatter
34	formatter := bible.NewFormatter()
35
36	// Print header and snippet
37	fmt.Println(formatter.FormatHeader(todayBookmark))
38	fmt.Println(formatter.ExtractAndFormat(bibleData, todayBookmark))
39}