diff --git a/_plugins/attach_raw_tag.rb b/_plugins/attach_raw_tag.rb new file mode 100644 index 0000000000000000000000000000000000000000..519c1c02338f48b6c11abbceebd6431c4438abd2 --- /dev/null +++ b/_plugins/attach_raw_tag.rb @@ -0,0 +1,20 @@ +module Jekyll + class RawTag < Liquid::Block + def parse(tokens) + @nodelist ||= [] + @nodelist.clear + + while token = tokens.shift + if token =~ FullToken + if block_delimiter == $1 + end_tag + return + end + end + @nodelist << token if not token.empty? + end + end + end + end + + Liquid::Template.register_tag('raw', Jekyll::RawTag) \ No newline at end of file diff --git a/course/adding_a_quiz.md b/course/adding_a_quiz.md index 8a6e09d8e5f8f7b592dcd9bf388760c9610c4db3..fb1d2ddabd8b0eb53a8e14c3a16aecdf3ec8ff5e 100644 --- a/course/adding_a_quiz.md +++ b/course/adding_a_quiz.md @@ -39,7 +39,7 @@ We just created our first multiple choice quiz! To add it to our site, we'll get the `markdown` we got from the **Live Editor** and surround it with the `{% quiz %} {% endquiz %}` tags: ```markdown -{{ "{{ quiz " }}}} +{% raw %}{% quiz %}{% endraw %} --- primary_color: steelblue secondary_color: '#e8e8e8' @@ -59,7 +59,7 @@ Which of these are `git` commands? - [ ] git delete - [x] git commit - [ ] git pop -{{ "{{ endquiz " }}}} +{% raw %}{% endquiz %}{% endraw %} ``` This quiz will end up looking something like this: @@ -91,7 +91,7 @@ Which of these are `git` commands? You can add multiple questions to your quiz: just add the `markdown` underneath your previous quiz! ```markdown -{{ "{{ quiz " }}}} +{% raw %}{% quiz %}{% endraw %} --- primary_color: steelblue secondary_color: '#e8e8e8' @@ -124,7 +124,7 @@ How can you modify your latest commit message? 1. [ ] git modify_commit_message 1. [ ] git restore -{{ "{{ endquiz " }}}} +{% raw %}{% endquiz %}{% endraw %} ``` Click on **Next** to move to the second question! diff --git a/course/adding_content.md b/course/adding_content.md index e181bdc0a0febbb99687f36f3e66aeddf4ff089e..d8db83f893f72441e6fec59ac1bbe66d0b7bfd4c 100644 --- a/course/adding_content.md +++ b/course/adding_content.md @@ -46,7 +46,7 @@ If you want to attach a file, you'll have to store it first. You can use of the one *directories* in the `attached_files/` directory. Let's add a `.pdf` file to our course: we'll have to store it in the `attached_files/pdf` directory. -`{% attach_file {"file_name": "pdf/pro_git.pdf", "title":"Click here to download the Pro Git book"} %}` +`{% raw %}{% attach_file {"file_name": "pdf/pro_git.pdf", "title":"Click here to download the Pro Git book"} %}{% endraw %}` Here's our page after adding all the content we previously mentioned: diff --git a/course/adding_slides.md b/course/adding_slides.md index d367fd987255156d5f0f6db0841b2f141dd5e4ed..4f94cb87b57c50abc588902649299e05f65279b2 100644 --- a/course/adding_slides.md +++ b/course/adding_slides.md @@ -51,7 +51,7 @@ Distributed means that all users have a copy of the repository instead of a cent Now we can attach our slides like we learned: -`{% attach_file {"file_name": "slides_markdown/git_slides.pdf", "title":"Git slide deck"} %}` +`{% raw %}{% attach_file {"file_name": "slides_markdown/git_slides.pdf", "title":"Git slide deck"} %}{% endraw %}` ## Customizing your slides