Link Search Menu Expand Document

Activating selectively

Table of contents

  1. Selectively activating tags
    1. Using occurrence numbers
  2. Evaluation order

Selectively activating tags

You can largely change which cards are considered active, using activation and deactivation tags. This is especially useful when you use card sections (TODO).

/** 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' },
  }),
)

/** Default cloze */
filterManager.install(
  closet.recipes.cloze.show({ tagname: 'c' }),
  closet.recipes.cloze.hide({ tagname: 'ch' }),
  closet.recipes.cloze.reveal({ tagname: 'cr' }),
)
The four major dopaminergic pathways:
* [[c1::Mesolimbic pathway::starts with M[[on::c4;c5;c6]]]]
* [[c2::Mesocortical pathway]]
* [[c3::Nigostriatal pathway::starts with N]]
* [[c4::Tuberoinfundibular pathway]]
* [[c5::Hypothalamospinal projection]]
* [[c6::Incertohypothalamic pathway]]

Using occurrence numbers

Using the notation fulltag:occurence, you can go into more detail when specifying clozes. All tags are enumerated while they are generated, starting at 0. This way you can specifically choose which cloze to activate, even if they share the same name.

/** 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' },
  }),
)

/** Default cloze */
filterManager.install(
  closet.recipes.cloze.show({ tagname: 'c' }),
  closet.recipes.cloze.hide({ tagname: 'ch' }),
  closet.recipes.cloze.reveal({ tagname: 'cr' }),
)
The four major dopaminergic pathways:
* [[c1::Mesolimbic pathway::starts with M[[on::c1:0;c2:0;c3:0]]]]
* [[c1::Mesocortical pathway]]
* [[c2::Nigostriatal pathway::starts with N]]
* [[c2::Tuberoinfundibular pathway]]
* [[c3::Hypothalamospinal projection]]
* [[c3::Incertohypothalamic pathway]]

Evaluation order

However keep in mind that tags are evaluated in a certain order. You need to use the activation tag, before you

/** 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' },
  }),
)

/** Default cloze */
filterManager.install(
  closet.recipes.cloze.show({ tagname: 'c' }),
  closet.recipes.cloze.hide({ tagname: 'ch' }),
  closet.recipes.cloze.reveal({ tagname: 'cr' }),
)
The four major dopaminergic pathways:
* [[c1::Mesolimbic pathway::starts with M[[on::c1:0;c2:0;c3:0]]]]
* [[c1::Mesocortical pathway[[off::c1:0;c2:0]]]]
* [[c2::Nigostriatal pathway::starts with N]]
* [[c2::Tuberoinfundibular pathway]]
* [[c3::Hypothalamospinal projection]]
* [[c3::Incertohypothalamic pathway]]