BearToCode / carta

A lightweight, fast and extensible Svelte Markdown editor and viewer.

Home Page:https://beartocode.github.io/carta/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Split toggle mode

zFlxw opened this issue · comments

hey there,
I thought it would be nice to have the ability for a split toggle mode (so basically a split mode, but you can disable the split preview). I just wanted to ask if this is not implemented by choice or if there was just nobody who needed that?

Hi, I'm not sure I understand what you suggest. Do you mean like a button to switch from split or tabs?

Kind of. So basically what I was thinking is a button to enable or disable the split view (but while disabled, only the code is shown and there is no preview tab)

Mhhh... I guess you want to do something like the "Discord" example, right? I guess in that case you could disable the whole toolbar or, if you just want to remove the preview tab, you could set display: none on the buttons styles.

Acutally, what I want to implement is more along the lines of VSCode, for example. If you look at the top right corner of the screenshot, there is this "toggle" button, and when you click it, the rendered preview shows (screenshot two)

image

image

Undestood! I guess you could try extending the editor, providing a new icon that when pressed toggles between having split mode and tabs mode. Then you can remove the tabs buttons by setting display: none. You can also use a button outside the editor instead of embedding an icon.

Sounds like a suitable solution, thanks!