-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: make it possible to disable tabs via frontmatter #27
base: main
Are you sure you want to change the base?
Conversation
2915cec
to
bcea602
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change looks good; added a comment on the name of the added classes :)
Might also want to add the option to the README and the CHANGELOG so users can get to know and use this feature in the next release.
@@ -110,3 +110,34 @@ | |||
@media (min-aspect-ratio: 1/1) | |||
max-width: 70vw | |||
padding: 35px 25px | |||
|
|||
.body |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think .card-body could be better; there's a tag in HTML and it could look like we are styling that, instead of styling the card itself :)
Avoid .card as that's a reserved class used by anki
With this change is now possible to disable presence of tabs, by adding the below frontmatter snippet to the top of the markdown file: --- no_tabs: True --- If present then: - 'L', 'R', '-', '+' tab flags are ignored, only 'F' and 'B' matter. - Tab labels don't matter To avoid possible styling interference two new classes were created: body and body__content. They are a direct copy of the tab__body and tab__body_content classes, only that their display property is set to 'flex' instead of none. The python code now generates the html out of markdown as it would normally and wraps content in the above two mentioned containers. That way no tab-related styling is present. Finally, all the changes in the main.ts make the presence of the .tab_group selector optional. If not found then no extra logic is enabled and content is present on single page.
bcea602
to
d98202b
Compare
I have renamed the CSS class and added entries to README and CHANGELOG. Tell me what you think :) |
With this change is now possible to disable presence of tabs, by adding the below frontmatter snippet to the top of the markdown file:
no_tabs: True
If present then:
To avoid possible styling interference two new classes were created: body and body__content. They are a direct copy of the tab__body and tab__body_content classes, only that their display property is set to 'flex' instead of none.
The python code now generates the html out of markdown as it would normally and wraps content in the above two mentioned containers. That way no tab-related styling is present.
Finally, all the changes in the main.ts make the presence of the .tab_group selector optional. If not found then no extra logic is enabled and content is present on single page.
Take this as a work in progress. The functionality is there, but there are definitely things that could be better placed or done differently. Also, some things should probably be better documented.
Please point out what needs to be improved or changed.