Hello. The flashcard support in logseq is basic and elegant, and I completely understand that trying to recreate Anki inside logseq is not advisable.
However, a simple feature could make the logseq card system far more usable, and I hope that it might be easy to implement.
It is simply to have two directional cards. That means that when you create a line that has #card2 or #cardtwo or something similar… the system creats two cards instead of just one.
So when you have card that you type in as:
[[London]] #card2
->> The capital of the UK.
This results in two flashcards, instead of one. One that prompts you with “London”… and asks you to remember “The capital of the UK” and one that says “The capital of the UK” and asks that you remember “London”.
With this small change, it is possible to immediately double the efficiency of card data entry. Obviously #card can be kept for single direction flashcards.
We can invent that #bicards
with block references now:
This is still required to make the references manually.
But it also can be automated a bit with 🏛 Full House Templates
plugin:
template code:
- template:: make bidirectional card
template-list-as:: template
- ```javascript
``{
var uuid1 = c.block.uuid
top.logseq.api.upsert_block_property(uuid1, 'id', uuid1)
var child = top.logseq.api.get_block(uuid1, {includeChildren: true}).children[0]
if (!child) {
top.logseq.api.show_msg('There is no Answer provided for this card', 'error')
return ''
}
var uuid2 = Array.isArray(child) ? child[1] : child.uuid
top.logseq.api.upsert_block_property(uuid2, 'id', uuid2)
// this line doesn't work:
// top.logseq.api.insert_batch_block(uuid1, {content: `((${uuid2})) #card`, children: [{content: `((${uuid1}))`}] }, {before: false, sibling: true})
// workaround
var block = parent.logseq.api.insert_block(uuid1, `((${uuid2})) #card`, [('sibling', true)])
top.logseq.api.insert_block(block.uuid, `((${uuid1}))`, {sibling: false})
top.logseq.api.move_block(block.uuid, uuid1, {sibling: true})
}``
#card
```
I am good with #bicard
But I would strongly prefer that this be supported natively and not with a customization.
This is pretty basic flashcard functionality, and really should be part of how it works out-of-the-box.
2 Likes