mirror of
https://github.com/talwrii/plugin-repl.git
synced 2026-07-22 05:34:34 +00:00
add demo
This commit is contained in:
parent
c4881d5129
commit
63be14b992
3 changed files with 14 additions and 2 deletions
|
|
@ -6,6 +6,9 @@ This can be useful when developing plugins, or for "light-weight" scripting with
|
|||
|
||||
A range of convenience functions partly inspired by emacs is also provided.
|
||||
|
||||
# Demo
|
||||

|
||||
|
||||
# Installation
|
||||
In your obsidian vault there should be a `.obsidian/plugins` directory. You can clone this repo into that
|
||||
directory and then run the following to build the plugin:
|
||||
|
|
@ -70,8 +73,8 @@ openSetting(name: string) - Open settings and display the tab (see left hand sid
|
|||
* lineAtPoint(p?:string) - Retunrs the line at the cursor position. Default to current positiong.
|
||||
|
||||
### Reading and files
|
||||
* writeToFile(name, string) - Overwrite the markdown file called name with the given string
|
||||
* appendToFile(name, string) - Append to the markdown file called `name` with the given string
|
||||
* writeToFile(name: string) - Overwrite the markdown file called name with the given string
|
||||
* appendToFile(name: string) - Append to the markdown file called `name` with the given string
|
||||
|
||||
### Processes
|
||||
* runProc(s: string) - Parse the bash-style command string s (e.g "ls /home") and call runProc on it
|
||||
|
|
|
|||
BIN
demo.gif
Normal file
BIN
demo.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.2 MiB |
9
fuzzy.ts
9
fuzzy.ts
|
|
@ -1,5 +1,14 @@
|
|||
import { FuzzySuggestModal, App } from 'obsidian';
|
||||
|
||||
|
||||
export function fuzzySelect(app: App, choices: Array<string>, prompt?: string) {
|
||||
// doc: fuzzily select from a list of strings
|
||||
return new Promise((reject, resolve) => {
|
||||
let selector = new FuzzySelector(app, prompt || "select:", choices, [reject, resolve])
|
||||
selector.run()
|
||||
})
|
||||
}
|
||||
|
||||
export class FuzzySelector extends FuzzySuggestModal<string> {
|
||||
resolve: (_: any) => void
|
||||
reject: (_: any) => void
|
||||
|
|
|
|||
Loading…
Reference in a new issue