Code tabs from sphinx-tabs don't render
See original GitHub issueDescribe the bug
When using code-tabs from the sphinx-tabs
package:
- reStructuredText for the tabs is generated and displayed, but is not rendered
- the code is displayed within a
highlight
box but without the appropriate syntax highlighting
The tabs are rendered as:
.. tab:: {“tab_id”: “UHl0aG9u”, “classes”: [“code-tab”]} Python
.. code-block:: py
# Code is displayed within a highlight box here
I doubt that this is related, but there is 1 warning when building the minimal example book with or without tabs:
[31;01mWARNING: unsupported theme option 'number_toc_sections' given[39;49;00m
See this example repo.
To Reproduce
- Add the extension:
sphinx:
extra_extensions:
- sphinx_tabs.tabs
- Include code-tab syntax in a
.md
file within the book. For example:
````{tabs}
```{code-tab} py
def main():
return
```
```{code-tab} c
int main(const int argc, const char **argv) {
return 0;
}
```
````
- Build the book using
jb build .
Expected behavior I expect this to render as grouped tabs, with the code syntax highlighted as appropriate.
Environment (please complete the following information):
- Python Version: 3.7.7
- sphinx-tabs: 1.1.13
- Jupyter Book: 0.7.1
- MyST-NB: 0.8.4
- Sphinx Book Theme: 0.0.31
- MyST-Parser: 0.9.0
- Jupyter-Cache: 0.2.2
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Sphinx Tabs — sphinx-tabs documentation
A common use of group tabs is to show code examples in multiple programming languages. The code-tab directive creates a group tab and...
Read more >sphinx-code-tabs - PyPI
This is a Sphinx extension that adds a tabs directive for creating a tabbed widget, allowing the user to switch between them.
Read more >How do I get Sphinx code blocks working as tabs?
I found I needed extra lines everywhere, and; for code especially, the code-block tag is great! (otherwise just go with tab ). .....
Read more >Async tab switcher — Firefox Source Docs documentation
At a very high level, the async tab switcher is responsible for telling tabs with out-of-process (or “remote”) <xul:browser> 's to render and...
Read more >Advanced Sphinx usage - Jupyter Book
For example, here is a rendered version of the tab code pasted above: First two tabs showing off defining a function. Python. def...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Exactly what I was looking for - thanks very much for your help with all of this!
Ah that makes sense! Odd that the standard
tabs
do supportMarkdown
, but not the grouped versions.Thanks for this. 1 works perfectly, I look forward to 2, and will follow up 3 on
sphinx-tabs
.