Skip to content

Commit b5e1299

Browse files
committed
Improve documentation.
1 parent d99596d commit b5e1299

File tree

5 files changed

+53
-13
lines changed

5 files changed

+53
-13
lines changed

_scripts/mini_nvim.lua

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,33 @@ local add_help_syntax = function(lines, tags)
190190
reflow(lines)
191191
end
192192

193+
local adjust_toc = function(lines)
194+
-- Transform Table Of Contents (entries like "aaa .... bbb ... ccc") into
195+
-- a markdown table with each part as a separate column.
196+
for i, l in iter_noncode(lines) do
197+
local is_toc_line = l:find('%s+%.%.%.+%s+') ~= nil
198+
if is_toc_line then
199+
-- Allow more than one column
200+
local line, n_repl = vim.trim(l):gsub('%s+%.%.%.+%s+', ' | ')
201+
lines[i] = '| ' .. line .. ' |'
202+
local n_col = n_repl + 1
203+
204+
-- Prepend first TOC item with a (possibly crudely detected) header
205+
local header_parts = vim.split(vim.trim(lines[i - 1]), ' +')
206+
local is_blank_prev_line = header_parts[1] == '' and header_parts[2] == nil
207+
if is_blank_prev_line or #header_parts == n_col then
208+
header_parts = is_blank_prev_line and vim.fn['repeat']({ '' }, n_col) or header_parts
209+
local header = '| ' .. table.concat(header_parts, ' | ') .. ' |'
210+
-- Assume right most column is a link, so right align it.
211+
local separator = string.rep('|---', n_col) .. ':|'
212+
lines[i - 1] = '\n' .. header .. '\n' .. separator
213+
end
214+
end
215+
end
216+
217+
reflow(lines)
218+
end
219+
193220
local adjust_alignment = function(lines)
194221
for i, l in iter_noncode(lines) do
195222
-- Transform center aligned signature or section "name"
@@ -256,19 +283,24 @@ local create_help = function()
256283
for file, _ in vim.fs.dir(help_path) do
257284
local basename = file:match('^(.+)%.txt$')
258285
if basename ~= nil then
259-
local lines = vim.fn.readfile(vim.fs.joinpath(help_path, file))
286+
local in_path = vim.fs.joinpath(help_path, file)
287+
local lines = vim.fn.readfile(in_path)
260288

261289
make_codeblocks(lines)
262290
adjust_rulers(lines)
263291
add_empty_lines(lines)
264292
add_help_syntax(lines, help_tags)
293+
adjust_toc(lines)
265294
adjust_alignment(lines)
266295
add_hierarchical_heading_anchors(lines)
267296
add_source_note(lines)
268297
adjust_header_footer(lines, basename:gsub('%-', '.') .. ' documentation')
269298

270299
local out_path = string.format('%s/%s.qmd', help_path, basename)
271300
vim.fn.writefile(lines, out_path)
301+
302+
-- Remove '*.txt' file, as it is not needed for the site
303+
vim.fn.delete(in_path, '')
272304
end
273305
end
274306
end

blog/2025-03-07-update-mini-completion-snippet-support.qmd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ The ['mini.completion'](https://github.com/nvim-mini/mini.nvim/blob/main/readmes
1515
The main improvement is (finally) added snippet support. That is, 'mini.completion' now can properly insert snippet completion entries. The main attention has gone into making it work with enabled ['mini.snippets'](https://github.com/nvim-mini/mini.nvim/blob/main/readmes/mini-snippets.md) module, but there is automated fallback to `vim.snippet` (on Neovim>=0.10).
1616

1717
Other updates include:
18+
1819
- Default mappings for scrolling down/up in both info/signature windows. Those are `<C-f>` and `<C-b>`, but can be configured (be careful with `<C-d>` and `<C-u>`, as they have special meaning during active built-in completion popup).
1920
- Significantly better highlighting in info/signature windows.
2021
- Support for `isIncomplete`, which means there will be automated update of completion list on the next key press if initial response from LSP server did not contain all possible items.

index.qmd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
- <p style="font-size:1.5em"><b><a href="mini.nvim/index.html">mini.nvim</a></b></p>
2020
- [Modules](mini.nvim/index.md#modules)
21+
- [Documentation](mini.nvim/doc/mini-nvim.qmd)
2122
- [Change log](mini.nvim/CHANGELOG.md)
2223

2324
- <p style="font-size:1.5em"><b><a href="blog.html">Blog</a></b></p>

theme/brand-dark.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ typography:
4949
monospace:
5050
family: monospace
5151
monospace-inline:
52-
color: grey
52+
color: cyan
5353
background-color: bg-2
5454
link:
55-
color: cyan
55+
color: fg-2
5656
decoration: underline
5757

5858
defaults:
@@ -66,10 +66,13 @@ defaults:
6666
margin-top: 0em;
6767
margin-bottom: 0.5em;
6868
}
69-
h2, h3, h4 {
70-
margin-top: 1em;
71-
margin-bottom: 0.25em;
72-
}
69+
h1 { font-size: 2em }
70+
h2 { font-size: 1.8em; margin-top: 1em; margin-bottom: 0.25em; }
71+
h3 { font-size: 1.6em; margin-top: 1em; margin-bottom: 0.25em; }
72+
h4 { font-size: 1.4em; margin-top: 1em; margin-bottom: 0.25em; font-weight: normal }
73+
h5 { font-size: 1.2em; font-weight: normal }
74+
h6 { font-size: 1em; font-weight: normal }
75+
7376
p pre code:not(.sourceCode),
7477
li pre code:not(.sourceCode),
7578
pre code:not(.sourceCode) {

theme/brand-light.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ typography:
5050
family: monospace
5151
background-color: bg-2
5252
monospace-inline:
53-
color: grey
53+
color: yellow
5454
background-color: bg-2
5555
link:
56-
color: yellow
56+
color: fg-2
5757
decoration: underline
5858

5959
defaults:
@@ -67,10 +67,13 @@ defaults:
6767
margin-top: 0em;
6868
margin-bottom: 0.5em;
6969
}
70-
h2, h3, h4 {
71-
margin-top: 1em;
72-
margin-bottom: 0.25em;
73-
}
70+
h1 { font-size: 2em }
71+
h2 { font-size: 1.8em; margin-top: 1em; margin-bottom: 0.25em; }
72+
h3 { font-size: 1.6em; margin-top: 1em; margin-bottom: 0.25em; }
73+
h4 { font-size: 1.4em; margin-top: 1em; margin-bottom: 0.25em; font-weight: normal }
74+
h5 { font-size: 1.2em; font-weight: normal }
75+
h6 { font-size: 1em; font-weight: normal }
76+
7477
p pre code:not(.sourceCode),
7578
li pre code:not(.sourceCode),
7679
pre code:not(.sourceCode) {

0 commit comments

Comments
 (0)