<commit_before>extends ./layout.jade

//- playlists
mixin PlaylistIndex(playlist)
  .playlist
    li(data-i18n="title=layout.clickToExpand" title=t('layout.clickToExpand') id=playlist.id)
      .icon
      .name= playlist.name

    each lesson in playlist.lessons
      -
        attrs = { style: 'display:none',
                  class: playlist.id +' level-'+ lesson.level }
      +Lesson(lesson, attrs)

//- levels
mixin LevelIndex(level, lessons)
  .level.col-xs-12.col-sm-6(id=name)
    -levelName = 'layout.levelNames.' + level
    -dataLevelName = 'html=' + levelName
    h2.clearfix(class='level-' + level data-i18n=dataLevelName)
      = t(levelName)

    //- all lessons which does not have `indexed: false`
    each lesson in lessons
      +Lesson(lesson)

// lesson
mixin Lesson(lesson, attrs)
  -attrs = attrs || {}
  //- if external tag set, use that as link
  -link = lesson.external || relative(lesson.link).replace(/\.md$/, '.html')
  a(href=link)
    li.lesson&attributes(attrs)= lesson.title
      if lesson.readme
        span.readme(
          href=relative(lesson.readme)
          data-i18n="title=layout.teacherNotes"
          title=t('layout.teacherNotes')
        )
        // click -> js redirect to readme
      if lesson.external
        span.external

<commit_msg>sort lessons by filename in lesson index<commit_after>extends ./layout.jade

//- playlists
mixin PlaylistIndex(playlist)
  .playlist
    li(data-i18n="title=layout.clickToExpand" title=t('layout.clickToExpand') id=playlist.id)
      .icon
      .name= playlist.name

    each lesson in playlist.lessons
      -
        attrs = { style: 'display:none',
                  class: playlist.id +' level-'+ lesson.level }
      +Lesson(lesson, attrs)

//- levels
mixin LevelIndex(level, lessons)
  // sort lessons by filename
  -lessons = _.sortBy(lessons, 'link')
  .level.col-xs-12.col-sm-6(id=name)
    -levelName = 'layout.levelNames.' + level
    -dataLevelName = 'html=' + levelName
    h2.clearfix(class='level-' + level data-i18n=dataLevelName)
      = t(levelName)

    //- all lessons which does not have `indexed: false`
    each lesson in lessons
      +Lesson(lesson)

// lesson
mixin Lesson(lesson, attrs)
  -attrs = attrs || {}
  //- if external tag set, use that as link
  -link = lesson.external || relative(lesson.link).replace(/\.md$/, '.html')
  a(href=link)
    li.lesson&attributes(attrs)= lesson.title
      if lesson.readme
        span.readme(
          href=relative(lesson.readme)
          data-i18n="title=layout.teacherNotes"
          title=t('layout.teacherNotes')
        )
        // click -> js redirect to readme
      if lesson.external
        span.external


{'fraction_non_alphanumeric': 0.1340282948622487, 'fraction_numerical': 0.007446016381236039, 'mean_word_length': 2.5636604774535807, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3796167', 'n_tokens_mistral': 908, 'n_tokens_neox': 888, 'n_words': 189}