Feature Request: Comment Formatting

Hi, I have a similar feature request. As a creator of a note I want to share it with a Reviewer, the reviewer should be able to comment the note in plain text (addition, deletion, subsitution, comment, highlighting). The commented note then needs to be rendered accordingly in preview to show the comments in a user friendly way (eg. strike-though when deletion, new text highlighted green in an addition etc.)
I think criticmarkup.com - http://criticmarkup.com/spec.php seems a viable Syntax, I think only rendering and templates would need to support that.

4 Likes

I wasn’t aware of critic markup. I’m checking it out, thanks for sharing it! Looks amazing

Was thinking about this today. Now that Obsidian has templates, you could create a template for a comment or footnote.

The other option depending on your use case is to use tags for comment types. Many people (myself included) will use tag to denote actions needed or current status. A tag of “TODO:” or “Expand” or “Rough Draft” allows you to use the tag pane and find all of your “todo” items.

Especially with how the search function supports the “path:” keyword you could also limit tags to within a certain folder or folders or exclude folders.

Hope this helps.

We will add %% this is a comment %% in 0.10.12.
I suggest you open a separate plugin request for criticmarkup.

9 Likes

May I ask why the comment syntax requires a closing %% and doesn’t auto-close on a newline? My notes contain comments like this:

%% The following section contains:
%% - a
%% - b
%% - c
%%
%% Note the odd number of comment lines. This whole comment block would break apart in Obsidian.

Both are quite standard comment syntax methods in code, but I know that Obsidian focuses on HTML & CSS output where it does not. Still, my main note taking app (Ulysses) supports this, matching that common behavior.

This also allows for easy toggling of comments on/off with the standard hotkey of Ctrl/Cmd+/, because it just means toggling the presence of %% (including a space) either at the start of the line, or at the start of the text (for indented text).

I reckon the engineering might be harder to implement now that the existing syntax has been launched, but I would love if it could be supported, maybe via a setting to toggle between the two styles? I don’t know if a plugin could handle this.

You like autoclose on new line, other people would like to have a syntax for multiline or subline comments.

There isn’t too much reasoning, @Licat tried to pick something that feels “markdowny”, **bold** %%comment%%

3 Likes

This makes sense, although I’m in the same boat as @KuraFire, used to Ulysses, where I can use %% for block comments and ++ for inline comments. Block comments are still markdowny, like using ## for headings, though I admit it’s mostly a matter of wanting consistency between the two main programs I write in, and I wouldn’t expect you to just match Ulysses wholesale.

So, consider this another vote in favor of auto-closing comments on a newline!

1 Like

@npseaver would you mind opening a request for that? We won’t track the FR in the archive.

2 Likes

@argentum & @npseaver I wrote up a new FR for it, as an evolution on the existing syntax:

1 Like

Just a reply here to the reasoning:

The comment syntax more closely follows the $$ math/LaTeX syntax, where you may want to write multi-line block comments without having to prepend the delimiter on each line.

This semantically is closer to markdown’s design where syntax can either work at a “block” level or an “inline” level, rather than on a per-line basis.

We’d also like to avoid having to reserve multiple different syntaxes %% and ++ if it could fit in one. Otherwise it becomes too easy to trip on a syntax unintentionally.

I understand that you wish for a more syntax-compatible version with Ulysses, but unfortunately I don’t believe that’s likely to happen. The syntax themselves work too differently to have any kind of “compatible” mode that can support both. We fundamentally don’t agree with their syntax proposal, and we also now have users who are already reliant on the current syntax for their notes. This means that even if we were convinced Ulysses’s syntax is the way to go, it’d be a painful process for current users to migrate.

9 Likes

Great to have a comments shortcut now! I would however like to change the format of my comments (personally prefer HTML <!-- --> over %%%% for consistency with other software I use). Is there a way to do that internally to Obsidian’s “Toggle comment” shortcut? I.e., rather than creating a new comment shortcut with espanso or something. Many thanks!

3 Likes

There is not—and you’d have to create a new feature request thread for this if you want the idea tracked!

1 Like