From d52e45acf9a55b025ce9c0161b922a814b65b631 Mon Sep 17 00:00:00 2001 From: Michael Lingelbach Date: Sat, 27 Nov 2021 09:01:30 -0500 Subject: docs: make |lspconfig-server-configurations| jump to the markdown file (#1497) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * generating the tags at docgen and modifying the |lspconfig-server-configurations| tag allows `:help lspconfig-server-configurations` take you to ./doc/server_configurations.md * adding a modeline to the markdown file ensures it sets the correct filetype Co-authored-by: Javier López --- scripts/docgen.lua | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'scripts/docgen.lua') diff --git a/scripts/docgen.lua b/scripts/docgen.lua index 7d0bf626..f72b984e 100644 --- a/scripts/docgen.lua +++ b/scripts/docgen.lua @@ -277,8 +277,30 @@ local function generate_readme(template_file, params) writer:close() end +local function generate_helptags() + -- Modify a help tag to point to server_configurations.md and append a modeline to it so it can be + -- displayed with the right filetype when using :help + vim.cmd [[ + helptags ./doc + edit doc/tags + set noswapfile + set noreadonly + call append('$', "lspconfig-server-configurations server_configurations.md /# Configurations") + silent write + ]] + print 'Added doc/server_configurations.md to helptags' + + vim.cmd [[ + edit doc/server_configurations.md + call append('$', "vim:ft=markdown") + silent write + ]] + print 'Added modeline to doc/server_configurations.md' +end + require_all_configs() generate_readme('scripts/README_template.md', { implemented_servers_list = make_implemented_servers_list(), lsp_server_details = make_lsp_sections(), }) +generate_helptags() -- cgit v1.2.3-70-g09d2