dev: exercise toc_header_level + html numbering in the dev launchers
The start-* dev harnesses generated a minimal server config (wiki_root, file_extension, syntax, log_level, diagnostic) with no display settings, so :NuwikiTOC always produced `= Contents =` (level 1) regardless of code changes — there was no way to test toc_header_level/html numbering through the harness. The coc launcher is worst: coc reads coc-settings.json verbatim, bypassing the Vim client's config translation entirely. Set toc_header_level=2, html_header_numbering=2, html_header_numbering_sym in all three launchers: - start-vim-coc.sh: into the generated coc-settings.json (init + settings). - start-vim.sh: as g:nuwiki_* globals (folded into the wiki via the global shorthand). - start-nvim.sh: in the setup() table. Now the dev wiki demonstrates the settings: :NuwikiTOC writes `== Contents ==` and HTML export numbers headings. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -64,6 +64,12 @@ vim.g.nuwiki_diary_rel_path = 'diary'
|
|||||||
|
|
||||||
require('nuwiki').setup({
|
require('nuwiki').setup({
|
||||||
wiki_root = '$WIKI_DIR',
|
wiki_root = '$WIKI_DIR',
|
||||||
|
-- Exercise the per-wiki display settings via the global shorthand: these
|
||||||
|
-- fold into the single wiki, so :NuwikiTOC writes `== Contents ==` (level 2)
|
||||||
|
-- and HTML export numbers headings.
|
||||||
|
toc_header_level = 2,
|
||||||
|
html_header_numbering = 2,
|
||||||
|
html_header_numbering_sym = ' -',
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Surface log lines (the LSP logs via window/logMessage). Without this
|
-- Surface log lines (the LSP logs via window/logMessage). Without this
|
||||||
|
|||||||
@@ -77,6 +77,10 @@ write_coc_settings() {
|
|||||||
# (served via workspace/configuration). Without these the server falls back
|
# (served via workspace/configuration). Without these the server falls back
|
||||||
# to its own default wiki_root (~/vimwiki) instead of $WIKI_DIR, so it can't
|
# to its own default wiki_root (~/vimwiki) instead of $WIKI_DIR, so it can't
|
||||||
# resolve links (e.g. Notes shows as broken) or create-on-follow correctly.
|
# resolve links (e.g. Notes shows as broken) or create-on-follow correctly.
|
||||||
|
# toc_header_level / html_header_numbering are set to non-defaults so the
|
||||||
|
# dev wiki exercises them: :NuwikiTOC writes `== Contents ==` (level 2) and
|
||||||
|
# HTML export numbers headings. coc reads this file verbatim, so these are
|
||||||
|
# the values the server actually receives.
|
||||||
cat > "$COC_SETTINGS" <<EOF
|
cat > "$COC_SETTINGS" <<EOF
|
||||||
{
|
{
|
||||||
"coc.preferences.jumpCommand": "$COC_JUMP",
|
"coc.preferences.jumpCommand": "$COC_JUMP",
|
||||||
@@ -89,6 +93,9 @@ write_coc_settings() {
|
|||||||
"file_extension": ".wiki",
|
"file_extension": ".wiki",
|
||||||
"syntax": "vimwiki",
|
"syntax": "vimwiki",
|
||||||
"log_level": "info",
|
"log_level": "info",
|
||||||
|
"toc_header_level": 2,
|
||||||
|
"html_header_numbering": 2,
|
||||||
|
"html_header_numbering_sym": " -",
|
||||||
"diagnostic": { "link_severity": "warn" }
|
"diagnostic": { "link_severity": "warn" }
|
||||||
},
|
},
|
||||||
"settings": {
|
"settings": {
|
||||||
@@ -97,6 +104,9 @@ write_coc_settings() {
|
|||||||
"file_extension": ".wiki",
|
"file_extension": ".wiki",
|
||||||
"syntax": "vimwiki",
|
"syntax": "vimwiki",
|
||||||
"log_level": "info",
|
"log_level": "info",
|
||||||
|
"toc_header_level": 2,
|
||||||
|
"html_header_numbering": 2,
|
||||||
|
"html_header_numbering_sym": " -",
|
||||||
"diagnostic": { "link_severity": "warn" }
|
"diagnostic": { "link_severity": "warn" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,6 +87,12 @@ let g:nuwiki_wiki_root = '${WIKI_DIR}'
|
|||||||
let g:nuwiki_file_extension = '.wiki'
|
let g:nuwiki_file_extension = '.wiki'
|
||||||
let g:nuwiki_syntax = 'vimwiki'
|
let g:nuwiki_syntax = 'vimwiki'
|
||||||
let g:nuwiki_log_level = 'info'
|
let g:nuwiki_log_level = 'info'
|
||||||
|
" Exercise the per-wiki display settings via the global shorthand: these fold
|
||||||
|
" into the single wiki, so :NuwikiTOC writes `== Contents ==` (level 2) and
|
||||||
|
" HTML export numbers headings.
|
||||||
|
let g:nuwiki_toc_header_level = 2
|
||||||
|
let g:nuwiki_html_header_numbering = 2
|
||||||
|
let g:nuwiki_html_header_numbering_sym = ' -'
|
||||||
|
|
||||||
filetype plugin indent on
|
filetype plugin indent on
|
||||||
syntax enable
|
syntax enable
|
||||||
|
|||||||
Reference in New Issue
Block a user