From cea6e0b0f6c7daf671b478bd58571768d0385711 Mon Sep 17 00:00:00 2001 From: Javier Lopez Date: Tue, 30 Nov 2021 09:27:12 -0500 Subject: fix(help): workaround plugin/users overwritting tags (#1512) Most plugin managers run :helptags in the plugin, which silently overwrites the existing doc/tags. this is an issue for us since lspconfig is manipulating the tags file to point to servers_configurations.md Instead create a markdown comment with the name of the wanted tag and make a copy in the repository of servers_configurations.md to server_configurations.txt. Now when :helptags runs it finds the txt file and generates the appropriate tag. The advantage is this solution should work in all platforms, it also removes lines from docgen CI. --- scripts/docgen.lua | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'scripts/docgen.lua') diff --git a/scripts/docgen.lua b/scripts/docgen.lua index f72b984e..f39beb8f 100644 --- a/scripts/docgen.lua +++ b/scripts/docgen.lua @@ -275,27 +275,7 @@ local function generate_readme(template_file, params) local writer = io.open('doc/server_configurations.md', 'w') writer:write(readme_data) 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' + uv.fs_copyfile('doc/server_configurations.md', 'doc/server_configurations.txt') end require_all_configs() @@ -303,4 +283,3 @@ 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