Here is the second version of the nag message patch. I have rebased it
into a single commit.
It's the same as the not explicitly named V1, with the added 'TL;DR' at
the top of the help.
From 7de5556dae4aca652d4a3f1ba1d841e757e1858b Mon Sep 17 00:00:00 2001
From: Rene Schallner <rene@renerocks.ai>
Date: Sun, 24 Jul 2022 17:30:40 +0200
Subject: [PATCH V2 1/1] added nagging and transitioning help
---
doc/telekasten.txt | 128 +++++++++++++++++++++++++++++++++++++++++++++lua/telekasten.lua | 15 ++++++
2 files changed, 143 insertions(+)
diff --git a/doc/telekasten.txt b/doc/telekasten.txt
index c8077fa..6b182a0 100644
--- a/doc/telekasten.txt+++ b/doc/telekasten.txt
@@ -28,6 +28,8 @@ https://github.com/renerocksai/telekasten.nvim
*telekasten.contents*
CONTENTS
+ - TRANSITIONING ----------------> |telekasten.transitioning|+ 0. Note file naming .............. |telekasten.note_naming|
1. Setup ......................... |telekasten.setup|
2. Colors ........................ |telekasten.colors|
@@ -40,6 +42,132 @@ CONTENTS
4. Suggested mappings ............ |telekasten.mappings|
5. Credits ....................... |telekasten.credits|
+================================================================================+ *telekasten.transitioning*+TRANSITIONING++TL;DR: change repo url~+- from `renerocksai/telekasten` +- to `https://git.sr.ht/~renerocksai/telekasten.nvim`++To stop displaying the reminder at the start of telekasten, set the+`nag_me` option in the configuration option to false:+>+ nag_me = false,+<++For a web-version of this explanation, surf to:~+ `https://man.sr.ht/~renerocksai/telekasten.nvim-wiki/TRANSITIONING.md`++We have moved Telekasten from GitHub to SourceHut. Read about why we did that+and how you can update your config to stay up-to-date in the future.++Why did we move the Telekasten repository?~++Recent developments around GitHub and its Copilot have lead to the+`#GiveUpGitHub` campaign.++Read more about it here: `https://sfconservancy.org/GiveUpGitHub/`++As FOSS advocates, we get it, support it and wanted to move Telekasten out of+Github. See the full discussion about that++- on the discussions mailing list:+ `https://lists.sr.ht/~renerocksai/telekasten.nvim-discuss/%3C20220709001858.zy5at6pgnzvea7px%40renerocks.ai%3E`+- or on Github's discussion platform:+ `https://github.com/renerocksai/telekasten.nvim/discussions/149`++Why should you transition?~++At the moment, the source code is similar in both repositories. However, most+of the development now occurs on SourceHut, and the GitHub version is only+synced from time to time.++At some point in the future, the Github repository will be archived and only+the SourceHut version will continue being updated.++If you want to keep Telekasten up-to-date with the latest developments, it is+therefore advised to change the address of the plugin in your configuration.++How to transition?~++For the user, transitioning from the Github repo to the SourceHut one is an+EASY, 30 SECONDS PROCESS. It does not imply a change in the plugin+configuration or any complex and time-consuming tasks. Basically you have to:++1. Change the repo address in your plugin declaration (use+ `https://git.sr.ht/~renerocksai/telekasten.nvim`)+2. Run your plugin manager clean command to remove the old repo+3. Run your plugin manager update or install command to install the new one++And voilà, you are now all set to receive the latest updates for the years to+come!++ ------------------------------------------------------------------------------+ Vim-Plug~+ -----------------------------------------------------------------------------++ Change the lines:++ Plug 'renerocksai/telekasten.nvim'+ Plug 'renerocksai/calendar-vim'++ to:++ Plug 'https://git.sr.ht/~renerocksai/telekasten.nvim'+ Plug 'https://git.sr.ht/~renerocksai/calendar-vim'++ Remove the GitHub version of the plugin:++ `:PlugClean`++ Install the SourceHut version of the plugin:++ `:PlugUpdate`++ A `:PlugInstall` is likely to work, too - but I only tested it with+ `:PlugUpdate`.++ ------------------------------------------------------------------------------+ Vundle~+ ------------------------------------------------------------------------------++ Note: I did not test this. But according to the docs, change the lines:++ Plugin 'renerocksai/telekasten.nvim'+ Plugin 'renerocksai/calendar-vimn'++ to:++ Plugin 'https://git.sr.ht/~renerocksai/telekasten.nvim'+ Plugin 'https://git.sr.ht/~renerocksai/calendar-vimn'++ Remove the GitHub version of the plugin:++ `:PluginClean`++ Install the SourceHut version of the plugin:++ `:PluginUpdate`++ ------------------------------------------------------------------------------+ Packer~+ ------------------------------------------------------------------------------++ Change:++ use 'renerocksai/telekasten.nvim'+ use 'renerocksai/calendar-vimn'++ to:++ use 'https://git.sr.ht/~renerocksai/telekasten.nvim'+ use 'https://git.sr.ht/~renerocksai/calendar-vimn'++ then clean, update and install with the single command:++ `:PackerUpdate`+================================================================================
Section 0: Note file naming *telekasten.note_naming*
diff --git a/lua/telekasten.lua b/lua/telekasten.lua
index 883dd41..bbff07a 100644
--- a/lua/telekasten.lua+++ b/lua/telekasten.lua
@@ -30,6 +30,8 @@ local home = vim.fn.expand("~/zettelkasten")
local M = {}
M.Cfg = {
+ nag_me = true,+ home = home,
-- if true, telekasten will be enabled when opening a note within the configured home
@@ -463,6 +465,7 @@ local function imgFromClipboard()
vim.api.nvim_err_writeln("Unable to write image " .. png)
end
end
+-- end of image stuff
M.note_type_templates = {
@@ -2800,6 +2803,16 @@ local function FindAllTags(opts)
}):find()
end
+local function nag(opts)+ opts = opts or {}+ local doit = opts.nag_me+ if doit then+ print_error(+ "Note: Telekasten has moved! See :help telekasten.transitioning"+ )+ end+end+-- Setup(cfg)
--
-- Overrides config with elements from cfg. See top of file for defaults.
@@ -2905,6 +2918,8 @@ local function Setup(cfg)
if has_pcre == 0 then
M.Cfg.rg_pcre = true
end
++ nag(M.Cfg)end
M.find_notes = FindNotes
--
2.36.0
it's really picky: subject should have had v2 instead of capital V2 in
it. Next time I'll get it right. I feel more in control when not using
git send-email 😊
On Mon Jul 25, 2022 at 4:31 PM CEST, Thomas Lambert wrote:
> I just tested the patch. I don't know why, but `:help telekasten.transitioning`> does not work on my end. Nvim can not autocomplete either.
You need to update your plugin via your plugin manager, so that helptags
will get re-generated. Usually, re-generation seems to be done after all
plugins have been updated. Since there won't be any changes to pull,
this should leave everything untouched.
For users updating via their plugin system, this won't be an issue.
> You need to update your plugin via your plugin manager, so that helptags> will get re-generated.
Ok. I was not aware of that mechanism. All good for me then.
On Mon Jul 25, 2022 at 4:47 PM CEST, Thomas Lambert wrote:
> > You need to update your plugin via your plugin manager, so that helptags> > will get re-generated.>> Ok. I was not aware of that mechanism. All good for me then.
I always forget about it, too. Then remember it eventually, and forget
about it immediately afterwards. Would have warned you otherwise.