From 651301f2af6afa0b868ae2b39922831fd8d2ed4d Mon Sep 17 00:00:00 2001 From: pysan3 Date: Fri, 12 Jan 2024 18:26:46 +0900 Subject: [PATCH] docs(README): add reference to usage example of snippet_handler --- README.md | 6 +++++- README.norg | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b4386d0..368635b 100644 --- a/README.md +++ b/README.md @@ -354,7 +354,11 @@ depend on luasnip. Here are some examples. Most of the code related to luasnip and template loading mechanism is written inside [`snippet_handler.lua`](https://github.com/pysan3/neorg-templates/blob/main/lua/neorg/modules/external/templates/snippet_handler.lua) -which **does not** rely on neorg at all. +which **does not** rely on neorg at all. The entry point is mostly +`load_template_at_curpos(content, fs_name)`. + +For usage example, read the implementation of subcommands +[here](https://github.com/pysan3/neorg-templates/blob/main/lua/neorg/modules/external/templates/module.lua#L78-L116). You are free to fork / copy-paste this code as long as you respect the [LICENSE](#license). I just don't have the motivation to compete against diff --git a/README.norg b/README.norg index 749c93a..456d70f 100644 --- a/README.norg +++ b/README.norg @@ -4,7 +4,7 @@ description: A template file mechanism for norg files. authors: takuto categories: created: 2023-04-16 -updated: 2023-05-17 +updated: 2024-01-12T18:26:18+0900 version: 1.1.1 @end @@ -263,6 +263,10 @@ version: 1.1.1 Most of the code related to luasnip and template loading mechanism is written inside {https://github.com/pysan3/neorg-templates/blob/main/lua/neorg/modules/external/templates/snippet_handler.lua}[`snippet_handler.lua`] which *does not* rely on neorg at all. + The entry point is mostly `load_template_at_curpos(content, fs_name)`. + + For usage example, read the implementation of subcommands + {https://github.com/pysan3/neorg-templates/blob/main/lua/neorg/modules/external/templates/module.lua#L78-L116}[here]. You are free to fork / copy-paste this code as long as you respect the {** LICENSE}. I just don't have the motivation to compete against other template plugins listed above.