diff --git a/pages/01-one.md b/pages/01-one.md index 9857e506196cf33aa47efc55270ebbe129dc1e0e..ca4dc268d6b1539b9c418bc9c33993ebebd9c70e 100644 --- a/pages/01-one.md +++ b/pages/01-one.md @@ -4,7 +4,7 @@ title: Lesson Title subtitle: Topic Title One minutes: 10 --- -> ## Learning Objectives {.objectives} +> ## Learning Objectives > > * Learning objective 1 > * Learning objective 2 diff --git a/pages/02-two.md b/pages/02-two.md index b3fdb641a980390f5adf514f8f38b8baaceafeb0..0412d1bb186e0dc2d7bba0c31f4d1b0c242f6441 100644 --- a/pages/02-two.md +++ b/pages/02-two.md @@ -4,7 +4,7 @@ title: Lesson Title subtitle: Topic Title Two minutes: 10 --- -> ## Learning Objectives {.objectives} +> ## Learning Objectives > > * Learning objective 1 > * Learning objective 2 diff --git a/tools/blockquote2div.py b/tools/blockquote2div.py index 6e20af0dec5f40cf38c0a1679e9aa7fe2957e8d1..5212c568bd47394c9b7cfac6a76436accd8fb4b5 100755 --- a/tools/blockquote2div.py +++ b/tools/blockquote2div.py @@ -8,10 +8,11 @@ Usage: A blockquote will be converted if -1. it begins with a header -2. that header has attributes -3. those attributes contain a single class -4. that class is one of ['objectives', 'callout', 'challenge'] +1. it begins with a header +2. that + 1. match "Prerequisites", "Objectives" or + 2. has attributes containing a single class matching + one of ['callout', 'challenge'] For example, this is a valid blockquote: @@ -36,12 +37,13 @@ import pandocfilters as pf # These are classes that, if set on the title of a blockquote, will # trigger the blockquote to be converted to a div. -special_classes = ['objectives', 'callout', 'challenge'] +SPECIAL_CLASSES = ['callout', 'challenge'] # These are titles of blockquotes that will cause the blockquote to # be converted into a div. They are 'title': 'class' pairs, where the # 'title' will create a blockquote with the corresponding 'class'. -special_titles = {'prerequisites': 'prereq'} +SPECIAL_TITLES = {'prerequisites': 'prereq', + 'learning objectives': 'objectives'} def find_header(blockquote): @@ -88,11 +90,11 @@ def blockquote2div(key, value, format, meta): id, classes, kvs = attr ltitle = pf.stringify(inlines).lower() - if ltitle in special_titles: - classes.append(special_titles[ltitle]) + if ltitle in SPECIAL_TITLES: + classes.append(SPECIAL_TITLES[ltitle]) return pf.Div(attr, blockquote) - elif len(classes) == 1 and classes[0] in special_classes: + elif len(classes) == 1 and classes[0] in SPECIAL_CLASSES: remove_attributes(blockquote) # a blockquote is just a list of blocks, so it can be # passed directly to Div, which expects Div(attr, blocks)