Skip to content

Commit

Permalink
docs(README): add reference to usage example of snippet_handler
Browse files Browse the repository at this point in the history
  • Loading branch information
pysan3 committed Jan 12, 2024
1 parent 295ab65 commit 651301f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion README.norg
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 651301f

Please sign in to comment.