feat(config): configurable generated-section captions (P2)
TOC / links / tags section headings (and their levels) were hardcoded. Added per-wiki toc_header/toc_header_level, links_header/links_header_level, tags_header/tags_header_level — defaults Contents / Generated Links / Generated Tags at level 1, matching upstream (also fixes the tags index heading: Tags -> Generated Tags). A caption_line(name, level) helper emits the `=`-markers; the configured text + level thread through toc_edit / links_edit / tag_links_edit and the auto_toc save hook. find_section_range matches the configured text, so regeneration stays idempotent at any level. Tests: captions_honour_custom_header_and_level (link_health) + config round-trip + default assertions (index_and_config); existing tag/toc/links tests updated for the new arity and the Generated Tags default. fmt/clippy clean (8-arg ops get allow(too_many_arguments), matching the codebase precedent); 0 Rust test failures; config-parity green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -231,6 +231,9 @@ require('nuwiki').setup({
|
||||
css_name = 'style.css',
|
||||
auto_export = false, -- export on save
|
||||
auto_toc = false, -- auto-refresh TOC on save
|
||||
toc_header = 'Contents', -- :VimwikiTOC caption (+ toc_header_level = 1)
|
||||
links_header = 'Generated Links',
|
||||
tags_header = 'Generated Tags',
|
||||
exclude_files = {}, -- glob patterns
|
||||
-- Checkbox progression characters: " .oOX" by default.
|
||||
listsyms = ' .oOX',
|
||||
@@ -333,6 +336,9 @@ Each is a boolean. All default to `true` except `mouse`.
|
||||
| `list_margin` | int | `-1` | `-1` (auto) or `≥ 0` |
|
||||
| `links_space_char` | string | `' '` | char that replaces spaces in synthesised link paths |
|
||||
| `auto_toc` | bool | `false` | `true` \| `false` |
|
||||
| `toc_header` / `toc_header_level` | string / int | `'Contents'` / `1` | `:VimwikiTOC` caption + heading level |
|
||||
| `links_header` / `links_header_level` | string / int | `'Generated Links'` / `1` | `:VimwikiGenerateLinks` caption + level |
|
||||
| `tags_header` / `tags_header_level` | string / int | `'Generated Tags'` / `1` | `:VimwikiGenerateTagLinks` index caption + level |
|
||||
|
||||
#### HTML export keys (per-wiki)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user