SkepticMystic / breadcrumbs

Add typed-links to your Obsidian notes
https://publish.obsidian.md/breadcrumbs-docs
MIT License
509 stars 35 forks source link

FR: Add "ignore note" option in Hierarchy notes #207

Closed veradrawer closed 7 months ago

veradrawer commented 2 years ago

With the addition of Hierarchy notes I'm missing the chance of specifying files ot be ignored. Case in point: templates.

imagen

I'd love to be able to hide these, as any modification withing the template would affect any rendered file, the hierarchy notes are perfect for this.

SkepticMystic commented 2 years ago

I don't fully understand... So do you have a Hierarchy Note Template? And the templates in that note are being added to your Breadcrumbs?

veradrawer commented 2 years ago

My bad. This is not my first language and it shows. I'm using templates to render new notes, and these templates are being listed in the matrix view as well.

I can't find a way of hiding trem without modifying the template, which requires to later manually modify every new note. I'm asking whener it would be possible to list in a Hierarchy Note certain notes that should be ignored by the system.

SkepticMystic commented 2 years ago

I've added a fix for this, but it may not be what you meant. Can you send an example of a note where this happens?

veradrawer commented 2 years ago

Oh my, my bad. There is no bug! I'll try to explain myself.

There is currently no way to prevent breadcrumbs from listing notes. Because of this, templates with the yaml properly defined are listed among rendered notes.

To solve this, we can't write anything on templates, because any note rendered with them would inherit the unlisting.

I proposed using Hierarchy notes for this, as it fits to have written down which files to ignore next to which files to index, but that's all. I was asking for a method to unlist notes, sorry for all this confusion :/

El mar., 14 dic. 2021 6:50, SkepticMystic @.***> escribió:

I've added a fix for this, but it may not be what you meant. Can you send an example of a note where this happens?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/SkepticMystic/breadcrumbs/issues/207#issuecomment-993181392, or unsubscribe https://github.com/notifications/unsubscribe-auth/AR6XMLMT5O3U6S37YQA4UKDUQ3LJ3ANCNFSM5JSBR23A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

SkepticMystic commented 2 years ago

@veradrawer hahaha ok, I think I understand better... Can you send an example of a template that causes this problem

veradrawer commented 2 years ago

Sure, daily notes are a prime example:

imagen

Which are rendered with:

---
modified: 
created: "<% tp.date.now("YYYY-MM-DD HH:mm") %>"
title: "<% tp.file.title %> - "
aliases: 
notetype: [["_fleeting"]]
noteclass:
- [["_daily"]]
- [["_event"]]
day: [["<% tp.date.now("YYYY-MM-DD") %>"]]
month: [["<% tp.date.now("YYYY-MM-MMM") %>"]]
quarter: [["<% tp.date.now("YYYY-[Q]Q") %>"]]
year: [["<% tp.date.now("YYYY") %>"]]
related: 
parent: [["_daily"]]
next: [["<% tp.date.now("YYYY-MM-DD", 1) %>"]]
prev: [["<% tp.date.now("YYYY-MM-DD", -1) %>"]]
tags: 
---

This also happens, for example, with Literary notes:

imagen

Rendered from:

---
modified: 
created: "{{date:YYYY-MM-DD}} {{time:HH:mm}}"
title: "{{title}}"
aliases: "{{citekey}}"
citekey: "{{citekey}}"
notetype: [["_literature"]]
noteclass:
- [["_zotero"]]
author: {{authorString}}
publisher: [["{{publisher}}"]]
collection: 
lang: 
year: [["{{year}}"]]
quarter: 
period: 
docType: 
mediaformat: 
- [["_analogical"]]
- [["_digital"]]
url: "{{URL}}"
related: 
parent: [["_references"]]
tags: 
---
SkepticMystic commented 2 years ago

@veradrawer I've been thinking about this, and to tell Breadcrumbs to ignore a field, I see the following options:

  1. Put something in the key of the field: !parent:: [[note]]. This has the issue that now it's a different field, you know? Dataview and Obsidian see that as completely different from parent.
  2. Put something in the value of the field: parent: ! [[Note]]. But this won't work without a big refactoring, because the current system just grabs all wikilinks inside the fields you specify in your hierarchies.
  3. Put something inside the wikilink: parent:: [[!Note]]. This has the issue that Breadcrumbs has to do extra parsing of every breadcrumb in the vault. And there might be edge cases where a link has the ignore character ! but you still want it to be included.

So, the way I see it, no matter what, you're gonna have to add an ignore character somewhere. So my suggestion is to add a backslash before the field key, making Breadcrumbs think it's a different field entirely \parent:: [[Note]], and therefore will ignore it. It requires you to manually remove it after inserting the template, but I don't see a better way right now. What are your thoughts on this?

SkepticMystic commented 7 months ago

I believe #306 closes this