Improve styling for pdf and ebook

This commit is contained in:
Samy Pessé
2014-04-17 12:15:28 +02:00
parent d3aba2c906
commit 1a8db646f2
3 changed files with 38 additions and 29 deletions
File diff suppressed because one or more lines are too long
+27 -19
View File
@@ -7,6 +7,10 @@
@import "page/highlight.less";
@font-size-base: 13px;
* {
-webkit-overflow-scrolling: touch;
-webkit-tap-highlight-color: transparent;
@@ -26,11 +30,18 @@ body {
}
h1, h2 {
h1, h2, h3 {
page-break-after: avoid;
page-break-before: auto;
}
h1 { font-size: floor(@font-size-base * 2.15); }
h2 { font-size: floor(@font-size-base * 1.70); }
h3 { font-size: ceil(@font-size-base * 1.25); }
h4 { font-size: ceil(@font-size-base * 1); }
h5 { font-size: ceil(@font-size-base * 0.85); }
h6 { font-size: ceil(@font-size-base * 0.65); }
pre, blockquote {
border: 1px solid #999;
page-break-inside: avoid;
@@ -54,39 +65,36 @@ section {
}
&#summary {
text-align: center;
margin: 1.5cm;
ul {
font-size: 0.5cm;
line-height: 1.8em;
padding: 0px;
margin: 0px;
list-style: none;
h1 {
text-align: center;
}
> ul {
> li {
margin-bottom: 1cm;
ol {
list-style: none;
padding: 0px;
margin: 0px;
margin-left: 1cm;
}
> a {
font-size: 0.6cm;
}
> ol {
> li {
}
}
}
article {
margin: 1.5cm;
/* Big centered title */
margin-bottom: 1.5cm;
&.new-chapter {
page-break-after: always;
font-size: 0.6cm;
text-align: center;
padding: 3cm 0cm;
@media print {
border: none;
h1 {
font-size: floor(@font-size-base * 2.7);
}
}
+10 -9
View File
@@ -41,27 +41,28 @@
{# Summary #}
<section id="summary">
<h1>Summary</h1>
<ul class="summary">
<h1>Table of Contents</h1>
<ol>
<li>
<a href="#README.md">Introduction</a>
<a href="#README.md">
<h2>Introduction</h2>
</a>
</li>
{% for item in summary.chapters %}
<li>
<a href="#{{ item.path }}">{{ item.level }}) {{ item.title }}</a>
<h2><span>{{ item.level }}.</span> <a href="#{{ item.path }}">{{ item.title }}</a></h2>
{% if item.articles.length > 0 %}
<ul>
<ol>
{% for article in item.articles %}
<li>
<a href="#{{ article.path }}">{{ article.level }}) {{ article.title }}</a>
<span>{{ article.level }}</span> <a href="#{{ article.path }}">{{ article.title }}</a>
</li>
{% endfor %}
</ul>
</ol>
{% endif %}
</li>
{% endfor %}
</ul>
</ol>
</section>
{# Pages content #}