diff options
Diffstat (limited to 'theme')
-rw-r--r-- | theme/assets/print.css | 2 | ||||
-rw-r--r-- | theme/stylesheets/print.less | 5 | ||||
-rw-r--r-- | theme/templates/page.html | 13 |
3 files changed, 18 insertions, 2 deletions
diff --git a/theme/assets/print.css b/theme/assets/print.css index 978ccb7..25e9410 100644 --- a/theme/assets/print.css +++ b/theme/assets/print.css @@ -1 +1 @@ -h1,h2{page-break-after:avoid;page-break-before:auto}pre,blockquote{border:1px solid #999;page-break-inside:avoid}img{max-width:100%!important;page-break-inside:avoid}section{page-break-after:always}section#cover{padding:3cm 0;text-align:center}section#cover h1{font-size:1.5cm}section#summary{text-align:center}section#summary ul{font-size:.5cm;line-height:1.8em;padding:0;margin:0;list-style:none}section#summary>ul>li{margin-bottom:1cm}section#summary>ul>li>a{font-size:.6cm}section article{margin:1.5cm}section article.new-chapter{page-break-after:always;font-size:.6cm;text-align:center;padding:3cm 0;border-top:1px solid #ccc}@media print{section article.new-chapter{border:0}}
\ No newline at end of file +h1,h2{page-break-after:avoid;page-break-before:auto}pre,blockquote{border:1px solid #999;page-break-inside:avoid}img{max-width:100%!important;page-break-inside:avoid}section{page-break-after:always}section#cover{padding:3cm 0;text-align:center}section#cover h1{font-size:1.5cm}section#summary{text-align:center}section#summary ul{font-size:.5cm;line-height:1.8em;padding:0;margin:0;list-style:none}section#summary>ul>li{margin-bottom:1cm}section#summary>ul>li>a{font-size:.6cm}section article{margin:1.5cm}section article.new-chapter{page-break-after:always;font-size:.6cm;text-align:center;padding:3cm 0;border-top:1px solid #ccc}@media print{section article.new-chapter{border:0}}section article .exercise{border:3px solid #ddd}
\ No newline at end of file diff --git a/theme/stylesheets/print.less b/theme/stylesheets/print.less index 31b6f52..1c59ce6 100644 --- a/theme/stylesheets/print.less +++ b/theme/stylesheets/print.less @@ -63,5 +63,10 @@ section { border: none; } } + + .exercise { + border: 3px solid #ddd; + + } } }
\ No newline at end of file diff --git a/theme/templates/page.html b/theme/templates/page.html index dd36f3c..a65acaf 100644 --- a/theme/templates/page.html +++ b/theme/templates/page.html @@ -7,7 +7,7 @@ <link rel="stylesheet" href="{{ staticBase }}/print.css"> {% endblock %} - +{% set exercise = 0 %} {% block content %} {# Cover #} <section id="cover"> @@ -53,6 +53,17 @@ {% for section in pages[article.path].content %} {% if section.type == "normal" %} {% autoescape false %}{{ section.content }}{% endautoescape %} + {% elif section.type == "exercise" %} + <div class="exercise"> + <div class="exercise-header">Exercise #{{ exercise }}</div> + {% autoescape false %}{{ section.content }}{% endautoescape %} + <pre> + <code> + {% autoescape false %}{{ section.code.base|code }}{% endautoescape %} + </code> + </pre> + {% set exercise = exercise + 1 %} + </div> {% endif %} {% endfor %} </article> |