Inline Tags as Possible New Feature

A couple of users have commented recently that they use inline tags, and I’m wondering about providing support of some kind for these.

A few questions/issues come to mind.

  1. As I’ve discussed in the Knowledge Base, the Markdown spec leaves some room for interpretation when it comes to the issue of spaces after hash symbols at the beginning of a line. Right now, Notenik comes down on the side of accepting such hash symbols as signaling a heading line, even without an intervening space. Is this still workable? This would effectively mean that inline tags at the beginnings of lines would likely be interpreted as level 1 headings. How to handle this conflict?

  2. Can inline tags start with digits? Right now, Notenik assumes that hash symbols immediately followed by digits should be left alone.

  3. What should Notenik use as an indication that inline tags are being used within a collection? Some possibilities: an app setting, a collection setting, or implicit assumption if all Tags values are left blank?

  4. How should Notenik retrieve inline tags values when a collection is opened? One possibility is to do an initial Markdown parsing of each note before presenting the collection to the user. The downside here is that Markdown parsing takes some time, and so far I’ve tried to mostly defer such parsing until a note actually needs to be converted to HTML.

All thoughts on this topic are welcomed.

  1. Many markdown editors requires a space between the hash symbol and the heading, so I’m already trained for that.
  2. Notes.app does not allow tags starting with digits. So there’s a lead from Apple.
  3. A collection setting seems sensible compromise between flexibility and simplicity.
  4. Yikes. That is a can of worms.
1 Like
  1. +1 for space after hash for heading - most of the markdown editors requires a space
  2. agree with @hbowie - many markdown editors do not recognize #12 as a tag - therefore should be left alone
  3. agree with @Malcolm - per collection setting
  4. no comment - since I don’t have technical background about that - however I wonder the parsing time for 1000 notes. Maybe a background refresh could be performed?
1 Like

See the latest beta for an implementation, and let me know how this looks!

1 Like

Thank you, it is definitely a game changer for me!

My observations are:

  1. Upon selecting Inline hashtags within Body under Tags Handling section in collection settings, any text with #hashtag is added to the frontmatter’s tags line.
  2. All inline tags appear in the side bar
  3. Currently there is no visual identification for inline tags
  4. Inline tags are not clickable
  5. Headings in the text are also being recognized as tags, which I guess shouldn’t be the case.

As a half-baked workaround for bullet point 3, I added the following CSS property

.hashtag {
    color: #D6665E;
}

Of course this only stylizes the #, not the text following the hashmark, but isolates the tag from the rest

@zgr, thanks for the feedback!

The next beta will add a link to inline hashtags, to make them clickable, and will use the same class value, but applied to the entire hashtag, for custom styling purposes.

I don’t understand what you mean by “Headings in the text are also being recognized as tags…” I’m not seeing anything like this in my testing. Could you clarify, and possibly provide an example?

Thanks!

Here are the screenshots:

Thanks for the clarification. It’s only happening when the [toc] command is present, which is why I wasn’t seeing it before.

Let me look into it.

1 Like

confirmed, both [toc] and {{toc}} cause the same issue.

1 Like

See the latest beta. I believe this should be a solid improvement.

1 Like

Great! The issue has been fixed, and the tags are now clickable. Thank you!