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

Use Anki tags to customize card render #32

Closed
7 tasks done
ogallagher opened this issue Feb 14, 2024 · 2 comments
Closed
7 tasks done

Use Anki tags to customize card render #32

ogallagher opened this issue Feb 14, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@ogallagher
Copy link
Owner

ogallagher commented Feb 14, 2024

If the current note's tags are available within the DOM on render, then I can support variations of fill-blanks, as well as other layouts of the same information, without needing to create duplicate notes for associating to different card templates.

  • Prefix all quizgen generated tags with qg- except those specified by the user, and those for identifying the source text.

Initial render control tags:

  • If you add the show-logging tag, then render logs can be shown in the card body.
  • If you remove the show-choices tag, then the multiple choices for the cloze are not shown.
  • If you remove the show-source-file and show-source-line tags, that section will be hidden.
  • If you remove the show-prologue tag, the preceding sentence will be hidden, and similarly for show-epilogue.
  • show-randomized shuffles the choices

Document

  • Explain render control tags in readme
@ogallagher ogallagher added the question Further information is requested label Feb 14, 2024
@ogallagher
Copy link
Owner Author

After looking at the anatomy of a rendered card in the web browser version, it does not look like the tags are available in any of the DOM elements by default.
However, I can use the {{Tags}} variable to render the tags. The tags are rendered as a single plain string, tags delimited by spaces. This should work for me as long as the tags are placed in an identified container, and any quizgen tags never contain spaces.

@ogallagher ogallagher added enhancement New feature or request and removed question Further information is requested labels Feb 16, 2024
@ogallagher
Copy link
Owner Author

Render control tags

Tags are an organizational concept already present in Anki, and the Quiz card generator (quizgen) includes them in its notes export in order to later quickly isolate notes within Anki that came from quizgen, and among them from what source texts they are. However, in addition to organizational tags, quizgen also uses card render control tags.

Render control tags serve as dynamic options to change how a note's cards are rendered.
Below is a list of supported render control tags:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant