hascard icon indicating copy to clipboard operation
hascard copied to clipboard

Add option to detect two newlines and split into question and answer

Open GrimPixel opened this issue 2 years ago • 2 comments

I would like to use a Markdown file for multiple uses by multiple programs, so there has to be other contents on it. I can't make each “#” the beginning of a question, so on the base of https://github.com/Yvee1/hascard/issues/22, I think it could work if the question and the answer are divided by two newlines in the flashcard area.

GrimPixel avatar Feb 17 '23 11:02 GrimPixel

What other uses do you have in mind for the Markdown file? I based the syntax of the cards on Markdown syntax, but focused on making questions and answers easy to read and write, rather than it rendering nicely as a Markdown file. For example a multiple answer question is written as:

# Multiple answer question
[*] Option 1 (this is a correct answer)
[ ] Option 2
[*] Option 3 (this is a correct answer)
[ ] Option 4

But it does not look nice when rendered in Markdown (see below). I don't think this can be solved easily, so if you intend to render the file I think you should look for a different solution. Maybe a script that transforms (parts of) a real Markdown file into cards and vice versa?

Multiple answer question

[] Option 1 (this is a correct answer) [ ] Option 2 [] Option 3 (this is a correct answer) [ ] Option 4

EDIT: I guess x can be used instead of * to make it a bit better:

Multiple answer question

[x] Option 1 (this is a correct answer) [ ] Option 2 [x] Option 3 (this is a correct answer) [ ] Option 4

but e.g.

# Order the letters in alphabetical order
4. u
1. l
2. p
3. s

gets rendered, weirdly, as:

Order the letters in alphabetical order

  1. u
  2. l
  3. p
  4. s

Yvee1 avatar Feb 17 '23 11:02 Yvee1

I use Markmap, markdown-anki-decks, Foam mainly. They all take # as something not to be omitted. So I think instead of

# Question
Choices

I need

---
Question

Choices
---

Or something else customisable that avoids #, like

Question
: Choices

GrimPixel avatar Feb 17 '23 16:02 GrimPixel