GithubHelp home page GithubHelp logo

bestian / edu-lang Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 0.0 25.78 MB

一種專門為了教育方式或學習方法分享而設計的Markdown之子語言。例如:「步驟」(一種固定格式的小階梯說明文) meta languages for edu( a set of sublanguage of Markdown ), e.x. step

Home Page: https://docs.google.com/presentation/d/1xtSwUsW4AI6fDaaFOLIFo-9NSxIbJ8Lws_w12D05ZpY/edit?usp=sharing

JavaScript 100.00%
education javascript nodejs

edu-lang's People

Contributors

bestian avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

edu-lang's Issues

inner router-link

input =>

Hello

1. welcome
2. We think [vegen is good](https://food.bestiant.tw)
3. [about_us](*about)

=====

output =>

{"intros" :  ["Hello"], "step": 
[
 { "n" : "1. welcome"}, 
 {"n": We think vegen is good", "h": "https://food.bestiant.tw"},
 {"n": about_us", "r": "about"},
 }

"r". can be used to make vue's router-link

allow hashtags

input =>

## 學習料理的步驟
學習料理,其實很簡單

#生活 #廚藝 #抒壓

1.先在家裡廚房幫忙
2.觀察外食店家的食材搭配
3.採購的時候,幫忙一起採購 
4.可以到[自然美食DIY網站](https://food.bestian.tw)找食譜
5.可以自己研發一些料理來嘗試看看
6.還可以借圖書館的一些食譜書,學習健康飲食
7.請看[關於我們](!about)

===output===

{
  intros: [ '## 學習料理的步驟', '學習料理,其實很簡單' ],
  tags: [ '生活', '廚藝', '抒壓' ],
  steps: [
    { n: '1.先在家裡廚房幫忙' },
    { n: '2.觀察外食店家的食材搭配' },
    { n: '3.採購的時候,幫忙一起採購' },
    { h: 'https://food.bestian.tw', n: '自然美食DIY網站' },
    { n: '5.可以自己研發一些料理來嘗試看看' },
    { n: '6.還可以借圖書館的一些食譜書,學習健康飲食' },
    { r: 'about', n: '關於我們' }
  ]
}

complex step parser 在test不通過

run

npm test

resault:


> [email protected] test
> mocha



  parseMarkdownToSteps
    ✔ lines before numbers should be intros,
    lines started with numbers should be steps.
    objects in steps should have "n", perhaps have h(href) or r(inner router links)

    ✔ simple steps only.
[ '## 學習料理的步驟', '學習料理,其實很簡單' ]
    1) complex case should contain imgs.

  parseTags
    ✔ split a tags list

  mdToURI
    ✔ minify a markdown and make it to URI

  countAge
    ✔ count a child's age by birthday(like '1985-04-01')= + ' ' + countAge('1985-04-01')

  autoId
    ✔ make a autoId by name


  6 passing (17ms)
  1 failing

  1) parseMarkdownToSteps
       complex case should contain imgs.:
     AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
+ actual - expected

+ [
+   {
+     n: '1. 先在家裡廚房幫忙'
+   },
+   {
+     h: 'https://food.bestian.tw',
+     n: '2. 可以到自然美食DIY網站'
+   },
+   {
+     n: '3. 請看關於我們',
+     r: 'about'
+   },
+   imgs: [],
+   intros: [
+     '## 學習料理的步驟',
+     '學習料理,其實很簡單'
+   ],
+   title: 2
+ ]
- {
-   imgs: [],
-   intros: [
-     '學習料理,其實很簡單'
-   ],
-   steps: [
-     {
-       n: '1. 先在家裡廚房幫忙'
-     },
-     {
-       h: 'https://food.bestian.tw',
-       n: '2. 自然美食DIY網站'
-     },
-     {
-       n: '3. 關於我們',
-       r: 'about'
-     }
-   ],
-   tags: [
-     '生活',
-     '廚藝',
-     '抒壓'
-   ],
-   title: '## 學習料理的步驟'
- }
      at Context.<anonymous> (test.js:32:12)
      at process.processImmediate (node:internal/timers:476:21)
      

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.