mdzk-rs / mdzk

General-purpose interface to connected notes
https://mdzk.app
Mozilla Public License 2.0
234 stars 18 forks source link

Basic support for Obsidian style tags #10

Open kmaasrud opened 3 years ago

kmaasrud commented 3 years ago

These tags can be both part of the front matter and contained in the text.

How should we format them? My feeling is a simple <span class="tag">this-is-tag</span> will work great, and we can just do a .tag:before { content: "#"; } as part of the theme, if we want to have the tags prefixed by a #.

An idea would be to generate a separate page for each tag, that lists all the notes that include that tag. These "tag-pages" would of course not be listed in the sidebar. What do you think about this?

SR-G commented 3 years ago

This is a personal opinion, but i think that things should be kept simple - span rendering is fine. Having some "tag pages" is a nice idea, but it will be more complex in the end (customization, template, then the need of an index of tags listing all the tags, and so on - it can be endless, and more difficult / time-consuming to have something robust and easy to maintain). At least in first iterations. If really needed someday, maybe that kind of features could/should be "pluginized".

kmaasrud commented 3 years ago

@SR-G thank you for adding some thoughts on this! I agree, advanced tag behavior should not be a priority. We already have links/backlinks for note discovery, tag pages would add a lot of complexity.

We'll go for basic styling of tags (and perhaps a collection of them listed at the bottom of the page) in the beginning, and reconsider more functionality at a later time :smile:

ratsclub commented 3 years ago

My feeling is a simple <span class="tag">this-is-tag</span> will work great, and we can just do a .tag:before { content: "#"; }

I currently do this in my theme for footnotes and I feel it's a sensible choice.

https://github.com/ratsclub/notes.victorfreire.dev/blob/master/theme/css/general.css#L217-L223

shivanthzen commented 2 years ago

+1

kmaasrud commented 2 years ago

Tag support in 1.0.0 would be as simple as pushing each parsed tag to the tags field of Note. No alterations to the content needs to be done in this case, as user might want their SSG to handle the tags as well.

Additionally, Vault should contain a list of all tags and which notes contain them, to simplify generating an index page for the tags.