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