You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To pick up a draggable item, press the space bar.
While dragging, use the arrow keys to move the item.
Press space again to drop the item in its new position, or press escape to cancel.
functionfilterAndReorderLinks(){constfilterPatterns=[/^\d{8}\w{3}$/,// Example: 20240728 Sun/^\d{6}$/,/^\d{8}~\d{8}$/,/^\d{8}\-\d{8}$/// Add more patterns here if needed];constcontainers=document.querySelectorAll("div.og-hierachy-navigate-backlink-doc-container");if(containers.length===0){return;}containers.forEach(container=>{constrefLinks=container.querySelectorAll("span.refLinks.docLinksWrapper");if(refLinks.length===0){return;}// Hide elements that match any pattern in filterPatternsrefLinks.forEach(link=>{constdocName=link.getAttribute("title");if(filterPatterns.some(pattern=>pattern.test(docName))){link.style.display="none";}else{link.style.display="";// Reset display property if it doesn't match}});// Separate elements into two arrays: one for @-prefixed and one for otherItemsconstmocItems=[];constotherItems=[];refLinks.forEach(link=>{constdocName=link.getAttribute("title");if(docName.startsWith("@")){mocItems.push(link);}else{otherItems.push(link);}});// Sort the 'otherItems' array based on the 'title' attribute in ascending orderotherItems.sort((a,b)=>{consttitleA=a.getAttribute("title").toUpperCase();// Ignore upper and lowercaseconsttitleB=b.getAttribute("title").toUpperCase();// Ignore upper and lowercasereturntitleA.localeCompare(titleB);});// Clear only the refLinks elements and append them in the desired orderrefLinks.forEach(link=>link.remove());mocItems.concat(otherItems).forEach(link=>{container.appendChild(link);});});}// Execute the function setInterval(filterAndReorderLinks,100);
Activity
OpaqueGlass commentedon Aug 6, 2024
--- 原内容:(或浏览编辑历史) ---
Achuan-2 commentedon Aug 6, 2024
是的
主要用于dailynote笔记法的用户,会倾向于用moc来管理笔记,而不用文档树管理笔记,管理文档链接而不管理文档,这时候文档导航的显示父子文档就没有什么导航作用了,需要靠反链的文档来导航,显示相关文档:

moc 文档
主题下的其中一个文档:由于使用dailynote积累笔记,反链有很多dailynote,但这些dailynote和这篇文档的主题无关系只有补充信息,我希望的是,反链只展示主题内容真正有关联的笔记,因此希望是可以有一个选项可以过滤掉这些dailynote的。
Achuan-2 commentedon Aug 6, 2024
其他建议:
或者可以导航区域的反链显示可以自定义正则过滤也行,可以添加多个过滤规则,用户自己过滤
此外,还希望反链导航还能设置排序方式和特殊置顶规则。我一般会把moc笔记添加一个@前缀,如果有一个正则功能,可以让符合条件的文档放在最前面就很棒了,文档导航插件就不仅仅可以用于文档树分类体系,也可以用于moc笔记分类体系
Achuan-2 commentedon Aug 6, 2024
简单用js实现了下
运行前

自定义js运行后

OpaqueGlass commentedon Aug 16, 2024
如果可以,麻烦参与测试,谢谢:
https://github.com/OpaqueGlass/syplugin-hierarchyNavigate/releases/tag/v1.3.0-beta1
Achuan-2 commentedon Aug 17, 2024
可以用的,谢谢!

图片:
OpaqueGlass commentedon Aug 18, 2024
ok😋