Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: set @tags from markdown editor #1407

Closed
glowinthedark opened this issue Apr 10, 2019 · 10 comments
Closed

Feature request: set @tags from markdown editor #1407

glowinthedark opened this issue Apr 10, 2019 · 10 comments
Labels
editor tags tag related issue

Comments

@glowinthedark
Copy link

glowinthedark commented Apr 10, 2019

Setting a tag on a note is more complicated than it should be.

Currently, in order to tag a note you need to click the Tag icon, enter the tags in the dialog, and click Ok to save the tags.

How about entering the tags directly in the markdown editor via the 'username' syntax, i.e. @mytag?

Ie, in the same way that github treats usernames such as @laurent22 joplin would treat it as a tag.

This would make tag management so much easier. And the existing tagging dialog could still be used in case somebody prefers doing it that way.

It would also be great if tags would be displayed both in the editor and the preview panel, and double-clicking a tag in the preview would bring up the existing Tag input popup (or do some other useful action, ie offer an option to jump to the tag etc.)

What do you think?

@ShaddyDC
Copy link

I second showing showing the tags more prominently. It seems a bunch of people are sharing the sentiment one way or the other: #1399 #1275 #1396
I would also personally love to be able to search for one or multiple tags with something like #maths #game similarly to the Goto Anything option. There's just times when I want to look for two tags at once or in addition to other information. Maybe it's a thing already, but I haven't seen it mentioned on the website under Searching, and neither using the syntax above nor searching for a tag directly seems to work. Maybe a syntax like tag:maths would be preferable to be in line with the existing title:shopping body:egg.

Writing tags inside the note with an @ syntax has been mentioned before as well: #1040
While that seems like a nice feature, I'd personally prefer if you could just open the existing tagging dialog with a hotkey. That would mostly eliminate the need for reaching for the mouse for me.

@dayfuaim
Copy link

Yes, the #... syntax is better (my opinion).

@glowinthedark
Copy link
Author

glowinthedark commented Apr 11, 2019

@dayfuaim: #tag can easily be confused with a heading e.g. # heading, also # suggests numbering, i.e. records in some kind of enumeration, like e.g. pull request or ticket numbers in github: #1407

The @tag syntaxis is imo more semantic since the @ character is associated with at, i.e. denotes something that belongs under a certain 'namespace', as in @dayfuaim.

@dayfuaim
Copy link

dayfuaim commented Apr 11, 2019

@glowinthedark Agree, let it be @that @way. :)

@gonyyi
Copy link

gonyyi commented Apr 27, 2019

#abc for tagging, # 123 for heading. (by adding a space)

@jvcdk
Copy link

jvcdk commented Aug 6, 2019

I have thought about making tags with [].

I.e. this is a [:tag]. You can then have [:multiple :tags] easily.

I also imagine you could have a link reference to tags this way, which would then open up a drop down list with all the places that this tags was used along with a bit of the surrounding context.

@chriswayg
Copy link

@gonyyi Bear notes uses #TagName for tagging in its version of markdown. It is easier than tagging in Joplin, but sometimes messes with text that uses this syntax.

Something along the lines of [:tag] [:multiple :tags] or tag:maths may casue less problems. Is there no standard or extended Markdown syntax for tags?

@muhlinux
Copy link

muhlinux commented Oct 28, 2019

I really like this suggestion, I would prefer to keep all tags etc, when exporting/sharing to markdown. This will make using Joplin even more flexible!

There are two common formats that look very similar but are actually different in some very specific ways. And a third which is very different.
YAML Front Matter

The Jekyll static site generator popularized YAML front matter which is deliminated by YAML section markers. Yes, the dashes are actually part of the YAML syntax. And the metadata is defined using any valid YAML syntax. Here is an example from the Jekyll docs:

---
layout: post
title: Blogging Like a Hacker
---

Note that YAML front matter is not parsed by the Markdown parser, but is removed prior to parsing by Jekyll (or whatever tool you're using) and could actually be used to request a different parser than the default Markdown parser for that page (I don't recall if Jekyll does that, but I have seen some tools which do).
MultiMarkdown Metadata

The older and simpler MultiMarkdown Metadata is actually incorporated into a few Markdown parsers. While it has more recently been updated to optionally support YAML deliminators, traditionally, the metadata ends and the Markdown document begins upon the first blank line (if the first line was blank, then no metadata). And while the syntax looks very similar to YAML, only key-value pairs are supported with no implied types. Here is an example from the MultiMarkdown docs:

Title:    A Sample MultiMarkdown Document  
Author:   Fletcher T. Penney  
Date:     February 9, 2011  
Comment:  This is a comment intended to demonstrate  
          metadata that spans multiple lines, yet  
          is treated as a single value.  
CSS:      http://example.com/standard.css

The MultiMarkdown parser includes a bunch of additional options which are unique to that parser, but the key-value metadata is used across multiple parsers. Unfortunately, I have never seen any two which behaved exactly the same. Without the Markdown rules defining such a format everyone has done their own slightly different interpretation resulting in a lot of variety.

The one thing that is more common is the support for YAML deliminators and basic key-value definitions.
Pandoc Title Block

For completeness there is also the Pandoc Title Block. If has a very different syntax and is not easily confused with the other two. To my knowledge, it is only supported by Pandoc (if enabled), and it only supports three types of data: title, author, and date. Here is an example from the Pandoc documentation:

% title  
% author(s) (separated by semicolons)
% date

Note that Pandoc Title Blocks are one of two style supported by Pandoc. Pandoc also supports YAML Metadata as described above. Neither extension is enabled by default.

https://stackoverflow.com/questions/44215896/markdown-metadata-format

@laurent22
Copy link
Owner

There's no plan to make the tags part of the note body as we try to keep the Markdown in use as close as possible to standard Markdown, so advanced functionalities like this are implement via the app and not via markup.

@muhlinux
Copy link

There's no plan to make the tags part of the note body as we try to keep the Markdown in use as close as possible to standard Markdown, so advanced functionalities like this are implement via the app and not via markup.

This seems rather close-minded
What would be the downside of including this as an optional setting?

@lock lock bot locked and limited conversation to collaborators Dec 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
editor tags tag related issue
Projects
None yet
Development

No branches or pull requests

9 participants