diff options
Diffstat (limited to 'theme/templates/website/includes')
-rw-r--r-- | theme/templates/website/includes/exercise.html | 26 | ||||
-rw-r--r-- | theme/templates/website/includes/font-settings.html | 22 | ||||
-rw-r--r-- | theme/templates/website/includes/header.html | 53 | ||||
-rw-r--r-- | theme/templates/website/includes/quiz.html | 40 | ||||
-rw-r--r-- | theme/templates/website/includes/summary.html | 63 |
5 files changed, 204 insertions, 0 deletions
diff --git a/theme/templates/website/includes/exercise.html b/theme/templates/website/includes/exercise.html new file mode 100644 index 0000000..42b500f --- /dev/null +++ b/theme/templates/website/includes/exercise.html @@ -0,0 +1,26 @@ +<div class="header"> + <h2>Exercise</h2> +</div> +<div class="alert alert-success"> + <b>Correct!</b> +</div> + +<div class="alert alert-danger error-message"> + <b>False!</b> +</div> + +<div class="message"> + {% autoescape false %}{{ section.content }}{% endautoescape %} +</div> +<div class="editor" style="height: {{ section.code.solution|lines*20 }}px">{{ section.code.base }}</div> + +<pre class="hidden code-solution">{{ section.code.solution }}</pre> +<pre class="hidden code-validation">{{ section.code.validation }}</pre> +{% if section.code.context %} +<pre class="hidden code-context">{{ section.code.context }}</pre> +{% endif %} + +<div class="buttons"> + <a href="#" class="button size-2 action-submit">Submit</a> + <a href="#" class="button size-2 action-solution">Solution</a> +</div> diff --git a/theme/templates/website/includes/font-settings.html b/theme/templates/website/includes/font-settings.html new file mode 100644 index 0000000..5fa1f3e --- /dev/null +++ b/theme/templates/website/includes/font-settings.html @@ -0,0 +1,22 @@ +<div class="dropdown-menu font-settings"> + <div class="dropdown-caret"> + <span class="caret-outer"></span> + <span class="caret-inner"></span> + </div> + + <div class="buttons"> + <button type="button" id="reduce-font-size" class="button size-2">A</button> + <button type="button" id="enlarge-font-size" class="button size-2">A</button> + </div> + + <div class="buttons font-family-list"> + <button type="button" data-font="0" class="button">Serif</button> + <button type="button" data-font="1" class="button">Sans</button> + </div> + + <div class="buttons color-theme-list"> + <button type="button" id="color-theme-preview-0" class="button size-3" data-theme="0">White</button> + <button type="button" id="color-theme-preview-1" class="button size-3" data-theme="1">Sepia</button> + <button type="button" id="color-theme-preview-2" class="button size-3" data-theme="2">Night</button> + </div> +</div> diff --git a/theme/templates/website/includes/header.html b/theme/templates/website/includes/header.html new file mode 100644 index 0000000..ef2de60 --- /dev/null +++ b/theme/templates/website/includes/header.html @@ -0,0 +1,53 @@ +<div class="book-header"> + <!-- Actions Left --> + <a href="#" class="btn pull-left toggle-summary" aria-label="Toggle summary"><i class="fa fa-align-justify"></i></a> + <a href="#" class="btn pull-left toggle-search" aria-label="Toggle search"><i class="fa fa-search"></i></a> + {% if glossary.length > 0 %} + <a href="{{ basePath }}/GLOSSARY.html" class="btn pull-left" aria-label="Open Glossary"><i class="fa fa-sort-alpha-asc"></i></a> + {% endif %} + <div id="font-settings-wrapper" class="dropdown pull-left"> + <a href="#" class="btn toggle-dropdown" aria-label="Toggle font settings"><i class="fa fa-font"></i> + </a> + {% include "./font-settings.html" %} + </div> + + <!-- Actions Right --> + {% if options.links.sharing.all !== false %} + <div class="dropdown pull-right"> + <a href="#" class="btn toggle-dropdown" aria-label="Toggle share dropdown"><i class="fa fa-share-alt"></i> + </a> + <div class="dropdown-menu font-settings dropdown-left"> + <div class="dropdown-caret"> + <span class="caret-outer"></span> + <span class="caret-inner"></span> + </div> + <div class="buttons"> + <button type="button" data-sharing="twitter" class="button">Twitter</button> + <button type="button" data-sharing="google-plus" class="button">Google</button> + <button type="button" data-sharing="facebook" class="button">Facebook</button> + <button type="button" data-sharing="weibo" class="button">Weibo</button> + <button type="button" data-sharing="instapaper" class="button">Instapaper</button> + </div> + </div> + </div> + {% endif %} + + {% if options.links.sharing.google !== false %} + <a href="#" target="_blank" class="btn pull-right google-plus-sharing-link sharing-link" data-sharing="google-plus" aria-label="Share on Google Plus"><i class="fa fa-google-plus"></i></a> + {% endif %} + {% if options.links.sharing.facebook !== false %} + <a href="#" target="_blank" class="btn pull-right facebook-sharing-link sharing-link" data-sharing="facebook" aria-label="Share on Facebook"><i class="fa fa-facebook"></i></a> + {% endif %} + {% if options.links.sharing.twitter !== false %} + <a href="#" target="_blank" class="btn pull-right twitter-sharing-link sharing-link" data-sharing="twitter" aria-label="Share on Twitter"><i class="fa fa-twitter"></i></a> + {% endif %} + {% if options.links.sharing.weibo === true %} + <a href="#" target="_blank" class="btn pull-right twitter-sharing-link sharing-link" data-sharing="weibo" aria-label="Share on Weibo"><i class="fa fa-weibo"></i></a> + {% endif %} + + <!-- Title --> + <h1> + <i class="fa fa-circle-o-notch fa-spin"></i> + <a href="{{ basePath }}/" >{{ title }}</a> + </h1> +</div> diff --git a/theme/templates/website/includes/quiz.html b/theme/templates/website/includes/quiz.html new file mode 100644 index 0000000..425fa39 --- /dev/null +++ b/theme/templates/website/includes/quiz.html @@ -0,0 +1,40 @@ +<div class="header"> + <h2>Quiz</h2> +</div> + +<div class="message"> + {% autoescape false %}{{ section.content }}{% endautoescape %} +</div> + + +{% for quiz in section.quiz %} +<div class="question"> + <div class="question-header">Question {{ loop.index }} of {{ section.quiz.length }}</div> + + <div class="question-content"> + <div class="alert alert-success hidden"> + <b>Correct!</b> + </div> + + <div class="alert alert-danger error-message hidden"> + <p><b>Not quite!</b></p> + {% autoescape false %}{{ quiz.feedback }}{% endautoescape %} + </div> + + <div class="question-inner"> + {% autoescape false %}{{ quiz.base }}{% endautoescape %} + </div> + </div> + + <div class="hidden question-answers"> + <div class="question-inner"> + {% autoescape false %}{{ quiz.solution }}{% endautoescape %} + </div> + </div> +</div> +{% endfor %} + +<div class="buttons"> + <a href="#" class="button size-2 action-submit">Submit</a> + <a href="#" class="button size-2 action-solution">Solution</a> +</div> diff --git a/theme/templates/website/includes/summary.html b/theme/templates/website/includes/summary.html new file mode 100644 index 0000000..3fff7fe --- /dev/null +++ b/theme/templates/website/includes/summary.html @@ -0,0 +1,63 @@ +{% macro articles(_articles) %} + {% for item in _articles %} + {% set externalLink = item.path|isExternalLink %} + <li class="chapter {% if item.path == _input %}active{% endif %}" data-level="{{ item.level }}" {% if item.path && !externalLink %}data-path="{{ item.path|mdLink }}"{% endif %}> + {% if item.path %} + {% if !externalLink %} + <a href="{{ basePath }}/{{ item.path|mdLink }}"> + <i class="fa fa-check"></i> + {% if item.level !== "0" %} + <b>{{ item.level }}.</b> + {% endif %} + {{ item.title }} + </a> + {% else %} + <a target="_blank" href="{{ item.path }}"> + <i class="fa fa-check"></i> + {% if item.level !== "0" %} + <b>{{ item.level }}.</b> + {% endif %} + {{ item.title }} + </a> + {% endif %} + {% else %} + <span><b>{{ item.level }}.</b> {{ item.title }}</span> + {% endif %} + {% if item.articles.length > 0 %} + <ul class="articles"> + {{ articles(item.articles) }} + </ul> + {% endif %} + </li> + {% endfor %} +{% endmacro %} + +<div class="book-summary"> + <div class="book-search"> + <input type="text" placeholder="Type to search" class="form-control" /> + </div> + <ul class="summary"> + {% set _divider = false %} + {% if options.links.sidebar %} + {% for link in options.links.sidebar %} + {% set _divider = true %} + <li> + <a href="{{ options.links.sidebar[loop.key] }}" target="blank" class="custom-link">{{ loop.key }}</a> + </li> + {% endfor %} + {% endif %} + + {% if _divider %} + <li class="divider"></li> + {% endif %} + + {{ articles(summary.chapters) }} + + {% if options.links.gitbook !== false %} + <li class="divider"></li> + <li> + <a href="https://www.gitbook.com" target="blank" class="gitbook-link">Published using GitBook</a> + </li> + {% endif %} + </ul> +</div> |