diff --git a/tools/check b/tools/check index cef91e4439f0aaf6f1bc7a5c2e9a92d5a2314e75..5457d73910a65ded713ad7ff3599396928c6ecba 100755 --- a/tools/check +++ b/tools/check @@ -2,16 +2,16 @@ # # Software Carpentry Lesson Validator # -# Check for errors at Software Carpentry lessons. +# Check for errors in lessons built using the Software Carpentry template +# found at http://github.com/swcarpentry/lesson-template. # # Usage: # # $ tools/check +import sys import os import re -import sys - import yaml #---------------------------------------- @@ -62,14 +62,13 @@ def check_lesson(file_path): """ Checks the file ``pages/[0-9]{2}-.*.md`` for: - - "layout: topic" at YAML header - - "title" as keyword at YAML header + - "layout: topic" in YAML header + - "title" as keyword in YAML header - line "> ## Learning Objectives {.objectives}" after YAML header - - items at learning objectives begin with "*" - - items at learning objective following four space rule - - code samples be of type error, output, python, shell, r, matlab, sql + - items in learning objectives begin with "*" + - items in learning objective following four-space indentation rule + - code samples be of type input, error, output, python, shell, r, matlab, or sql - callout box style - - line with "> ## Key Points {.keypoints}" - challenge box style """ pass @@ -91,11 +90,12 @@ def check_index(file_path): - "layout: lesson" in YAML header - "title" as keyword in YAML header - - introductory paragraph right after YAML header + - introductory paragraph(s) right after YAML header - line with "> ## Prerequisites" - - non empty prerequisites - - line with "## Topics" + - non-empty prerequisites + - title line with "## Topics" - items at topic list begin with "*" + - items in topic list follow four-space indentation rule - links at topic list are valid - line with "## Other Resources" - items at other resources list begin with "*"