tsui-david / system-design-course

A system design course repo
1 stars 0 forks source link

Python Parser to convert annotations to json #2

Open tsui-david opened 3 years ago

tsui-david commented 3 years ago

Summary

We want the parser to handle parsing the video annotations. It should handle all the @ tags:

  1. @lesson_id:<id> describes the id of the lesson and helps to generate the path to the lesson. A path generated might look like: http://www.systemdesigncourse.com/lessons/<id>
  2. @lesson_title:<title> describes the title that will be at the top of the lesson
  3. @video_url:<url> will hold the youtube url to embed into the webpage
  4. @question will have the question for the lesson. Can have several questions per lesson
  5. @hint will be shown as possible hints to guide the user before showing the answer
  6. @answer answer for the question immediately above it
  7. @link:[](<id>): create a link to the lesson id. If you leave the text in [] blank, the web page will replace it with the lesson_title of that lesson.

As well, the schema of the JSON would be:

{
    "Lesson": {
        "lesson_id": "",
        "lesson_title": "",
        "video_url": "",
        "questions": [
            {
                "question": "",
                "hints": [],
                "answer": ""
            }
        ]
    }
}

This will be stored under one file: /webui/generated/lessons.json

binglin1 commented 3 years ago

its done, yay

tsui-david commented 3 years ago

did you make a pr? or did you push this?