Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
chhoumann authored Jun 12, 2021
1 parent fc8edae commit 213c165
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,34 @@ Opens a prompt asking for confirmation. Returns `true` or `false` based on answe

#### `suggester: (displayItems: string[], actualItems: string[])`
Opens a suggester. Displays the `displayItems`, but you map these the other values with `actualItems`.

## Examples
### Capture: Add journal entry
![image](https://user-images.githubusercontent.com/29108628/121774877-c2d82980-cb84-11eb-99c4-a20a14e41856.png)

### Macro: Log book to daily journal
![image](https://user-images.githubusercontent.com/29108628/121774885-d1bedc00-cb84-11eb-9776-d1cdd353e99e.png)
![image](https://user-images.githubusercontent.com/29108628/121774905-ef8c4100-cb84-11eb-9657-b24759096886.png)


```js
// You have to export the function you wish to run.
// QuickAdd automatically passes a parameter, which is an object with the Obsidian app object
// and the QuickAdd API (see description further on this page).
module.exports = async (params) => {
// Object destructuring. We pull inputPrompt out of the QuickAdd API in params.
const {quickAddApi: {inputPrompt}} = params;
// Here, I pull in the update function from the MetaEdit API.
const {update} = app.plugins.plugins["metaedit"].api;
// This opens a prompt with the header "📖 Book Name". val will be whatever you enter.
const val = await inputPrompt("📖 Book Name");
// This gets the current date in the specified format.
const date = window.moment().format("gggg-MM-DD - ddd MMM D");
// Invoke the MetaEdit update function on the Book property in my daily journal note.
// It updates the value of Book to the value entered (val).
await update('Book', val, `bins/daily/${date}.md`)
}
```

### Template: Add an Inbox Item
![image](https://user-images.githubusercontent.com/29108628/121774925-fe72f380-cb84-11eb-8a4f-fd654d2d8c25.png)

0 comments on commit 213c165

Please sign in to comment.