-
Notifications
You must be signed in to change notification settings - Fork 7
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
Support to extra field in Cloze note type #47
base: master
Are you sure you want to change the base?
Conversation
Thanks for sending this over! I will take a look at it and most likely integrate this into some other changes I'm making when I get a chance to dive into TiddlyRemember stuff. Guessing that will be sometime next week. Looking at what you have off the top of my head, changing the order of the arguments to the macro in TiddlyWiki isn't a good idea since it will break users with existing positional parameters, and I want to pull in some code from the sister project LPCG to allow updating existing note types in Anki (rather than creating an entirely new note type) when there is a simple, backwards-compatible change like this one. This is a great start though. |
…o support extra field.
I changed the implementation to avoid legacy issues. So I added instead the
|
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.
Marking this as a comment since I need to put together some new code myself before this can be finished up. Feel free to look at the comments other than the note-type-upgrading one anytime, and thanks for working on this!
@@ -336,8 +340,8 @@ class TiddlyRememberClozeTemplate(TemplateData): | |||
</div> | |||
""" | |||
|
|||
name = "TiddlyRemember Cloze v1" | |||
fields = ("Text", ID_FIELD_NAME, "Wiki", "Reference", "Permalink") | |||
name = "TiddlyRemember Cloze v2" |
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.
Like I mentioned, I don't want this to be a separate note type. I'll dive into implementing upgrades over the next couple of days and get back to you.
<$list filter="[[$mode$]!match[inline]]" variable=_> | ||
<$macrocall $name=twRememberClozeBlock id=<<__id__>> text=<<__text__>> reference=<<__reference__>>/> | ||
</$list> | ||
<$macrocall $name=remembercze id=<<__id__>> text=<<__text__>> extra="" mode=<<__mode__>> reference=<<__reference__>>/> |
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.
Oh, I was expecting to do this differently...rather than creating an entirely new macro, just put the new field at the end of the argument list. Like
\define remembercz(id, text, mode: "block", reference: "", extra:"")
Then it would be backwards compatible and we wouldn't have to add in an extra stub and change the macro button to insert something new. It's still easy to use without specifying a mode or reference...
<<remembercz "20200101120000000" "This is my {test} cloze." extra:"Extra content goes here.">>
Unless you see some reason that doesn't work?
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 did on this way just to avoid to put the "extra:", but I think it is only trivial detail. Your proposal looks cleaner.
Co-authored-by: Soren Bjornstad <[email protected]>
Quick (and dirty) implementation of #36.
extra
parameter to theremembercz
macro.