https://github.com/typora-community-plugin/typora-plugin-templater
Create notes from templates. | 从模板创建笔记
https://github.com/typora-community-plugin/typora-plugin-templater
typora typora-community-plugin typora-plugin
Last synced: 5 months ago
JSON representation
Create notes from templates. | 从模板创建笔记
- Host: GitHub
- URL: https://github.com/typora-community-plugin/typora-plugin-templater
- Owner: typora-community-plugin
- License: mit
- Created: 2024-08-23T10:17:58.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-11-01T11:00:06.000Z (8 months ago)
- Last Synced: 2025-11-01T11:25:30.071Z (8 months ago)
- Topics: typora, typora-community-plugin, typora-plugin
- Language: TypeScript
- Homepage:
- Size: 570 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Typora Plugin Templater
English | [简体中文](https://github.com/typora-community-plugin/typora-plugin-templater/blob/main/README.zh-CN.md)
This a plugin based on [typora-community-plugin](https://github.com/typora-community-plugin/typora-community-plugin) for [Typora](https://typora.io).
Create content from template:
- paste the content to current note
- create markdown file with the content
## Preview


## Example
### Paste note from template
````markdown
```js
const title = await tp.quickInput({ placeholder: 'Input note\'s title' })
const type = await tp.quickPick(
['book', 'video', 'music'],
{ placeholder: 'Pick note\'s type' },
)
const icon = type === 'book' ? '📕'
: type == 'video' ? '🎞'
: '🎵'
```
# {{icon}} {{title}}
````
### Create note from template
````markdown
```js
const title = await tp.quickInput({ placeholder: 'Input note\'s title' })
const type = await tp.quickPick(
['book', 'video', 'music'],
{ placeholder: 'Pick note\'s type' },
)
const icon = type === 'book' ? '📕'
: type == 'video' ? '🎞'
: '🎵'
tp.writeNoteTo(title) // The file path will be saved, it is relative to your vault's path
```
# {{icon}} {{title}}
````
## API
global variable: `tp`
- `quickInput(options?): Promise`
- options: `{ placeholder?: string }`
- `quickPick(items: string[], options?): Promise`
- options: `{ placeholder?: string, canPickMany?: boolean }`
> If `canPickMany` is `false`, `quickPick()` will return `string`
> If `canPickMany` is `true`, `quickPick()` will return `string[]`
- `writeNoteTo(path: string, options?): void`
- options: `{ openNote: true }`