hgiesel / closet

The Web Framework for Flashcards
https://closetengine.com
GNU General Public License v3.0
65 stars 6 forks source link

Easier delimiters #55

Open hgiesel opened 3 years ago

hgiesel commented 3 years ago

47

Still would like to see if a simpler alternative to separated logic exists, one that wouldn't require many special character delimiters for every cmd.

[[c1::correct answer::hint]]
[[c1 "correct answer" hint]]
[[c1 correct answer, hint]]

// or

[[mc1 correct1 correct2 _ false1 "false 2"]]
[[mc1::correct1||correct2::false1||false 2]]

// or

[[foo named=arg]]
hgiesel commented 3 years ago

It would be nice if this syntax could also be carried to block content

[[:else]]
hgiesel commented 3 years ago

Maybe allow different modes:

[[c1:: -> delimiter style [[c1, -> comma style [[c1 -> whitespace style

separated could choose the correct mode:

[[c1::the answer::the hint]]
[[c1, the answer, the hint]]
[[c1 "the answer" "the hint"]]

[[mc1::answer 1||answer 2::wrong 1||wrong 2]]
[[mc1, answer 1, answer 2; wrong 1, wrong 2]]
[[mc1 "answer 1" "answer 2" _ "wrong 1" "wrong 2"]]