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

[Enhancement] [2.0] (Option to) hide markup annotations for code blocks #2378

Closed
Redsandro opened this issue Aug 30, 2021 · 11 comments
Closed
Labels
feature This is a completely new feature for Zettlr. pinned Indicates this issue should not be automatically handled by the bots.
Projects

Comments

@Redsandro
Copy link
Contributor

Description

Implement an option to hide the markup annotations for markdown code blocks. This would be the same option as #2377, so consider this an upgrade to that issue.

ℹ️ Zettlr already behaves in a similar way for urls/links and - to a more complex degree - tables.

This would make behavior for code-blocks similar to that of links (and to some degree tables), where you only see the markup annotations while the cursor is in the relevant position.

Caveats

When user wants to edit a line in an existing code block, user is likely to place the cursor at the position to be edited. Appearing markup annotations at the beginning of a code block causes the text to jump one line down. This can be compensated to scroll one line up at the same time.


Backlinks: #2369 #2243

@nathanlesage
Copy link
Member

Not the same option! ☝🏻

@nathanlesage nathanlesage added feature This is a completely new feature for Zettlr. pinned Indicates this issue should not be automatically handled by the bots. labels Sep 2, 2021
@nathanlesage nathanlesage added this to To do in Zettlr 2.x via automation Sep 2, 2021
@Redsandro
Copy link
Contributor Author

Not the same option! ☝🏻

You prefer this option/toggle/setting to be separate from #2377?

I'm happy either way, but for simplicity, I think you can merge this into one option i.e.:

Same option:

Rendering:

  • Markdown visible
  • Markdown hidden (2377 and 2378)

Not the same option:

Rendering:

  • Hide markdown for italics and bold (2377)
  • Hide markdown for code blocks (2378)

@nathanlesage
Copy link
Member

Exactly like this. Since I started micro-managing all the rendering options, it would be more confusing if SOME of the rendering options triggered multiple elements (which, strictly speaking, are completely distinct semantically) than if you can actually trigger every single element. I don't have any telemetry so I don't know which things people are using as opposed to what they are not. Could well be that I could actually combine all the rendering options into one single "WYSIWYG" option, but I don't know, and so it's easier to just stick with one mechanism, right?

@Redsandro
Copy link
Contributor Author

Could well be that I could actually combine all the rendering options into one single "WYSIWYG" option, but I don't know

That is what I would vote for, and judging from digging through Zettlr topics on Reddit, that's what telemetry would show the more popular option.

Like I said, I'm happy to click two boxes (or more, because we also need an option to hide inline code backticks) and forget about it. But I'm not sure that's the right approach against confusion. Because there are already some non-optional hidden annotations: links, tables, and now that I think of it, even images.

So there is a third option: Make hiding code block annotations non-optional, just like with links, tables and images.

There is also a fourth option: Group all the options into one WYSIWYG, and also add an option for pure colorized markdown mode, where even tables and images are pure markdown. That would mean the option is as follows:

Rendering:

  • Pure markdown
  • Zettlr classic hybrid
  • WYSIWYG

@Redsandro
Copy link
Contributor Author

PS - while my comments remain valid, I'd like to apologize for being an intermittent idiot and appearing ignorant at times. I had completely forgotten about this:

image

@nathanlesage
Copy link
Member

Haha, don't worry :D

What we could ALSO do is allow a radio-control for that:

Markdown Rendering
==================

( ) Plain Markdown
( ) Full WYSIWYG
(*) Choose:

   - [x] Render Citations
   - [x] Render Iframes
   - [x] Render Images
   - [x] Render Links
   - [x] Render Formulae
   - [x] Render Tasks
   - [x] Hide Inline Formatting
   - [x] Hide heading characters

… whereas the checkboxes are only enabled if you select "choose". Full WYSIWYG would activate everything, Plain Markdown would disable everything.

@chchen2021
Copy link

chchen2021 commented Nov 18, 2021

( ) Plain Markdown
( ) Full WYSIWYG
(*) Choose:

I would love to see the three options implemented in Zettlr. I somehow missed this post when I commented on #1634 , which can be ignored in light of this newer thread.

@biva
Copy link

biva commented Oct 18, 2022

Hello, I'm checking on this issue to see if you plan to further work on this? In addition to hiding the coding characters, would it be possible to fully hide the heading characters? For now, when I hide them in the preferences, I still see h1, h2, ... Would it be possible to hide them fully? (@Redsandro if it makes sense for you, would it be possible to change the title of your issue to include the heading characters? It would avoid creating a new issue for a very similar issue). This was suggested in #856 but the issue is closed now.

Another suggestion: the way Obsidian does it would be really perfect, notably for headings and code block (```)

  • They are hidden by default
  • When you click on the title, it shows the #
  • When you click on a code block, it shows the ```

Thanks again for your great program!

@Redsandro
Copy link
Contributor Author

would it be possible to change the title of your issue to include the heading characters? It would avoid creating a new issue for a very similar issue

It appears similar, but header tags are uniquely different in how they work. It is preferred to have one issue per one commit, so closing them can be automated. That's why these are also separate issues:

Header tags are arguably more similar to the former, because code blocks are parsed and themed in a different... well, code block. I recommend you open a new issue and link back to that issue, or both.

@biva
Copy link

biva commented Apr 5, 2024

Thanks for all the work here and the great software! I created the issue for headers: #5086

@nathanlesage
Copy link
Member

I think this issue can be closed, since Code block info strings are now hidden with the emphasis renderer (we can discuss which renderers should affect which element, but this is (a) a different discussion and (b) probably something for the UX side of things)

Zettlr 2.x automation moved this from To do to Done Apr 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This is a completely new feature for Zettlr. pinned Indicates this issue should not be automatically handled by the bots.
Projects
Zettlr 2.x
  
Done
Development

No branches or pull requests

4 participants