pymdownx.tabbed is not working
See original GitHub issueI checked that…
- [Y] … the documentation does not mention anything about my problem
- [Y] … the problem doesn’t occur with the default MkDocs template
- [Y] … the problem is not in any of my customizations (CSS, JS, template)
- [Y] … there are no open or closed issues that are related to my problem
Description
Trying to display tabbed code blocks. Here is the sample code block
=== “C”
``` c
#include <stdio.h>
int main(void) {
printf("Hello world!\n");
return 0;
}
```
=== “C++”
``` c++
#include <iostream>
int main(void) {
std::cout << "Hello world!" << std::endl;
return 0;
}
```
Expected behavior
See the tabbed code block
Actual behavior
Seeing code blocks vertical aligned one after another with radio button selection
Steps to reproduce the bug
- Updated MkDocs.yaml with pymdownx.tabbed under markdown.extensions
- Added the above code blocks
- mkdocs build --clean and mkdocs serve
Package versions
- Python: 3.7.6
- Markdown==3.2.1
- MarkupSafe==1.1.1
- mkdocs==1.1.2
- mkdocs-material==6.0.2
- nltk==3.4.5
- Pygments==2.6.1 *.pymdown-extensions==8.0.1
- PyYAML==5.3.1
- six==1.14.0
- tornado==6.0.4
- markdown-blockdiag==0.7.0
Project configuration
The contents of your mkdocs.yml
site_name: Internal Docs
site_description: Documentation
site_author:
theme:
name: null
custom_dir: 'material'
favicon: 'images/logo-fiddler.png'
language: en
palette:
primary: blue
accent: blue
font:
text: Assistant
code: Roboto Mono
logo: "images/logo-white.png"
feature:
tabs: true
# UPDATE HERE FOR EACH VERSION
site_dir:
docs_dir: "docs"
use_directory_urls: true
markdown_extensions:
- admonition
- codehilite
- pymdownx.tabbed
- pymdownx.superfences
- meta
# - def_list
- footnotes
- toc:
permalink: true
- pymdownx.arithmatex
- pymdownx.betterem:
smart_enable: all
- pymdownx.caret
- pymdownx.critic
- pymdownx.details
- pymdownx.emoji:
emoji_generator: !!python/name:pymdownx.emoji.to_svg
- pymdownx.inlinehilite
- pymdownx.magiclink
- pymdownx.mark
- pymdownx.smartsymbols
- pymdownx.tasklist:
custom_checkbox: true
- pymdownx.tilde
- markdown_blockdiag
plugins:
- search
nav:
- index.md
- Single Server: onebox.md
- Cloud: basics.md
- Components: components.md
- Python Package: python-package.md
- Analytics: analytics.md
- Explain: explanation.md
- Monitor: monitoring.md
- Audit: audit.md
- Tutorial: tutorial.md
- System Requirements: system_reqs.md
#- FAQ: faq.md
#- Guides: guide.md
System information
- OS: Mac OS 10.15.7
- Browser: Chrome and Safari (same behavior)
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Tabbed - PyMdown Extensions Documentation - GitHub Pages
The aim was to solve one big problem, namely that on narrower screen sizes (like mobile), tabs are broken onto separate lines, like...
Read more >PyMdown Tabbed not working with code blocks #1762 - GitHub
When I implement tabs, as in the documentation, it creates the tabs but does not correctly format the code in them. Documentation example:...
Read more >Tabbed does not generate tabbed code for mkdocs
I have recently update python (to 3.7.2), mkdocs (3.2) and pymdown-extensions (7.1). Since then, my tabbed code no longer work. Previously, tabbed code...
Read more >Using mkdocs failed loading extension pymdownx despite it ...
Error: Failed loading extension "pymdownx.tabbed".` caused by the given configuration of the project in its mkdocs.yml file.
Read more >Tabs in markdown - FabLab Kannai - Fab Academy 2022
Tabs in markdown¶. Setup¶. In mkdocs.yml, Add the following PyMdown under markdown_extensions: - pymdownx.tasklist: custom_checkbox: true ...
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
Hi Martin Thanks for pointing to the outdated config. I was able to resolve the tabbed code block issue. The reason was that had the ‘custom_dir’ was set to ‘material’ which was older version. Once I got the latest repo from git, I was able to see the tabs working. Appreciate your help. Thank You!
Are your codeblocks correctly indented? See https://squidfunk.github.io/mkdocs-material/reference/content-tabs/#grouping-code-blocks