Obsidian-Code-Styler
Obsidian-Code-Styler copied to clipboard
Feature Request: Codeblock Tabs
Summary
Add codeblock tabs above the header optionally.
Basic example
Self explanatory
Motivation
Allow for more concise displaying of code
Existing Requests?
No
How to write syntax for this?
- Should it be consecutive codeblocks are pulled into a single codeblock if they have the
tabargument? - This would be hard to do in live preview mode and near on impossible in reading mode? How would I do this?
- Add internal syntax for separating existing codeblocks into tabs?
- This would play funny with syntax highlighting
- Add specific codeblock processor for tabbed codeblocks?
- This would play funny with syntax highlighting
Would welcome any input on this topic!
See this unmaintained plugin: https://github.com/JeminMau/Obsidian-CodeBlock-Tabs
@mayurankv I have some thoughts on how this would work but I'm no RUST or web dev so it might be impossible or too difficult to do.
- I think the
tabargument added to the codeblock could work well. Maybe something liketab:#to designate how many of the next codeblocks should be included in the tabbed codeblock. Sotab:3would take the next 3 codeblocks and add them as tabs to a singular codeblock. - Again, not a program or web dev, but could an accordion style JavaScript be used in a similar manner? Does JavaScript code exist to make tabs from navigation menus?
- Maybe a codeblock ID could be required for each codeblock and then combine each individual with the same ID into the same tabbed-codeblock. Could be as simple as
id:strings, etc. All codeblocks withid:stringswould be included in a tabbed-codeblock. - I'm not 100% sure I follow what syntax highlighting formatting issues you might expect. Again, not a dev so I don't know the code for Obsidian or your plugin (but I love the plugin, thank you)!
- Would that be necessary or would the JavaScript handle such a thing?
Edit: Also, step 4 and 6 are the same!
This issue is stale because it has been open 60 days with no activity.