feat: parse and validate frontmatter metadata#28
Open
MarkoSagadin wants to merge 2 commits into
Open
Conversation
43196fe to
987cafa
Compare
987cafa to
8782125
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.
It is now expected that every markdown document contains frontmatter block with three required fields: - deck_name, - note_type_basic and - note_type_clozes tags and no_tabs fields are optional. Currently only no_tabs field is actually used. Closes: Mochitto#11
8782125 to
8b44975
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It is now expected that every markdown document contains frontmatter
block with three required fields:
tags and no_tabs fields are optional. Currently only no_tabs field is
actually used.
Closes: #11
Note
This PR was branched out from #27 PR. #27 should be first merged, and then this PR will show valid changes.