'categories' as in OneNote?

Things I have tried

I searched Obsidian Help for ‘tags’ and ‘categories’. but I did not find what I am looking for.

Categories doesn’t seem to exist, Tags seem to be for a different purpose (tagging the whole file and not a single line).

What I’m trying to do

I would like to use a feature that I’m used to from OneNote.
With OneNote, one can attach ‘categories’ to single lines in a document. Categories can be defined and usually use an icon and / or text formatting (like highlighting) to make the marked line stand out visibly.

Very useful is the option to search for categories.
With that, I i.e. can search for all ‘questions’ (category: :question:) and as result I see all lines marked with that category in all pages.

I tried to use emojies at the beginning of a line. When I search for the emoji I see a similar result as in OneNote.

Is there perhaps a plugin that does something similar?
Using emojies works somehow, but is not as comfortable as the categories in OneNote.

What happens when you add a tag or a category the line? Does it come back the way the emojis do?

Pretty sure Obsidian treats the emojis like text, so categories as tags or text should come back the same in search results.

I do something similar with backlinks. I link to someone or a thing and add a tag to that line. In the target note, in the backlinks, I can search by the tag to filter the backlinks down to just those lines. Eg: I can track #1on1s or when my wife had a #seizure.

Tag in obsidian does work on single line basis

do u manage to get sth like this?

I don’t think Obsidian considers tags to apply to lines, but the search result previews produce much the same effect (as long as they’re not collapsed to only show the note names). If the line is long it may be truncated.

1 Like

Perfect!
Perhaps I should have tried this myself… :see_no_evil:

Anyways, thank you for your answer!
I’m loving Obsidian even more.

I’d like to add some CSS to change the appearance of the tags.
When I add a background color, there is an edge between the hashtag and the tag-text:

This is my CSS:
.cm-s-obsidian span.cm-hashtag {
background-color: #E3E3E3;
text-decoration: none;
color: #313131;
border-radius: 6px;
padding: 2px;
}

How can I avoid the edge?
Can I even supress displaying the hash-sign?

It seems to me that the hash-sign has it’s own CSS, but i can’t find out how the CSS command should look like.

Stefan

here’s my css snippet to make it both in edit and read mode. for edit mode, there’s different css selector for hashtag and the tag word.

/* tag pill decoration - edit mode & read mode */
.cm-s-obsidian span.cm-hashtag, .tag {
    color: #111;
    font-size: 12px !important;
    font-weight: normal;
    background-color: DarkSalmon; text-decoration: none;
    background-image: none; /* to remove spell-error underline in hashtag */
}

/* separate formatting for edit mode */
.cm-s-obsidian span.cm-hashtag-begin {
    padding: 0.1em 0.05em 0.1em 0.4em;
    border-radius: 0.5em 0 0 0.5em;
}
.cm-s-obsidian span.cm-hashtag-end {
    padding: 0.1em 0.5em 0.1em 0.05em;
    border-radius: 0 0.5em 0.5em 0;
    background-color: DarkSalmon;
}

/* tag pill padding - read mode */
.tag {
    padding: 0.1em 0.4em; border-radius: 0.5em;
}

/* tag pill hover - read mode*/
.tag:hover {
    color: #EEE;
}

@CawlinTeffid thanks for the correction. i always seems to think it works at line basis as i can search it as such.

1 Like

Great, that helps a lot!
I will customize your code to my preferences.

Still some weird problems:
This is reading mode:

This is edit mode:

2 Problems:

  1. in Edit mode, the tags look slightly different, there’s still the ‘edge’ at the background
  2. when clicking the Tag-Emoji in Edit mode, it works fine:
    image
    when in Read mode, it looks like this:
    image
    Seems to ignore the Emoji

Any ideas how to fix the two issued?

Yeah. Thats why i have font size dictated there. By default obsidian makes the hashtag with font size one lower. U should set to ur normal text size. Should be either 15px or 16px.

On the emoji read mode thing im not sure. I dont really use emoji actively in my notes.

Tag-Emojis work for me in both modes (I don’t normally use them, but I tried it out). I’m not sure what would cause the difference you see. I’d just try generic troubleshooting (use Developer View to check the markup, disable plugins, etc).

Have you tried alternate checkboxes?

They work in lots of themes.

I like the Minimal Theme and the alternate checkboxes, even if they won’t exactly serve my purpose.
Problem I have: the quick font size adjustment (with my trackpad) doesn’t work. Even not in sandbox mode with all other plugins disabled.
Maybe a Bug in the theme? Or a setting I haven’t found?

The problem with the Tag-Emojies not being found has been solved. It was an incompatibility with an image plugin.

1 Like

I use tags almost exclusively to tag individual lines or blocks of text, rather than for whole documents.

For example, I have a weekly 1:1 meeting with my manager. If I think of something during the week that I want to remember to bring up with him, I add it as a line or block to my daily note, and tag it with his name. Then, on the day of our meeting, I click on that tag in the tags pane, which generates a list of items to talk with him about. I review that list, compile it into a single note, and I’m ready for our meeting.

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.