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

docs: support tabs #576

Merged
merged 9 commits into from
Feb 12, 2021
Merged

docs: support tabs #576

merged 9 commits into from
Feb 12, 2021

Conversation

henryiii
Copy link
Contributor

@henryiii henryiii commented Feb 4, 2021

This is a rough draft example of what tabs would look like. I've applied it to one place (GHA example), and the implementation is highly manual and not reusable, so will need to be improved if we want to go this way (@joerick might be able to be a lot more elegant at this than me :), or maybe there's a built-in tool somewhere (though I think we would need to support super fences, which we don't yet). Previously mentioned here: #567 (comment)

Thoughts? Visit the RtD PR check to view the docs, setup page. I've recently added tabs here: https://packaging.python.org/tutorials/packaging-projects/#configuring-metadata (though that was in sphinx).

@joerick
Copy link
Contributor

joerick commented Feb 6, 2021

Hey @henryiii , I hope you don't mind I had a tinker with this, thought I'd try using the markdown 'admonition' syntax, which is like

!!! tab "tab name"
    tab content

!!! tab "tab name"
    tab content

Then it's transformed into tabs with jQuery. What do you think? I also had a go at some styling, not 100% sure about that yet but there's something there.

image

To get those code snippets working inside the tabs, I also managed to get the styling of the superfences extension working (the problem before was that it was doing pygments highlighting, which wasn't supported by the theme we're using, which uses highlightjs)

@henryiii
Copy link
Contributor Author

henryiii commented Feb 6, 2021

Looks good! I can rebase and tweak a bit, then look at what else can be tabbified. Not sure if we need it, but can this do "grouped" tabs, where all matching tabs change if one changes? That could be possibly useful for the options examples, perhaps; you could select "travis" and all the examples of options change to the travis tab.

@henryiii
Copy link
Contributor Author

henryiii commented Feb 6, 2021

I've tried to unify on the same order for the CI listing, I've made the list of examples at the top of the options page tabbed (and added Gitlab CI, which was missing), and reordered/updated the original tabs to better reflect the current examples (though, I just realized, we've moved the main example to actions, so now we probably have two actions examples. Will fix later. Fixed.

@henryiii henryiii marked this pull request as ready for review February 6, 2021 23:46
@henryiii henryiii changed the title (WIP) docs: support tabs docs: support tabs Feb 6, 2021
@henryiii
Copy link
Contributor Author

henryiii commented Feb 8, 2021

I really like the tabbed options example. https://cibuildwheel--576.org.readthedocs.build/en/576/options/#setting-options :)

Screen Shot 2021-02-08 at 9 46 10 AM

henryiii added a commit that referenced this pull request Feb 8, 2021
Followup to #581 fixing two more release notes. The fence should be fixed by #576.
henryiii added a commit that referenced this pull request Feb 12, 2021
Followup to #581 fixing two more release notes. The fence should be fixed by #576.
@henryiii henryiii merged commit 58c5e56 into pypa:master Feb 12, 2021
@henryiii henryiii deleted the docs/tabs branch February 12, 2021 16:08
@henryiii
Copy link
Contributor Author

@joerick Extra important to git grep for the old version when bumping to a new version next time; it's possible a doc change (like this one) could miss a form for the version number.

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

Successfully merging this pull request may close these issues.

2 participants