feat: make it possible to disable tabs via frontmatter#27
feat: make it possible to disable tabs via frontmatter#27MarkoSagadin wants to merge 1 commit intoMochitto:mainfrom
Conversation
2915cec to
bcea602
Compare
Mochitto
left a comment
There was a problem hiding this comment.
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.
| max-width: 70vw | ||
| padding: 35px 25px | ||
|
|
||
| .body |
There was a problem hiding this comment.
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
bcea602 to
d98202b
Compare
|
I have renamed the CSS class and added entries to README and CHANGELOG. Tell me what you think :) |
d98202b to
adc8db0
Compare
|
I have rebased this branch on the main and forced pushed the changes. I see that the build workflow is failing due to the deprecated action. I have opened a PR #30 fixes that. So that PR needs to be merged first, then I re-base again and then this can finally be merged. |
b857b42 to
60c796f
Compare
60c796f to
205b564
Compare
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.
205b564 to
ddb4505
Compare
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.