Is there a panel / tab implementation for this theme? #3230
Replies: 6 comments 6 replies
-
Consider Material for MkDocs. It has support for tabbed content and is often a better choice for (technical) documentations. |
Beta Was this translation helpful? Give feedback.
-
Thanks @iBug. In this case, I am doing a tutorial blog post where I showcase code. Normally when I do this, it is in only one language or technique, so hasn't been an issue in the past. This particular tutorial is showing how to do the same steps in multiple ways, which is why it would be useful. I agree that other tools are better for writing technical docs. I just happen to be doing a blog post. Perhaps I'll do separate posts and use includes for common snippets or something along those lines. |
Beta Was this translation helpful? Give feedback.
-
Decided to implement tabbed code blocks as a custom _include. Could have issues since I haven't thoroughly tested it yet, but it seems to be pretty clean so far.
|
Beta Was this translation helpful? Give feedback.
-
Thanks for this great implementation, @qiujames! How would I implement the tab data if I want it to pull from .md files in a directory rather than post's YAML header? I'd prefer to author in .md because the content I want to write up is too long to comfortably squish into a YAML header. For example, ---
title: Python
---
```python
print("Hello World");
```
Additional area under the code content where one
can add text that is also formatted in **markdown**.
You can add [links](https://qiujames.github.io/) or even images!
![birdie!](/assets/images/favicon.ico) |
Beta Was this translation helpful? Give feedback.
-
@djvill Here's a working implementation of tabbed content where the markdown contents are derived from another file. There is a slight limitation in that you can only write raw markdown in that supplemental doc, however, you can achieve the liquid front matter by just including the liquid front matter in the original document. I'll go and make another blog post that documents how this "content from a md" works and revert the changes to the original blog post, but I linked the commit that works by modifying the original blog post for now. You should see the change in the "Another Markdown" tab https://qiujames.github.io/tabbed-content-in-mm/#demo At a high level, you'll want to do the following
- title: Another Markdown
content_md: code.md
Hopefully that works alright! [0]: You can probably customize the include tag that jekyll has to read from a new directory if you really hate dirtying the _posts directory, but this implementation should be enough to get you started |
Beta Was this translation helpful? Give feedback.
-
Good news @qiujames, I've got a working tablist implementation on my fork that uses Jekyll collections--in other words, a bunch of .md files in a directory. This is a more flexible implementation of tablists that allows for arbitrary content (i.e., not just a code block then a richtext block). Within this framework, I still want to implement/figure out:
Thanks again for opening the door on this implementation! |
Beta Was this translation helpful? Give feedback.
-
Asking because I could find it useful and I swore I saw it before, but I could definitely be wrong.
I'm going to be writing a tutorial where I have different snippets for different languages at each step along the way.
I'd love to show these in some sort of a tabbed panel style format, and was wondering if this theme happened to support such a thing. As I mentioned, I thought I saw this previously listed as a feature, but I could be misremembering.
If anyone has a definitive answer on this, let me know. Other recommendations on how to achieve my goal are also welcome. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions