question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Code tabs from sphinx-tabs don't render

See original GitHub issue

Describe 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: WARNING: unsupported theme option 'number_toc_sections' given

See this example repo.

To Reproduce

  1. Add the extension:
sphinx:
  extra_extensions:
    - sphinx_tabs.tabs
  1. 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;
    }
```

````
  1. 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:closed
  • Created 3 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
foster999commented, Jul 22, 2020

Exactly what I was looking for - thanks very much for your help with all of this!

1reaction
foster999commented, Jul 17, 2020

Ah that makes sense! Odd that the standard tabs do support Markdown, but not the grouped versions.

Thanks for this. 1 works perfectly, I look forward to 2, and will follow up 3 on sphinx-tabs.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found