memory-cards / rfcs

1 stars 0 forks source link

Markdown as basic format for cards #1

Closed vvscode closed 6 years ago

vvscode commented 6 years ago

I propose to use markdown as the default cards format. For me - common fields for any cards should be - title, description, topics, tags and after that custom body depends on card format.

Title / description just for info. They might not be used on rendering card, but they might be useful for comments.

So it might be like next ( https://github.com/remarkjs/remark-frontmatter ):

---
title: Some card title

description: Some card description

topics: nodejs, react

tags: junior, minsk
___

Body of card below

and custom body below ( depends on card type )

zenby commented 6 years ago

Vasiliy, I completely agree with you.

vvscode commented 6 years ago

@zenby from another point of view - if we're going use yaml as a tool for cards description - we could use similar in simple language and have yaml-schema validations. That might save a lot of time on debugging for cases when we don't realize why some card hasn't been compiled

vvscode commented 6 years ago

Comparation for json/yaml / js:

{
  "type": "choose_options",
  "card": {
    "question": "What is javascript framework?",
    "answers": [
      {
        "text": "Angular",
        "correct": true
      },
      {
        "text": "Zend",
        "correct": false
      },
      {
        "text": "Пингвин",
        "correct": false
      }
    ],
    "tags": [
      "js",
      "frontend"
    ]
  }
}

type: choose_options
card:
  question: What is javascript framework?
  answers:
  - text: Angular
    correct: true
  - text: Zend
    correct: false
  - text: Пингвин
    correct: false
  tags:
  - js
  - frontend

module.exports = {
  type: "choose_options",
  card: {
    question: "What is javascript framework?",
    answers: [
      {
        text: "Angular",
        correct: true
      },
      {
        text: "Zend",
        correct: false
      },
      {
        text: "Пингвин",
        correct: false
      }
    ],
    tags: ["js", "frontend"]
  }
};
kyleshovbb commented 6 years ago

I think working with JSON will be more convenient, because YAML format is harder to read and as I understand it, we will need to install a separate library to work with it

vvscode commented 6 years ago

Current format is JSON5 - https://json5.org/

Example: https://github.com/memory-cards/cards/blob/master/general-development/s-solid-en.json5