xhuajin / obsidian-tabs

MIT License
64 stars 3 forks source link

Disabling Code formatting for Tabs code block. #28

Closed DeusEx01 closed 3 weeks ago

DeusEx01 commented 1 month ago

Hi! Firstly, I want to say thanks for your plugin. It's simple yet effective feature!

And the "Feature request" is adding an ability to turn off code style for tabs. What I mean is when we have some content that we would like to change from time to time, we have to work without any MD formatting for text because we have code formatting (without syntax highlight). Here is how it looks without tabs. It has native formattings for things like #tags or >quotes or # Headers and so on. image

But in ```tabs we lose all the formattings and have to work with code formatting. image

So I think it would be cool to turn off such ```tabs code format or adding an option to turn it off.

Right now, I use the plugin only for Dataview queries like personal book Library image

xhuajin commented 1 month ago

Thank you for your liking! The effect of using tabs in conjunction with dataview looks great. Would you like me to put your example of using dataview in tabs into README's Showcase? I'll put your name up there, too.

I understand the meaning of "turn off code style for tabs". In fact, this rendering uses the API provided by ob to render text into reading mode (MarkdownRenderer.render()). The reason for not using live mode editor directly is that ob does not seem to have exposed its cm5+cm6 editor (or I haven’t found it). I was also troubled by the limitation of only being able to edit the source code. My current solution is to write a cm6 editor that allows for quick editing with a double-click. I will continue to look for better solutions in the future.

(ps. English is not my mother tongue. If there are any irregularities in my expression, please point them out to me. Thank you for your feedback!)

DeusEx01 commented 1 month ago

@xhuajin Of course you can use the showcase as you wish. By the way, it's made with my snippet for such Cards view (https://github.com/DeusEx01/Cards-View-snippet) Also, I use Tabs in mobile too, so it looks like this: image

And thanks for extended answer about the issue. Unfortunately, I'm not an advanced JS user, so I can't give any hint about solving the issue.

(p.s. English is not my mother tongue either)

xhuajin commented 1 month ago

Thank you very much! I will put the example you provided into the README in the next update. I'll try to find a better solution in the future.

xhuajin commented 1 month ago

Tabs has been updated to 1.1.4, and the use case you shared has been included in the README. Due to the large number of images in the showcase section, I’ve moved the entire section further down. Thank you again for your contribution!

DeusEx01 commented 1 month ago

Thanks for the update. It's a game changer! How to use images is up to you, of course. The only thing I don't understand is why are these images have broken links =) image I'm not an advanced GitHub user, so I don't know if it's a common behavior.