all repos — bibel @ 63474ea3c260b3efb9d8af56effc2a24b2a3568f

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

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