CHANGELOG.md (view raw)
1# Changelog
2
3All notable changes to this project will be documented in this file.
4
5The format is based on [Keep a
6Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to
7[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
8
9## [Unreleased]
10
11## [0.10.0] - 2026-04-18
12
13### Changed
14
15- **ANSI colour**: Changed from hex colour codes to ANSI terminal colours
16- Removed light/dark mode detection and adaptive colour logic
17- Changed "Adaptive Styling" to "ANSI Colours" in `README`
18
19### Removed
20
21- Removed `border_colour`, `header_colour`, `text_colour`, `quit_colour` from
22TOML configuration
23- `HasDarkBackground()` check and `lightDark()` helper function
24- All `#RRGGBB` colour codes (replaced with ANSI codes)
25
26## [0.9.0] - 2026-04-17
27
28### Added
29
30- **Easter progress bar**: Fancy progress bar at bottom of TUI showing time
31until Easter, which is configurable; Orthodox (default) or Roman Catholic.
32Shows days/hours/minutes until next Easter with percentage progress.
33- New `-l/--latin` flag to use Roman Catholic Easter instead of Eastern
34Orthodox.
35- Added vendored `eastertime` package with accurate Orthodox and Roman Catholic
36algorithms for telling Easter time.
37- **Configuration option**: `easter_type` configuration field in TOML (default:
38"orthodox")
39
40## [0.8.0] - 2026-04-17
41
42### Added
43
44- **Verse numbering option**: New `-n/--numbered` flag prints each verse on a
45numbered line with verse number
46- **Paragraph handling option**: New `-g/--paragraphs` flag renders pilcrows
47(¶) as blank lines instead of ignoring them
48- **TUI numbered styling**: Verse numbers use darker shade styling via
49`lipgloss` for better readability
50- **Configuration integration**: Both options configurable via TOML file in
51`[formatter]` section (`numbered` and `paragraphs` fields)
52
53### Changed
54
55- **Formatter system enhanced**: New `FormatSnippetWithOptions()` and
56`FormatSnippetForTUI()` methods for advanced formatting
57- **TUI width handling**: Improved width calculations for numbered verses to
58prevent text clipping
59- **Paragraph logic refined**: Fixed newline handling to only insert blank
60lines for pilcrows, not between all verses
61- **Phased out short flag**: `--generate-config` no longer has the `-g` short
62flag. This is now under `--paragraphs`.
63
64## [0.7.0] - 2026-04-17
65
66### Added
67
68- **XDG data directory support**: Automatic Bible file discovery in
69`$XDG_DATA_HOME/bibel`
70 - When `bible_path` is empty in configuration, program searches
71 `$XDG_DATA_HOME/bibel` for JSON files
72 - Uses first `.json` file found in the directory. Provides helpful error
73 messages when directory or Bible files are missing.
74- **Cross-platform Bible data management**: Leverages `xdg` library for
75consistent data directory paths across platforms
76
77### Changed
78
79- **Default configuration**: `bible_path` now defaults to empty string (uses
80XDG-stadnard data directory)
81- **Example configuration**: Updated `config.example.toml` with documentation
82about XDG data directory usage
83- **Error handling**: Improved error messages for missing Bible data files
84
85### Fixed
86
87- **Configuration generation**: `--generate-config` flag creates config with
88empty `bible_path` for XDG compatibility
89- **Edge case handling**: Prevent crashes when Bible file doesn't contain books
90for selected reading mode
91- **Date progression robustness**: Added check for zero total verses to prevent
92divide-by-zero panics
93
94## [0.6.0] - 2026-04-17
95
96### Added
97
98- **Multiple reading modes** via new `-r/--reading` command line option:
99 - `evangelion` (default): Gospels only (Matthew, Mark, Luke, John)
100 - `new_testament`: Entire New Testament (books 40-66)
101 - `old_testament`: Old Testament only (books 1-39)
102 - `bible`: The entire Bible (books 1-66)
103- **Flexible Bible source support**: Can now work with any Bible translation
104 - Removed hardcoded Polish book names
105 - Reads `book_name` field directly from JSON data
106
107### Changed
108
109- **Date progression system enhanced**:
110 - `NewDateProgressionWithReadingMode()` accepts reading mode parameter
111 - Calculates verse positions based on selected reading scope
112 - Proper wrapping at boundaries of each reading mode
113- **Formatter now requires Bible reference**:
114 - `NewFormatterWithConfig()` now accepts `*Bible` parameter
115 - Formatter retrieves book names dynamically from loaded Bible data
116 - Updated all formatter initialization calls in codebase
117- **Book name handling refactored**:
118 - Removed `polishBookNames` map from `verse.go`
119 - `BookIndex.String()` returns numeric fallback representation
120 - Actual book names sourced from Bible JSON metadata
121- **Configuration system enhanced**:
122 - Added `reading_mode` configuration option with validation
123 - Command line `-r/--reading` overrides config setting
124 - Improved default value handling for empty configuration fields
125
126### Fixed
127
128- **Configuration validation**: Allow empty reading mode during initial load
129- **Build errors**: Fixed Go compilation issues in configuration unmarshalling
130- **Backward compatibility**: Maintains existing behavior for default mode
131
132## [0.5.0] - 2026-04-17
133
134### Added
135
136- **TOML configuration file** system with XDG Base Directory Specification
137compliance
138 - Configuration file location: `$XDG_CONFIG_HOME/bibel/config.toml` (default:
139 `~/.config/bibel/config.toml`). macOS and Windows also supported.
140 - Uses `xdg` for XDG compliance and `viper` for configuration management
141- **Configuration generation**: `--generate-config` flag creates default
142configuration file
143- **Comprehensive TUI aesthetic configuration**:
144 - `border_style`: "rounded", "double", "single", or "hidden"
145 - `border_colour`: Custom hex colour for box borders
146 - `header_colour`: Custom hex colour for header text
147 - `text_colour`: Custom hex colour for verse content
148 - `quit_colour`: Custom hex colour for quit message
149 - `show_quit_message`: Boolean to show/hide "Press q to quit..." message
150- **Formatter configuration**:
151 - `header_format`: Customisable header template with variables: `{book}`,
152 `{chapter}`, `{first_verse}`, `{second_verse}`
153 - `use_colours`: Enable/disable ANSI colour output in formatted mode
154- **Date progression configuration**:
155 - `verses_per_day`: Customisable number of verses per day (default: 12)
156- **Command-line override**: CLI flags (`--plain`, `--formatted`) override
157configuration settings
158- **Configuration validation**: Ensures valid output modes, border styles, and
159positive verse counts
160
161### Changed
162
163- **Formatter behaviour**: `FormatHeader()` now reads `header_format` from
164configuration instead of hardcoded format
165- **TUI styling**: All aesthetic properties (colours, border style) now
166configurable via TOML file
167- **Date progression**: `NewDateProgressionWithConfig()` accepts custom
168`verses_per_day` parameter
169- **Application flow**: Configuration loaded before processing, with
170command-line arguments taking precedence
171- **Package structure**: Added `internal/config.go` for configuration
172management
173
174## [0.4.0] - 2026-04-16
175
176### Added
177
178- **TUI framework** using `bubbletea` for interactive terminal user interface
179- **Styled output** with `lipgloss` for terminal-adaptive colours and borders
180- **Interactive mode**: Verse displayed in a rounded border box with "Press q
181to quit..." message
182- **Smart TTY detection**: Automatically falls back to formatted output in
183non-interactive environments
184- **Enhanced argument handling**: `-p/--plain` now outputs plain text without
185TUI or formatting
186- **New package structure**: `internal/tui/` containing TUI model and styling
187components
188
189### Changed
190
191- **Program flow**: Default mode now launches interactive TUI when run in a
192terminal
193- **Plain mode behaviour**: `--plain` flag now outputs only verse text (no
194header or TUI)
195- **Terminal detection**: Non-TTY environments show formatted output with ANSI
196colours
197- **Dependencies**: Added `bubbletea` and `lipgloss` for TUI functionality
198
199## [0.3.0] - 2026-04-16
200
201### Added
202
203- Argument parsing using `go-arg` library
204- `-p/--plain` flag to output plain text without chapter name or verse numbers
205- Program description and help text
206
207## [0.2.0] - 2026-04-16
208
209### Added
210
211- Complete Go migration from original OCaml implementation
212- Date-based Bible verse progression system
213 - Calculates position based on day of year (1st January = Matthew 1:1-12)
214 - Shows 12 verses per day, cycling through all four Gospels yearly
215- ANSI color-coded output (green for book/chapter, yellow for verse range)
216- Smart lookahead rule: extends to end of chapter if less than 12 verses remain
217- Support for Polish "Nowa Biblia Gdańska" translation (`books/pol_nbg.json``)
218- Complete test suite with edge case validation
219- `README`` documentation with usage examples and algorithm explanation
220
221### Changed
222
223- **BREAKING**: Changed from bookmark-based progression to date-based progression
224 - Previous versions used `bookmark.toml` to track reading position, new
225 version calculates position from current date
226- Restructured codebase with modular Go packages:
227 - `internal/loader.go`: JSON Bible data loading and indexing
228 - `internal/dateprogression.go`: Date-to-verse position calculation
229 - `internal/formatter.go`: ANSI color formatting and text extraction
230 - `internal/verse.go`: Data structures and constants
231 - `internal/bookmark.go`: Legacy bookmark support (unused in date-based mode)
232
233### Fixed
234
235- Proper handling of chapter and book boundaries
236- Correct modulo wrapping for yearly cycle (total 3779 Gospel verses)
237- Leap year support via Go's standard `time.YearDay()` function
238- Validation of verse ranges and error handling
239
240### Removed
241
242- OCaml implementation
243- Dependency on `bookmark.toml` file for progression
244- Regex-based verse parsing (replaced with JSON Bible data)
245
246## [0.1.0] - 2026-04-16
247
248### Added
249
250- Initial Go port of OCaml Bible verse utility
251- Bookmark-based progression system (TOML file)
252- Support for Polish "Nowa Biblia Gdańska" translation
253- Basic ANSI color formatting
254- Lookahead rule implementation
255
256### Changed
257
258- Rewritten from OCaml to Go programming language
259- Changed data format from custom to JSON
260- Improved error handling and validation