sphinx-inline-tabs
sphinx-inline-tabs copied to clipboard
Make it possible to override the synchronisation ID
Synchronization is obviously great for many purposes, but sometimes this is not something that you want. Take this example where I want to give input and (long) output in separate tabs. At the moment, the only way to prevent all tabs from switching is to rename the tab (Input 1, Input 2 etc.), which also changes its caption. I think a better way to do this would be to separate the caption from the name/label.

I also have a use-case which requires disabling synchronization. Its a very nice feature but sometimes the complete opposite of what you want.
Agreed, I'm having issues with not being able to turn off synchronization where it is not necessary, as changing tabs which are meant to be swapped back and forth causes the entire page to shift up/down when many synchronized tabs exist.
I switched to sphinx-design because of this. I still love this extension though 😍
On Fri, 24 Dec 2021, 9:56 Astrashh, @.***> wrote:
Agreed, I'm having issues with not being able to turn off synchronization where it is not necessary, as changing tabs which are meant to be swapped back and forth causes the entire page to shift up/down when many synchronized tabs exist.
— Reply to this email directly, view it on GitHub https://github.com/pradyunsg/sphinx-inline-tabs/issues/18#issuecomment-1000708940, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADYUB3RYTMLQKSAQ46L6VLUSQRUVANCNFSM43F6JKLA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you commented.Message ID: @.***>
In case this is useful to anyone else, I completely turned off synchronization for my project by adding the following to conf.py:
from pathlib import Path
def remove_tabs_js(app, exc):
if app.builder.format == 'html' and not exc:
tabs_js = Path(app.builder.outdir) / '_static' / 'tabs.js'
tabs_js.unlink()
def setup(app):
app.connect('build-finished', remove_tabs_js)
FWIW, I'm on board for this idea and would appreciate a PR to add this!
The design I have in mind is:
- A
:sync: strontabdirective, allowing authors to override behaviours. Error out on multiple tabs having the same sync key within a single tabset (ideally, with file + line number). - A
:no-sync:on.. tabdirective, to opt-out on specific tabs. tabs_default_sync_behaviorconfiguration option to configure the default behaviour with the initial supported values being"tab-title"(default) and"none". Error out on all other values.