diff options
-rwxr-xr-x | theme/assets/print.css | 2 | ||||
-rwxr-xr-x | theme/stylesheets/ebook.less | 6 | ||||
-rw-r--r-- | theme/templates/ebook/summary.html | 32 |
3 files changed, 33 insertions, 7 deletions
diff --git a/theme/assets/print.css b/theme/assets/print.css index 72a3c73..200094e 100755 --- a/theme/assets/print.css +++ b/theme/assets/print.css @@ -1 +1 @@ -.link-inherit{color:inherit}.link-inherit:hover,.link-inherit:focus{color:inherit}.hidden{display:none}.hljs-comment,.hljs-title{color:#8e908c}.hljs-variable,.hljs-attribute,.hljs-tag,.hljs-regexp,.ruby .hljs-constant,.xml .hljs-tag .hljs-title,.xml .hljs-pi,.xml .hljs-doctype,.html .hljs-doctype,.css .hljs-id,.css .hljs-class,.css .hljs-pseudo{color:#c82829}.hljs-number,.hljs-preprocessor,.hljs-pragma,.hljs-built_in,.hljs-literal,.hljs-params,.hljs-constant{color:#f5871f}.ruby .hljs-class .hljs-title,.css .hljs-rules .hljs-attribute{color:#eab700}.hljs-string,.hljs-value,.hljs-inheritance,.hljs-header,.ruby .hljs-symbol,.xml .hljs-cdata{color:#718c00}.css .hljs-hexcolor{color:#3e999f}.hljs-function,.python .hljs-decorator,.python .hljs-title,.ruby .hljs-function .hljs-title,.ruby .hljs-title .hljs-keyword,.perl .hljs-sub,.javascript .hljs-title,.coffeescript .hljs-title{color:#4271ae}.hljs-keyword,.javascript .hljs-function{color:#8959a8}.hljs{display:block;background:white;color:#4d4d4c;padding:.5em}.coffeescript .javascript,.javascript .xml,.tex .hljs-formula,.xml .javascript,.xml .vbscript,.xml .css,.xml .hljs-cdata{opacity:.5}.page .book-chapter{display:none}.page .exercise,.page .quiz{margin:1cm 0;border:2px solid #ddd}.page .exercise .exercise-header,.page .quiz .exercise-header{padding:.1cm .3cm;background:#f5f5f5;border-bottom:1px solid #ddd;font-weight:bold;page-break-inside:avoid}.page .exercise .exercise-inner,.page .quiz .exercise-inner{padding:.15cm .3cm}.page .exercise .exercise-inner p:last-child,.page .quiz .exercise-inner p:last-child{margin:0}.page .exercise hr,.page .quiz hr{height:2px}.page .exercise .question,.page .quiz .question{margin-top:.1cm;border-top:1px solid #ddd}body .page{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;line-height:1.4;color:#333;overflow:hidden;line-height:1.6;word-wrap:break-word;display:block}body .page>*:first-child{margin-top:0!important}body .page>*:last-child{margin-bottom:0!important}body .page a{background:transparent}body .page a:active,body .page a:hover{outline:0}body .page strong{font-weight:bold}body .page h1{font-size:2em;margin:.67em 0}body .page img{border:0}body .page hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}body .page pre{overflow:auto}body .page code,body .page pre{font-family:monospace,monospace;font-size:1em}body .page table{border-collapse:collapse;border-spacing:0}body .page td,body .page th{padding:0}body .page *{-moz-box-sizing:border-box;box-sizing:border-box}body .page a{color:#4183c4;text-decoration:none}body .page a:hover,body .page a:focus,body .page a:active{text-decoration:underline}body .page hr{height:0;margin:15px 0;overflow:hidden;background:transparent;border:0;border-bottom:1px solid #ddd}body .page hr:before,body .page hr:after{display:table;content:" "}body .page hr:after{clear:both}body .page h1,body .page h2,body .page h3,body .page h4,body .page h5,body .page h6{margin-top:15px;margin-bottom:15px;line-height:1.1}body .page h1{font-size:30px}body .page h2{font-size:21px}body .page h3{font-size:16px}body .page h4{font-size:14px}body .page h5{font-size:12px}body .page h6{font-size:11px}body .page blockquote{margin:0}body .page ul,body .page ol{padding:0;margin-top:0;margin-bottom:0}body .page ol ol{list-style-type:lower-roman}body .page dd{margin-left:0}body .page code,body .page pre{font-family:Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px}body .page pre{margin-top:0;margin-bottom:0}body .page .markdown-body>*:first-child{margin-top:0!important}body .page .markdown-body>*:last-child{margin-bottom:0!important}body .page .anchor{position:absolute;top:0;bottom:0;left:0;display:block;padding-right:6px;padding-left:30px;margin-left:-30px}body .page .anchor:focus{outline:0}body .page h1,body .page h2,body .page h3,body .page h4,body .page h5,body .page h6{position:relative;margin-top:1em;margin-bottom:16px;font-weight:bold;line-height:1.4}body .page h1{padding-bottom:.3em;font-size:2.25em;line-height:1.2;border-bottom:1px solid #eee}body .page h2{padding-bottom:.3em;font-size:1.75em;line-height:1.225;border-bottom:1px solid #eee}body .page h3{font-size:1.5em;line-height:1.43}body .page h4{font-size:1.25em}body .page h5{font-size:1em}body .page h6{font-size:1em;color:#777}body .page p,body .page blockquote,body .page ul,body .page ol,body .page dl,body .page table,body .page pre{margin-top:0;margin-bottom:16px}body .page hr{height:4px;padding:0;margin:16px 0;background-color:#e7e7e7;border:0 none}body .page ul,body .page ol{padding-left:2em}body .page ol ol,body .page ol ul,body .page ul ul{margin-top:0;margin-bottom:0}body .page dl{padding:0}body .page dl dt{padding:0;margin-top:16px;font-size:1em;font-style:italic;font-weight:bold}body .page dl dd{padding:0 16px;margin-bottom:16px}body .page blockquote{padding:0 15px;color:#777;border-left:4px solid #ddd}body .page blockquote>:first-child{margin-top:0}body .page blockquote>:last-child{margin-bottom:0}body .page table{display:block;width:100%;overflow:auto}body .page table th{font-weight:bold}body .page table th,body .page table td{padding:6px 13px;border:1px solid #ddd}body .page table tr{background-color:#fff;border-top:1px solid #ccc}body .page table tr:nth-child(2n){background-color:#f8f8f8}body .page img{max-width:100%;-moz-box-sizing:border-box;box-sizing:border-box;page-break-inside:avoid}body .page code{padding:0;padding-top:.2em;padding-bottom:.2em;margin:0;font-size:85%;background-color:#f7f7f7;border-radius:3px}body .page code:before,body .page code:after{letter-spacing:-0.2em;content:"\00a0"}body .page pre>code{padding:0;margin:0;font-size:100%;white-space:pre;background:transparent;border:0}body .page .highlight pre,body .page pre{padding:16px;overflow:auto;font-size:85%;line-height:1.45;background-color:#f7f7f7;border:0;border-radius:3px}body .page pre{word-wrap:normal}body .page pre code{display:inline;max-width:initial;padding:0;margin:0;overflow:initial;line-height:inherit;word-wrap:normal;background-color:transparent;border:0}body .page pre code:before,body .page pre code:after{content:normal}body .page .highlight{background:#fff}
\ No newline at end of file +.link-inherit{color:inherit}.link-inherit:hover,.link-inherit:focus{color:inherit}.hidden{display:none}.hljs-comment,.hljs-title{color:#8e908c}.hljs-variable,.hljs-attribute,.hljs-tag,.hljs-regexp,.ruby .hljs-constant,.xml .hljs-tag .hljs-title,.xml .hljs-pi,.xml .hljs-doctype,.html .hljs-doctype,.css .hljs-id,.css .hljs-class,.css .hljs-pseudo{color:#c82829}.hljs-number,.hljs-preprocessor,.hljs-pragma,.hljs-built_in,.hljs-literal,.hljs-params,.hljs-constant{color:#f5871f}.ruby .hljs-class .hljs-title,.css .hljs-rules .hljs-attribute{color:#eab700}.hljs-string,.hljs-value,.hljs-inheritance,.hljs-header,.ruby .hljs-symbol,.xml .hljs-cdata{color:#718c00}.css .hljs-hexcolor{color:#3e999f}.hljs-function,.python .hljs-decorator,.python .hljs-title,.ruby .hljs-function .hljs-title,.ruby .hljs-title .hljs-keyword,.perl .hljs-sub,.javascript .hljs-title,.coffeescript .hljs-title{color:#4271ae}.hljs-keyword,.javascript .hljs-function{color:#8959a8}.hljs{display:block;background:white;color:#4d4d4c;padding:.5em}.coffeescript .javascript,.javascript .xml,.tex .hljs-formula,.xml .javascript,.xml .vbscript,.xml .css,.xml .hljs-cdata{opacity:.5}.page.page-toc ol{margin:0}.page .book-chapter{display:none}.page .exercise,.page .quiz{margin:1cm 0;border:2px solid #ddd}.page .exercise .exercise-header,.page .quiz .exercise-header{padding:.1cm .3cm;background:#f5f5f5;border-bottom:1px solid #ddd;font-weight:bold;page-break-inside:avoid}.page .exercise .exercise-inner,.page .quiz .exercise-inner{padding:.15cm .3cm}.page .exercise .exercise-inner p:last-child,.page .quiz .exercise-inner p:last-child{margin:0}.page .exercise hr,.page .quiz hr{height:2px}.page .exercise .question,.page .quiz .question{margin-top:.1cm;border-top:1px solid #ddd}body .page{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;line-height:1.4;color:#333;overflow:hidden;line-height:1.6;word-wrap:break-word;display:block}body .page>*:first-child{margin-top:0!important}body .page>*:last-child{margin-bottom:0!important}body .page a{background:transparent}body .page a:active,body .page a:hover{outline:0}body .page strong{font-weight:bold}body .page h1{font-size:2em;margin:.67em 0}body .page img{border:0}body .page hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}body .page pre{overflow:auto}body .page code,body .page pre{font-family:monospace,monospace;font-size:1em}body .page table{border-collapse:collapse;border-spacing:0}body .page td,body .page th{padding:0}body .page *{-moz-box-sizing:border-box;box-sizing:border-box}body .page a{color:#4183c4;text-decoration:none}body .page a:hover,body .page a:focus,body .page a:active{text-decoration:underline}body .page hr{height:0;margin:15px 0;overflow:hidden;background:transparent;border:0;border-bottom:1px solid #ddd}body .page hr:before,body .page hr:after{display:table;content:" "}body .page hr:after{clear:both}body .page h1,body .page h2,body .page h3,body .page h4,body .page h5,body .page h6{margin-top:15px;margin-bottom:15px;line-height:1.1}body .page h1{font-size:30px}body .page h2{font-size:21px}body .page h3{font-size:16px}body .page h4{font-size:14px}body .page h5{font-size:12px}body .page h6{font-size:11px}body .page blockquote{margin:0}body .page ul,body .page ol{padding:0;margin-top:0;margin-bottom:0}body .page ol ol{list-style-type:lower-roman}body .page dd{margin-left:0}body .page code,body .page pre{font-family:Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px}body .page pre{margin-top:0;margin-bottom:0}body .page .markdown-body>*:first-child{margin-top:0!important}body .page .markdown-body>*:last-child{margin-bottom:0!important}body .page .anchor{position:absolute;top:0;bottom:0;left:0;display:block;padding-right:6px;padding-left:30px;margin-left:-30px}body .page .anchor:focus{outline:0}body .page h1,body .page h2,body .page h3,body .page h4,body .page h5,body .page h6{position:relative;margin-top:1em;margin-bottom:16px;font-weight:bold;line-height:1.4}body .page h1{padding-bottom:.3em;font-size:2.25em;line-height:1.2;border-bottom:1px solid #eee}body .page h2{padding-bottom:.3em;font-size:1.75em;line-height:1.225;border-bottom:1px solid #eee}body .page h3{font-size:1.5em;line-height:1.43}body .page h4{font-size:1.25em}body .page h5{font-size:1em}body .page h6{font-size:1em;color:#777}body .page p,body .page blockquote,body .page ul,body .page ol,body .page dl,body .page table,body .page pre{margin-top:0;margin-bottom:16px}body .page hr{height:4px;padding:0;margin:16px 0;background-color:#e7e7e7;border:0 none}body .page ul,body .page ol{padding-left:2em}body .page ol ol,body .page ol ul,body .page ul ul{margin-top:0;margin-bottom:0}body .page dl{padding:0}body .page dl dt{padding:0;margin-top:16px;font-size:1em;font-style:italic;font-weight:bold}body .page dl dd{padding:0 16px;margin-bottom:16px}body .page blockquote{padding:0 15px;color:#777;border-left:4px solid #ddd}body .page blockquote>:first-child{margin-top:0}body .page blockquote>:last-child{margin-bottom:0}body .page table{display:block;width:100%;overflow:auto}body .page table th{font-weight:bold}body .page table th,body .page table td{padding:6px 13px;border:1px solid #ddd}body .page table tr{background-color:#fff;border-top:1px solid #ccc}body .page table tr:nth-child(2n){background-color:#f8f8f8}body .page img{max-width:100%;-moz-box-sizing:border-box;box-sizing:border-box;page-break-inside:avoid}body .page code{padding:0;padding-top:.2em;padding-bottom:.2em;margin:0;font-size:85%;background-color:#f7f7f7;border-radius:3px}body .page code:before,body .page code:after{letter-spacing:-0.2em;content:"\00a0"}body .page pre>code{padding:0;margin:0;font-size:100%;white-space:pre;background:transparent;border:0}body .page .highlight pre,body .page pre{padding:16px;overflow:auto;font-size:85%;line-height:1.45;background-color:#f7f7f7;border:0;border-radius:3px}body .page pre{word-wrap:normal}body .page pre code{display:inline;max-width:initial;padding:0;margin:0;overflow:initial;line-height:inherit;word-wrap:normal;background-color:transparent;border:0}body .page pre code:before,body .page pre code:after{content:normal}body .page .highlight{background:#fff}
\ No newline at end of file diff --git a/theme/stylesheets/ebook.less b/theme/stylesheets/ebook.less index b718b17..46fe4bd 100755 --- a/theme/stylesheets/ebook.less +++ b/theme/stylesheets/ebook.less @@ -4,6 +4,12 @@ @import "ebook/highlight.less"; .page { + &.page-toc { + ol { + margin: 0px; + } + } + .book-chapter { display: none; } diff --git a/theme/templates/ebook/summary.html b/theme/templates/ebook/summary.html index 8bc4d7d..53940f0 100644 --- a/theme/templates/ebook/summary.html +++ b/theme/templates/ebook/summary.html @@ -13,14 +13,34 @@ {% endfor %} {% endblock %} +{% macro articles(_articles) %} + {% for item in _articles %} + {% set externalLink = item.path|isExternalLink %} + <li> + {% if item.path %} + {% if !externalLink %} + <a href="{{ basePath }}/{{ item.path|mdLink }}">{{ item.title }}</a> + {% else %} + <a target="_blank" href="{{ item.path }}">{{ item.title }}</a> + {% endif %} + {% else %} + {{ item.title }} + {% endif %} + {% if item.articles.length > 0 %} + <ol> + {{ articles(item.articles) }} + </ol> + {% endif %} + </li> + {% endfor %} +{% endmacro %} + {% block content %} -<div class="page"> +<div class="page page-toc"> <h1>Table of Contents</h1> - <p> - {% for chapter in toc %} - <a href="{{ basePath }}/{{ chapter.path|mdLink }}">{{ chapter.title }}</a><br/> - {% endfor %} - </p> + <ol> + {{ articles(summary.chapters) }} + </ol> </div> {% endblock %} |