Releases: Tan-TanZi/obsidian-tips
Release list
3.1.0
3.1.0
设置页
- 扫描相关的选项独立成「扫描」区块,带独立标题;两条提示(变量式注册、附带模板)也移入其中。
- 新增一条说明,讲清扫描识别名称的线索顺序:字面量注册 → 唯一字符串常量 →
.block-language-*类名 →tips.json标识符。 - 统计文字改为把附带模板一并计入,并且括号里报的是插件数:「当前扫描共收录 N 个代码块名称,来自 N 个插件(其中 N 个插件来自 tips.json 模板)」。
- 模板分组标题改为「N 个 / N 条」,数量部分用更弱的颜色渲染,不再和分组名抢注意力。
修复
- 模板弹窗里 4 处
createEl('div')改为createDiv(),符合 Obsidian 的prefer-create-el规则。
变更
- 移除导出弹窗里的「复制到剪贴板」按钮。JSON 可以在框里直接选中复制,插件从此完全不接触剪贴板——入口页上的剪贴板披露项也随之消失。(此前在 2.0.0 记录过该功能,现予取代。)
文档
- 新增
CONTRIBUTING.md,两版 README 均已链接。
3.1.0
Settings
- The scan options now live in their own Scanning section with a heading, and the two notices (dynamic registration, bundled templates) moved inside it.
- A new note explains the order in which scanning resolves names: literal registration → unique string constant →
.block-language-*class →tips.jsonidentifier. - The scan summary now counts bundled templates too, and reports plugins rather than names: "N code block names from N plugins (N of them provide tips.json templates)".
- Template group headings now read "N names / N templates", with the counts rendered in a weaker colour so they don't compete with the group name.
Fixed
- Four
createEl('div')calls in the template dialogs were replaced withcreateDiv(), as required by Obsidian'sprefer-create-elrule.
Changed
- Removed the "copy to clipboard" button from the export dialog. The JSON can be selected and copied right there, and the plugin no longer touches the clipboard at all — which also removes the clipboard disclosure from its listing. (This supersedes the clipboard feature noted under 2.0.0.)
Docs
- Added
CONTRIBUTING.md, linked from both READMEs.
3.0.0
重大修复:tips.json 自主导入问题
插件目录下的 tips.json 此前会被读取、会计数、也会在设置页显示,但里面声明的标识符从未进入 ``` 候选面板。结果是那些变量式注册代码块的插件——名字只在运行时确定,静态分析读不出来——在界面上看起来"已经被识别",实际上却选不到、用不了。现在 tips.json 里的标识符会一并并入候选栏,受「自动读取插件附带的模板」开关控制,并与扫描结果去重。
扫描增强
读取插件时新增两条线索,过去会漏掉的名字现在能认出来:
插件 styles.css 里的 .block-language-* 类名(零误报)
仍无法解析名字的插件会在设置页列出,说明是哪些、原因是什么。
设置页
扫描区新增一条状态说明:读取到多少条附带模板、来自哪些插件、在哪里查看。样式与既有警告条一致,但左侧色条使用主题色,表示这是状态而非待处理的问题。该提示位于「变量式注册」警告的下方。
模板分组改为默认收起;分组标题带上条数,收起状态下也能一眼看出哪组有内容。
分组内每一行(标识符行及其模板)统一为 8px 上下留白,层级对齐更整齐。
变更
附带模板在重扫时会并入你的模板列表,与自己的条目并列显示,可编辑、可删除;下次重扫会重新写入。
English
Major fix: bundled tips.json never imported
A plugin's tips.json was previously read, counted and displayed in settings, but the identifiers it declared never made it into the ``` picker. As a result, plugins that register their code blocks dynamically — names resolved only at runtime and unreadable by static analysis — appeared "already detected" in the UI, yet could not be selected or used. Identifiers from tips.json now join the candidate list, subject to the "Read templates bundled with plugins" toggle and de-duplicated against scan results.
Scanning
- An extra clue is now used when reading a plugin, so names that used to be missed are found: the
.block-language-*classes in the plugin'sstyles.css(zero false positives). - Plugins whose names still cannot be resolved are listed in settings, saying which ones and why.
Settings
- A new status note under the scan section reports how many bundled templates were read, from which plugins, and where to find them. It is styled like the existing warning bar, but its left bar uses the accent colour, since it reports a state rather than a pending problem. It sits below the "variable-style registration" warning.
- Template groups are now collapsed by default; the group heading carries its template count, so you can tell at a glance which groups have content even while collapsed.
- Every row inside a group (the identifier row and its templates) now uses a consistent 8px vertical spacing, so the hierarchy lines up more neatly.
Changed
- Bundled templates are merged into your template list on rescan, shown alongside your own entries and editable or removable like them; they are written again on the next rescan.
2.1.1
Fixed
- Panel positioning now delivers its coordinates through CSS variables (
--tips-picker-top,--tips-picker-left, …) instead of writing inline styles. This resolves the remainingobsidianmd/no-static-styles-assignmenterror raised by the plugin review.
Notes
- No user-facing behaviour change. If 2.1.0 installed and worked for you, this is a drop-in replacement.
Compatibility
minAppVersionremains 1.8.7.
2.1.0
Internal
- Fixed issues reported by the community plugin review: replaced direct style assignment with
setCssProps, used Obsidian's DOM helpers, and adoptedSetting.setHeading()for section titles. - Language detection now uses Obsidian's
getLanguage()API instead of readinglocalStorage. - Removed the deprecated
setDynamicTooltip()call.
Compatibility
minAppVersionraised to 1.8.7 (required bygetLanguage()). If you're on an older version, please update Obsidian first.
Docs
- The README is now English by default, with the Chinese version at
README_ZH.md.
2.0.0
Content templates
- Type
?on the first line of a code block to bring up the template panel: names on the left, a full preview on the right,↑↓to select andEnterto insert. - Inserting replaces the whole block body (fences stay put) and leaves the cursor at the end.
?must be the first character of the body, soa ? b : cnever triggers it.- Manage templates per entry under Settings → Tips → Content templates.
- Paste a whole code block — the surrounding fence is stripped automatically.
Import / export
- Export to JSON, split into
plugins/builtin/customgroups. - Copy to clipboard or export a
tips.jsonfile; import from pasted text or a file. - Import is additive: identical entries are skipped. Custom entries that don't exist yet are created automatically; plugin and builtin entries are only ever skipped.
- New: read templates bundled with plugins (
tips.jsoninside a plugin folder, read-only).
Interface
- Six interface languages: 简体中文, English, Русский, Français, Español, العربية.
- Panel width ceiling raised to 920 px, default 580 px.
- New toggles for alphabetical sorting and opening the picker while editing the info line.