Switching between subtypes
Table of contents
Switching to showing tags
This can be used to show context around clozes
/** Default cloze */
filterManager.install(
closet.recipes.cloze.show({ tagname: 'c' }),
closet.recipes.cloze.hide({ tagname: 'ch' }),
closet.recipes.cloze.reveal({ tagname: 'cr' }),
)
/** Flashcard features */
filterManager.install(
closet.recipes.activate({ tagname: 'on', storeId: 'flashcardActive' }),
closet.recipes.deactivate({ tagname: 'off', storeId: 'flashcardActive' }),
closet.wrappers.product(closet.recipes.setNumber, closet.recipes.setNumber)({
tagname: 'around',
optionsFirst: { storeId: 'flashcardActiveTop' },
optionsSecond: { storeId: 'flashcardActiveBottom' },
}),
closet.recipes.setNumber({ tagname: 'up', storeId: 'flashcardActiveTop' }),
closet.recipes.setNumber({ tagname: 'down', storeId: 'flashcardActiveBottom' }),
closet.recipes.activate({ tagname: 'show', storeId: 'flashcardShow' }),
closet.recipes.activate({ tagname: 'hide', storeId: 'flashcardHide' }),
closet.recipes.setNumber({ tagname: 'top', storeId: 'flashcardShowTop' }),
closet.recipes.setNumber({ tagname: 'bottom', storeId: 'flashcardShowBottom' }),
closet.wrappers.product(closet.recipes.setNumber, closet.recipes.setNumber)({
tagname: 'ctxt',
optionsFirst: { storeId: 'flashcardShowTop' },
optionsSecond: { storeId: 'flashcardShowBottom' },
}),
)
[[cr1::Shall I compare thee to a summer’s day?[[ctxt::cr*=2]][[up::cr*=1]]]]
[[cr2::Thou art more lovely and more temperate.]]
[[cr3::Rough winds do shake the darling buds of May,]]
[[cr4::And summer’s lease hath all too short a date.]]
[[cr5::Sometime too hot the eye of heaven shines,]]
[[cr6::And often is his gold complexion dimmed;]]
[[cr7::And every fair from fair sometime declines,]]
[[cr8::By chance, or nature’s changing course, untrimmed;]]
[[cr9::But thy eternal summer shall not fade,]]
[[cr10::Nor lose possession of that fair thou ow’st,]]
[[cr11::Nor shall death brag thou wand’rest in his shade,]]
[[cr12::When in eternal lines to Time thou grow’st.]]
[[cr13::So long as men can breathe, or eyes can see,]]
[[cr14::So long lives this, and this gives life to thee.]]
-- William Shakespeare, "Shall I Compare Thee To A Summer's Day?"