created: 20200510004110231
modified: 20200730205800000
tags: $:/tags/Macro
title: $:/plugins/sobjornstad/TiddlyRemember/macros/remember
type: text/vnd.tiddlywiki

\define remembertwo(id, reference)
	<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>
\end

\define rememberq(id, question, answer, reference: "")
    <div class="rememberq remembertwo">
        <div class="rquestion tr-ritem">
            <div>Q:</div>
            <p>$question$</p>
        </div>
        <div class="ranswer tr-ritem">
            <div>A:</div>
            <p>$answer$</p>
        </div>
		<$macrocall $name=remembertwo id=<<__id__>> reference=<<__reference__>>/>
    </div>
\end

\define rememberp(id, first, second, reference: "")
    <div class="rememberp remembertwo">
        <div class="rfirst tr-ritem">
            <div>1:</div>
            <p>$first$</p>
        </div>
        <div class="rsecond tr-ritem">
            <div>2:</div>
            <p>$second$</p>
        </div>
		<$macrocall $name=remembertwo id=<<__id__>> reference=<<__reference__>>/>
    </div>
\end

\define remembercz(id, text, mode: "block", reference: "")
	<$list filter="[[$mode$]match[inline]]">
		<$macrocall $name=twRememberClozeInline id=<<__id__>> text=<<__text__>> reference=<<__reference__>>/>
	</$list>
	<$list filter="[[$mode$]!match[inline]]">
		<$macrocall $name=twRememberClozeBlock id=<<__id__>> text=<<__text__>> reference=<<__reference__>>/>
	</$list>
\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>
\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