summaryrefslogtreecommitdiffstats
path: root/theme/templates/website
diff options
context:
space:
mode:
Diffstat (limited to 'theme/templates/website')
-rw-r--r--theme/templates/website/glossary.html18
-rw-r--r--theme/templates/website/includes/exercise.html26
-rw-r--r--theme/templates/website/includes/font-settings.html22
-rw-r--r--theme/templates/website/includes/header.html53
-rw-r--r--theme/templates/website/includes/quiz.html40
-rw-r--r--theme/templates/website/includes/summary.html63
-rwxr-xr-xtheme/templates/website/langs.html25
-rw-r--r--theme/templates/website/layout.html32
-rw-r--r--theme/templates/website/page.html77
9 files changed, 356 insertions, 0 deletions
diff --git a/theme/templates/website/glossary.html b/theme/templates/website/glossary.html
new file mode 100644
index 0000000..4d9683f
--- /dev/null
+++ b/theme/templates/website/glossary.html
@@ -0,0 +1,18 @@
+{% extends "page.html" %}
+
+{% block title %}Glossary | {{ title }}{% endblock %}
+
+{% block page_inner %}
+{% for item in glossaryIndex %}
+<section class="normal glossary" id="{{ item.id }}">
+ <h2><a href="#{{ item.id }}">{{ item.name }}</a></h2>
+ <p>{{ item.description }}</p>
+ <h4>Index</h4>
+ <ul class="glossary-index">
+ {% for file in item.files %}
+ <li><a href="{{ basePath }}/{{ file.path|mdLink }}"><span class="level">{{ file.level }}.</span> {{ file.title }}</a></li>
+ {% endfor %}
+ </ul>
+</section>
+{% endfor %}
+{% endblock %}
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>
diff --git a/theme/templates/website/langs.html b/theme/templates/website/langs.html
new file mode 100755
index 0000000..7b47fc5
--- /dev/null
+++ b/theme/templates/website/langs.html
@@ -0,0 +1,25 @@
+{% extends "./layout.html" %}
+
+{% block title %}{{ title }}{% endblock %}
+
+{% block style %}
+<link rel="stylesheet" href="{{ staticBase }}/style.css">
+{% endblock %}
+
+{% block content %}
+<div class="book-langs-index">
+ <div class="inner">
+ <h3>Choose a language</h3>
+
+ <ul class="languages">
+ {% for lang in langs %}
+ <li>
+ <a href="{{ basePath}}/{{ lang.path|pathJoin("/index.html") }}">{{ lang.title }}</a>
+ </li>
+ {% endfor %}
+ </ul>
+ </div>
+</div>
+{% endblock %}
+
+{% block javascript %}{% endblock %} \ No newline at end of file
diff --git a/theme/templates/website/layout.html b/theme/templates/website/layout.html
new file mode 100644
index 0000000..5dc7c5e
--- /dev/null
+++ b/theme/templates/website/layout.html
@@ -0,0 +1,32 @@
+<!DOCTYPE HTML>
+<html lang="en-US" {% block htmlTag %}{% endblock %}>
+ {{ htmlSnippet("html:start")|default("") }}
+ <head>
+ {{ htmlSnippet("head:start")|default("") }}
+ <meta charset="UTF-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=11; IE=10; IE=9; IE=8; IE=7; IE=EDGE" />
+ <title>{% block title %}{% endblock %}</title>
+ <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
+ <meta name="description" content="{% block description %}{% endblock %}">
+ <meta name="generator" content="GitBook {{ gitbook.version }}">
+ <meta name="HandheldFriendly" content="true"/>
+ <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
+ <meta name="apple-mobile-web-app-capable" content="yes">
+ <meta name="apple-mobile-web-app-status-bar-style" content="black">
+ <link rel="apple-touch-icon-precomposed" sizes="152x152" href="{{ staticBase }}/images/apple-touch-icon-precomposed-152.png">
+ <link rel="shortcut icon" href="{{ staticBase }}/images/favicon.ico" type="image/x-icon">
+ {% if options.isbn %}
+ <meta name="identifier" content="{{ options.isbn }}" scheme="ISBN">
+ {% endif %}
+ {% block head %}{% endblock %}
+ {{ htmlSnippet("head:end")|default("") }}
+ </head>
+ <body>
+ {{ htmlSnippet("body:start")|default("") }}
+ {% block style %}{% endblock %}
+ {% block content %}{% endblock %}
+ {% block javascript %}{% endblock %}
+ {{ htmlSnippet("body:end")|default("") }}
+ </body>
+ {{ htmlSnippet("html:end")|default("") }}
+</html>
diff --git a/theme/templates/website/page.html b/theme/templates/website/page.html
new file mode 100644
index 0000000..1d5db62
--- /dev/null
+++ b/theme/templates/website/page.html
@@ -0,0 +1,77 @@
+{% extends "./layout.html" %}
+
+{% block head %}
+ {% parent %}
+ {% if progress.current.next and progress.current.next.path %}
+ <link rel="next" href="{{ basePath }}/{{ progress.current.next.path|mdLink }}" />
+ {% endif %}
+ {% if progress.current.prev and progress.current.prev.path %}
+ <link rel="prev" href="{{ basePath }}/{{ progress.current.prev.path|mdLink }}" />
+ {% endif %}
+{% endblock %}
+
+{% block title %}{{ progress.current.title }} | {{ title }}{% endblock %}
+{% block description %}{% if progress.current.level == "0" %}{{ description }}{% endif %}{% endblock %}
+
+{% block content %}
+ <div class="book" data-level="{{ progress.current.level }}" data-basepath="{{ basePath }}" data-revision="{{ revision }}">
+ {% include "includes/summary.html" %}
+ <div class="book-body">
+ <div class="body-inner">
+ {% include "includes/header.html" %}
+ <div class="page-wrapper" tabindex="-1">
+ <div class="page-inner">
+ {% block page_inner %}
+ {% for section in content %}
+ <section class="{{ section.type }}" id="section-{{ section.id }}">
+ {% if section.type == "normal" %}
+ {% autoescape false %}{{ section.content }}{% endautoescape %}
+ {% elif section.type == "exercise" %}
+ {% include "./includes/exercise.html" with {section: section} %}
+ {% elif section.type == "quiz" %}
+ {% include "./includes/quiz.html" with {section: section} %}
+ {% endif %}
+ </section>
+ {% endfor %}
+ {% endblock %}
+ </div>
+ </div>
+ </div>
+
+ {% if progress.current.prev and progress.current.prev.path %}
+ <a href="{{ basePath }}/{{ progress.current.prev.path|mdLink }}" class="navigation navigation-prev {% if !progress.current.next or !progress.current.next.path %}navigation-unique{% endif %}" aria-label="Previous page: {{ progress.current.prev.title }}"><i class="fa fa-angle-left"></i></a>
+ {% endif %}
+ {% if progress.current.next and progress.current.next.path %}
+ <a href="{{ basePath }}/{{ progress.current.next.path|mdLink }}" class="navigation navigation-next {% if !progress.current.prev or !progress.current.prev.path %}navigation-unique{% endif %}" aria-label="Next page: {{ progress.current.next.title }}"><i class="fa fa-angle-right"></i></a>
+ {% endif %}
+ </div>
+</div>
+{% endblock %}
+
+{% block javascript %}
+<script src="{{ staticBase }}/app.js"></script>
+{% for resource in plugins.resources.js %}
+ {% if resource.url %}
+ <script src="{{ resource.url }}"></script>
+ {% else %}
+ <script src="{{ staticBase }}/plugins/{{ resource.path }}"></script>
+ {% endif %}
+{% endfor %}
+<script>
+require(["gitbook"], function(gitbook) {
+ var config = {% autoescape false %}{{ pluginsConfig }}{% endautoescape %};
+ gitbook.start(config);
+});
+</script>
+{% endblock %}
+
+{% block style %}
+<link rel="stylesheet" href="{{ staticBase }}/style.css">
+{% for resource in plugins.resources.css %}
+ {% if resource.url %}
+ <link rel="stylesheet" href="{{ resource.url }}">
+ {% else %}
+ <link rel="stylesheet" href="{{ staticBase }}/plugins/{{ resource.path }}">
+ {% endif %}
+{% endfor %}
+{% endblock %}