Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
8e69ca0
Change tab label font to increase contrast
foster999 Oct 8, 2020
eed883a
Rewrite to use tab roles for accessibility
foster999 Oct 11, 2020
3b16ab3
Remove semantic ui and rewrite css
foster999 Oct 11, 2020
26f7688
Rewrite JS for accesibility
foster999 Oct 11, 2020
7465fe3
Remove p tag within tab name buttons
foster999 Oct 11, 2020
d8c71ea
Add code-tab class to panels
foster999 Oct 12, 2020
4bf52e1
Fix padding around normal and code tabs
foster999 Oct 12, 2020
7ab6819
Update JS, needs fixing
foster999 Oct 12, 2020
485e8b4
Fix selectGroupedTabs for synchronised selection
foster999 Oct 12, 2020
8005531
Add changes from pre-commit
foster999 Oct 13, 2020
8fa5c49
Fix border when tablist is closed
foster999 Oct 13, 2020
4e69eea
Fix keyboard navigation of tabs
foster999 Oct 13, 2020
3825979
Fix depreciated class setting
foster999 Oct 13, 2020
f56abda
Fix non-deterministic class order
foster999 Oct 13, 2020
b7e7b3b
Regenerate test regressions
foster999 Oct 13, 2020
b7fa829
Catch sessionStorage errors
foster999 Oct 14, 2020
9fcc89b
Refactor to allow sphinx to handle assets
foster999 Oct 17, 2020
b314cda
Add doctools overide and move assets
foster999 Oct 17, 2020
d4e0abd
Regen pytest regressions
foster999 Oct 17, 2020
e2a7d3f
Changes from pre-commit
foster999 Oct 17, 2020
b93a16c
Update README with new features
foster999 Oct 17, 2020
9258ec7
Make deselected tabs transparent
foster999 Oct 17, 2020
bbd74b5
Change changeTabs js to offset change in grouped content size
foster999 Jan 6, 2021
0361d95
Remove doctools override as change is now in sphinx
foster999 Jan 24, 2021
6e59ba3
Update docs to include configuration and all features
foster999 Jan 24, 2021
1e9f6c7
Remove unused sphinx config option
foster999 Jan 24, 2021
054e8f0
Fix bad rst syntax in docs
foster999 Jan 24, 2021
9184f75
Add bottom margin to images within tabs
foster999 Jan 24, 2021
e5feb59
Fix rst syntax in docs
foster999 Jan 24, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ include LICENSE
include README.md
include CHANGELOG.md

include sphinx_tabs/tabs.js
include sphinx_tabs/tabs.css
recursive-include sphinx_tabs/semantic-ui-2.4.1 *
recursive-include sphinx_tabs *.css
recursive-include sphinx_tabs *.js
22 changes: 15 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,14 @@ Basic tabs can be coded as follows:

![Tabs](/images/tabs.gif)

The contents of each tab can be displayed by clicking on the tab that you wish to show. Clicking on the tab that is currently open will hide the tab's content, leaving only the tab set labels visible.

Alternatively, tab sets can be focused using :kbd:`Tab`. The :kbd:`Left Arrow` and :kbd:`Right Arrow` keys can then be used to navigate across the tab set and :kbd:`Enter` can be used to select a tab.

## Grouped Tabs

Tabs can be grouped, so that changing the current tab in one area changes the current tab in the
another area. For example:
Tabs can be grouped, so that changing the current tab in one tabset changes the current tab in all other tabsets containing a tab with a matching label.
For example:

```rst
.. tabs::
Expand Down Expand Up @@ -110,9 +114,12 @@ another area. For example:

![Group Tabs](/images/groupTabs.gif)

If permitted by the user's browser, the last selected group tab will be remembered when changing page. As such, if any tabsets on the next page contain a tab with the same label it will be selected.


## Code Tabs

Grouped tabs containing code areas with syntax highlighting can be created as follows:
Grouped tabs containing code with syntax highlighting can be created as follows:

```rst
.. tabs::
Expand Down Expand Up @@ -152,9 +159,11 @@ Grouped tabs containing code areas with syntax highlighting can be created as fo
END PROGRAM main
```

Code tabs also support custom lexers (added via sphinx `conf.py`).
![Code Tabs](/images/codeTabs.gif)

Code tabs also support custom lexers (added via sphinx `conf.py`). Pass the lexers alias as the first argument of `code-tab`.

By default, code tabs are labelled with the language name, though can be provided with custom labels like so:
By default, code tabs are labelled with the language name, though a custom label can be provided as an optional second argument to the `code-tabs` directive:

```rst
.. tabs::
Expand All @@ -172,8 +181,7 @@ By default, code tabs are labelled with the language name, though can be provide

```


![Code Tabs](/images/codeTabs.gif)
The tab label is used to group tabs, including `code-tabs`. As such, the same custom label should be used to group related tabs.

[github-ci]: https://github.com/executablebooks/sphinx-tabs/workflows/continuous-integration/badge.svg?branch=master
[github-link]: https://github.com/executablebooks/sphinx-tabs
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
project = "sphinx-tabs demo"
project = "sphinx-tabs"
master_doc = "index"
source_suffix = ".rst"
extensions = ["sphinx_tabs.tabs"]
Expand Down
Loading