Skip to content

#tech/obsidian #tech/emoji

模板设置

emoji 表情

https://emoji6.com/emojiall/

template模板 insert-callout

tp
<%*
const callouts = {
	tnow: '⏲️ now - ' + tp.date.now('YYYY-MM-DD HH:mm:ss'),
	title: 'title',
	info: '🔵 ℹ Info',
	question: '🟡 ❓ Question / Help / FAQ',
	quote: '🔘 💬 Quote / Cite',
	example: '🟣 📑 Example',
	success: '🟢 ✔ Success / Check / Done',
	danger: '🔴 ⚡ Danger / Error',
	bug: '🔴 🐞 Bug',
	dbtable: '表格 - dbtable',
	dict: '字典 - dict',
	widget: '子窗口 - widget',
	rule: '规则 - rule',
	workflow: '工作流 - workflow',
	module: '模块 - module',
	connector: '接口- connector',
	grid_col2: 'grid-col-2',
	grid_col3: 'grid-col-3',
	grid_col4: 'grid-col-4',
	grid_col5: 'grid-col-5',
	link: 'link'
};

const type = await tp.system.suggester(Object.values(callouts), Object.keys(callouts), true, 'Select callout type.');
const fold = '+';

const title = 'Title:';
let content = 'content';

var calloutHead
if (type === 'tnow') {
	tR = tp.date.now('YYYY-MM-DD HH:mm:ss')

} else if (type === 'title') {
	const cc = await tp.system.prompt('输入标题', '', true)
	tR = `---
title: ${cc}
date: ${date.now('YYYY-MM-DD HH:mm')}
author: yvan
---
`

} else if(type === 'grid_col2') {
  tR = `| f1  | f2  |
| --- | --- |
|     |     |
`

} else if(type === 'grid_col3') {
  tR = `| f1  | f2  | f3  |
| --- | --- | --- |
|     |     |     |
`

} else if(type === 'grid_col4') {
  tR = `| f1  | f2  | f3  |  f4  |
| --- | --- | --- |  --- |
|     |     |     |      |
`

} else if(type === 'grid_col5') {
  tR = `| f1  | f2  | f3  |  f4  |  f5  |
| --- | --- | --- |  --- |  --- |
|     |     |     |      |      |
`
} else if(type === 'link') {
  const cc = await tp.system.prompt('输入链接', 'http://www.baidu.com', true)
  tR = '['+cc+']('+cc+')'
  
} else {
  calloutHead = `> [!${type}]${fold} ${title}\n`;
  tR += calloutHead + content + '\n'
  
}
-%>