Skip to content
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: parse and validate frontmatter metadata #28

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

MarkoSagadin
Copy link
Collaborator

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: #11

Note

This PR was branched out from #27 PR. #27 should be first merged, and then this PR will show valid changes.

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
@MarkoSagadin MarkoSagadin changed the title Feature/frontmatter feat: parse and validate frontmatter metadata Feb 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

Adding metadata to markdown input files
1 participant