vriteio / vrite

Open-source developer content platform
https://vrite.io
Other
1.63k stars 65 forks source link

Change a text block wrapper after it is specified. #50

Closed jarrodhroberson closed 9 months ago

jarrodhroberson commented 1 year ago

If you click on the / and select H1 and later want to make it an H2 is there a way to do this? Or any other root level text block definition after the fact?

If would be nice to be able to click on the H1 in this example and change it after you have written something and not have to do a copy/delete/paste with no formatting dance that I seem to have to do now.

Am I missing something?

areknawo commented 1 year ago

Currently, the easiest way to switch formatting is with Markdown shortcuts. For headings, just add # to ###### before the text. You can learn about all the shortcuts here.

That said, I see how adding UI for that could be useful. It can be e.g. a separate button/switch next to the block (e.g. H1 to H6 indicators now) or a select in the formatting toolbar (like in Notion).

Do you have any recommendations for that?

jarrodhroberson commented 1 year ago

The principle of least surprise way of doing it would be able to just click on the H1 and get the drop down like you initially do.

I have tried to figure out how to make it work and submit a pull request but not having any luck.

Thanks for the hints about the short cuts, I did not realize I could do that.

areknawo commented 1 year ago

Makes sense. Originally, the "heading badges" were meant to easily distinguish between headings - especially the smaller ones (e.g. H4 - H6). They're :before elements, so making them interactive will require a very different approach.

Still, that's a good suggestion and I'll look into/experiment with it.

areknawo commented 9 months ago
Screenshot 2024-02-06 at 20 18 47

v0.4 adds a new drag handle which, upon clicking, displays a menu to switch text and list node types. For heading nodes, the HX badge is used as a drag handle and menu activator.