-
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?
Changes from all commits
eeccc3f
6c663cc
da9f72a
6af5d66
c65d563
0e5ec36
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,47 +47,57 @@ type: text/vnd.tiddlywiki | |
\end | ||
|
||
\define remembercz(id, text, mode: "block", reference: "") | ||
<$list filter="[[$mode$]match[inline]]" variable=_> | ||
<$macrocall $name=twRememberClozeInline id=<<__id__>> text=<<__text__>> reference=<<__reference__>>/> | ||
</$list> | ||
<$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 commentThe 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
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...
Unless you see some reason that doesn't work? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
\end | ||
|
||
\define twRememberClozeBlock(id, text, reference) | ||
<div class="remembercz"> | ||
<span class="cloze-identifier">cloze: </span> | ||
<span class="cloze-text">$text$</span> | ||
<div class="tr-selfidentification"> | ||
<$set name="selfid" filter="""[enlist[$reference$]]""" value="""[<$link to="$reference$">$reference$</$link>: $id$]""" emptyValue="[$id$]"> | ||
<<selfid>> | ||
</$set> | ||
</div> | ||
<div class="rid"> | ||
[$id$] | ||
</div> | ||
<div class="tr-reference"> | ||
<$text text=<<__reference__>>/> | ||
</div> | ||
</div> | ||
\define remembercze(id, text, extra: "",mode: "block", reference: "") | ||
<$list filter="[[$mode$]match[inline]]" variable=_> | ||
<$macrocall $name=twRememberClozeInline id=<<__id__>> text=<<__text__>> reference=<<__reference__>>/> | ||
</$list> | ||
<$list filter="[[$mode$]!match[inline]]" variable=_> | ||
<$macrocall $name=twRememberClozeBlock id=<<__id__>> text=<<__text__>> extra=<<__extra__>> reference=<<__reference__>>/> | ||
</$list> | ||
\end | ||
|
||
\define twRememberClozeBlock(id, text, extra, reference) | ||
<div class="remembercz"> | ||
<span class="cloze-identifier">cloze: </span> | ||
<span class="cloze-text">$text$</span> | ||
<$list filter="[[$extra$]!match[]]" variable=_> | ||
<br> | ||
<span class="cloze-identifier">extra: </span> | ||
</$list> | ||
<span class="cloze-extra">$extra$</span> | ||
<div class="tr-selfidentification"> | ||
<$set name="selfid" filter="""[enlist[$reference$]]""" value="""[<$link to="$reference$">$reference$</$link>: $id$]""" emptyValue="[$id$]"> | ||
<<selfid>> | ||
</$set> | ||
</div> | ||
<div class="rid"> | ||
[$id$] | ||
</div> | ||
<div class="tr-reference"> | ||
<$text text=<<__reference__>>/> | ||
</div> | ||
</div> | ||
\end | ||
|
||
\define twRememberClozeInline(id, text, reference) | ||
<span class="remembercz"> | ||
<span class="cloze-identifier">{cloze: </span> | ||
<span class="cloze-text">$text$</span> | ||
<span class="cloze-identifier">}</span> | ||
<div class="tr-selfidentification"> | ||
<$set name="selfid" filter="""[enlist[$reference$]]""" value="""[<$link to="$reference$">$reference$</$link>: $id$]""" emptyValue="[$id$]"> | ||
<<selfid>> | ||
</$set> | ||
</div> | ||
<div class="rid"> | ||
[$id$] | ||
</div> | ||
<div class="tr-reference"> | ||
<$text text=<<__reference__>>/> | ||
</div> | ||
</span> | ||
\end | ||
<span class="remembercz"> | ||
<span class="cloze-identifier">{cloze: </span> | ||
<span class="cloze-text">$text$</span> | ||
<span class="cloze-extra"/> | ||
<span class="cloze-identifier">}</span> | ||
<div class="tr-selfidentification"> | ||
<$set name="selfid" filter="""[enlist[$reference$]]""" value="""[<$link to="$reference$">$reference$</$link>: $id$]""" emptyValue="[$id$]"> | ||
<<selfid>> | ||
</$set> | ||
</div> | ||
<div class="rid"> | ||
[$id$] | ||
</div> | ||
<div class="tr-reference"> | ||
<$text text=<<__reference__>>/> | ||
</div> | ||
</span> | ||
\end |
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.