Skip to content

YlanAllouche/HydraShard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

You can read a longer write up on my blog.

HydraShard

HydraShard is a Which-key for Neovim/Hydra for Emacs replacement for Obsidian

Screenshot

Installation

Simply make available the hydra.js script available in your Templater user script folder.

Usage

After that you can simply call it with:

tp.user.hydra(menuitems)

Where menuitems is an objct of the following shape

  let menuitems = [
    {
      key: "f",
      name: "Name to be displayed here",
      action: async () => {
          let var = await tp.user.someModule();
          return var;
      },
    },
{...}
  ]

You need to pass the tp object in order to access other user scripts.

HydraShard captures the return value of the triggered function so you can define your behavior both in and out of menuitems.

let result = tp.user.hydra(menuitems)
let capturedOutput = result.result
// Do anythign with capturedOutput here

There are several strategy depending on how you want to split your code and how much you want to re-use your functions, look at the examples folder.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published