Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make default tab selection configurable #58

Open
mojavelinux opened this issue May 22, 2023 · 2 comments
Open

Make default tab selection configurable #58

mojavelinux opened this issue May 22, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@mojavelinux
Copy link
Member

Currently, the first tab in the list is selected by default (unless a tab is selected by some other means, such as a URL fragment or sync group). It should be possible to configure/override which tab is selected by default.

One way to do this is to allow the default tab to be specified by its 1-based index in the list.

[tabs,default=2]
====
Tab A:: A
Tab B:: B
====

Another approach would be to allow the default tab to be specified by its ID:

[tabs#tabs,default=#tabs_tab_a]
====
Tab A:: A
Tab B:: B
====

(This becomes simpler if each tab can be assigned an explicit ID, as proposed in #57).

Yet another approach would be to allow the default tab to be specified by its label:

[tabs,default=Tab A]
====
Tab A:: A
Tab B:: B
====

However, this is tricky for a number of reasons. The first is that the label may include non-text content or formatting that makes matching difficult. A possible approach here would be to compare the AsciiDoc source of both values, perhaps after removing a leading anchor. It's certainly possible, but just gets kind of messy. I'd like to get some feedback about whether anyone would actually want this approach before spending the time to implement it.

@mojavelinux mojavelinux added the enhancement New feature or request label May 22, 2023
@ioannisstavrakakis
Copy link

I think approaches 1 and 2 should suffice.

@cunka
Copy link

cunka commented Jul 23, 2023

I like the 1st option of the numerical index.

The reason is its clear and obvious to a generic basic user of the language.
Thats not to say that options 2 and 3 are not useful.

The 3rd option could come unstuck when the tab names are a few words long.

Targeting by ID is that next level of being specific and would be something that should be considered when use cases are presented. (e.g. styling to a convention, or a set of branding guidelines)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants