虽然 All In One 下,大部分工作流都可以在 Obsidian 中完成,然后直接累积沉淀为笔记。但有时候,还是要从 Obsidian 中切出,打开资源管理器,嘀嘀嘀,点击打开目标文件。或者打开浏览器,输入网址或点开书签,再进入网站。
你需要一条直达外部的快速通道,省掉本就无趣的繁琐操作。
效果如下图所示:快速打开 github、arxiv、笔记中的链接、入链、出链以及预定义的链接。
如果不知道具体如何操作:查看
Obsidian Templater 执行笔记脚本
,后台发消息获取
N
ote
C
hai
n
插件
。
let nc=app.plugins.getPlugin("note-chain");
async function main(tfile,items,inlins=true,outlinks=true,onlymd=false,suffix={}){
let tmp;
tmp = nc.editor.get_frontmatter(tfile,'github');
if(tmp){
if(tmp.contains('github.com')){
items['🌐github'] = tmp;
}else{
items['🌐github'] = `https://github.com/`+tmp;
}
}
tmp = nc.editor.get_frontmatter(tfile,'huggingface');
if(tmp){
if(tmp.contains('huggingface.co')){
items['🌐huggingface🤗'] = tmp;
}else{
items['🌐huggingface🤗'] = `https://huggingface.co/`+tmp;
}
}
tmp = nc.editor.get_frontmatter(tfile,'arxiv');
if(tmp?.ID){
items['🌐arxiv'] = `https://arxiv.org/abs/`+tmp?.ID;
}
let text = await app.vault.cachedRead(tfile)
const regex = /\[[^(\[\])]*?\]\(.*?\)/g;
const matches = text.match(regex);
if (matches) {
for (const match of matches) {
let key = match.slice(1,match.indexOf(']('));
let value = match.slice(match.indexOf('](')).slice(2,-1);
if(value===''){continue;}
if(key===''){
key = value;
}
if(value.startsWith('http')){
key='🌐'+key;
}
items[key] = value;
}
}
if(inlins){
let links = nc.chain.get_inlinks();
for(let i of links){
if(onlymd&& !(i.extension==='md')){continue;}
items['🔗'+i.basename] = i.path;
}
}
if(outlinks){
let links = nc.chain.get_outlinks();
for(let i of links){
if(onlymd&& !(i.extension==='md')){continue;}
items['🚀'+i.basename] = i.path;
}
}
if(suffix){
for(let k in suffix){
items[k] = suffix[k];