burr 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +3 -0
- data/.ruby-version +1 -0
- data/Gemfile +3 -0
- data/LICENSE.md +30 -0
- data/README.md +180 -0
- data/Rakefile +118 -0
- data/bin/burr +9 -0
- data/burr.gemspec +36 -0
- data/generators/Gemfile.txt +3 -0
- data/generators/config.yml +55 -0
- data/generators/contents/chapter1.md +7 -0
- data/generators/contents/chapter2.md +7 -0
- data/generators/stylesheets/pdf.css +569 -0
- data/generators/stylesheets/site.css +1 -0
- data/lib/burr.rb +56 -0
- data/lib/burr/book.rb +289 -0
- data/lib/burr/cli.rb +64 -0
- data/lib/burr/converter.rb +19 -0
- data/lib/burr/core_ext/blank.rb +107 -0
- data/lib/burr/dependency.rb +28 -0
- data/lib/burr/eeepub_ext/maker.rb +131 -0
- data/lib/burr/exporter.rb +137 -0
- data/lib/burr/exporters/epub.rb +163 -0
- data/lib/burr/exporters/pdf.rb +95 -0
- data/lib/burr/exporters/site.rb +101 -0
- data/lib/burr/generator.rb +41 -0
- data/lib/burr/kramdown_ext/converter.rb +145 -0
- data/lib/burr/kramdown_ext/options.rb +38 -0
- data/lib/burr/kramdown_ext/parser.rb +65 -0
- data/lib/burr/liquid_ext/block.rb +58 -0
- data/lib/burr/liquid_ext/extends.rb +114 -0
- data/lib/burr/plugin.rb +70 -0
- data/lib/burr/plugins/aside.rb +44 -0
- data/lib/burr/plugins/codeblock.rb +42 -0
- data/lib/burr/plugins/figure.rb +62 -0
- data/lib/burr/plugins/link.rb +47 -0
- data/lib/burr/plugins/parser_plugin.rb +18 -0
- data/lib/burr/plugins/table.rb +42 -0
- data/lib/burr/plugins/toc.rb +105 -0
- data/lib/burr/ruby_version_check.rb +4 -0
- data/lib/burr/server.rb +27 -0
- data/lib/burr/ui.rb +46 -0
- data/lib/burr/version.rb +8 -0
- data/resources/locales/labels/en.yml +45 -0
- data/resources/locales/labels/zh_CN.yml +46 -0
- data/resources/locales/titles/en.yml +21 -0
- data/resources/locales/titles/zh_CN.yml +21 -0
- data/resources/templates/epub/_layout.liquid +17 -0
- data/resources/templates/epub/acknowledgement.liquid +10 -0
- data/resources/templates/epub/afterword.liquid +10 -0
- data/resources/templates/epub/appendix.liquid +10 -0
- data/resources/templates/epub/author.liquid +10 -0
- data/resources/templates/epub/chapter.liquid +10 -0
- data/resources/templates/epub/conclusion.liquid +10 -0
- data/resources/templates/epub/cover.liquid +9 -0
- data/resources/templates/epub/dedication.liquid +10 -0
- data/resources/templates/epub/edition.liquid +1 -0
- data/resources/templates/epub/epilogue.liquid +1 -0
- data/resources/templates/epub/foreword.liquid +10 -0
- data/resources/templates/epub/glossary.liquid +1 -0
- data/resources/templates/epub/introduction.liquid +1 -0
- data/resources/templates/epub/license.liquid +1 -0
- data/resources/templates/epub/lof.liquid +24 -0
- data/resources/templates/epub/lot.liquid +24 -0
- data/resources/templates/epub/part.liquid +4 -0
- data/resources/templates/epub/preface.liquid +10 -0
- data/resources/templates/epub/prologue.liquid +1 -0
- data/resources/templates/epub/table.liquid +7 -0
- data/resources/templates/epub/title.liquid +3 -0
- data/resources/templates/epub/toc.liquid +10 -0
- data/resources/templates/pdf/_item.liquid +6 -0
- data/resources/templates/pdf/acknowledgement.liquid +1 -0
- data/resources/templates/pdf/afterword.liquid +1 -0
- data/resources/templates/pdf/appendix.liquid +4 -0
- data/resources/templates/pdf/author.liquid +1 -0
- data/resources/templates/pdf/blank.liquid +3 -0
- data/resources/templates/pdf/book.liquid +42 -0
- data/resources/templates/pdf/chapter.liquid +4 -0
- data/resources/templates/pdf/code.liquid +3 -0
- data/resources/templates/pdf/conclusion.liquid +1 -0
- data/resources/templates/pdf/cover.liquid +6 -0
- data/resources/templates/pdf/dedication.liquid +3 -0
- data/resources/templates/pdf/edition.liquid +1 -0
- data/resources/templates/pdf/epilogue.liquid +1 -0
- data/resources/templates/pdf/foreword.liquid +1 -0
- data/resources/templates/pdf/glossary.liquid +1 -0
- data/resources/templates/pdf/introduction.liquid +1 -0
- data/resources/templates/pdf/license.liquid +1 -0
- data/resources/templates/pdf/lof.liquid +24 -0
- data/resources/templates/pdf/lot.liquid +24 -0
- data/resources/templates/pdf/part.liquid +4 -0
- data/resources/templates/pdf/preface.liquid +1 -0
- data/resources/templates/pdf/prologue.liquid +1 -0
- data/resources/templates/pdf/table.liquid +7 -0
- data/resources/templates/pdf/title.liquid +3 -0
- data/resources/templates/pdf/toc.liquid +4 -0
- data/resources/templates/site/_layout.liquid +27 -0
- data/resources/templates/site/author.liquid +13 -0
- data/resources/templates/site/chapter.liquid +13 -0
- data/resources/templates/site/foreword.liquid +13 -0
- data/resources/templates/site/preface.liquid +13 -0
- metadata +232 -0
@@ -0,0 +1,10 @@
|
|
1
|
+
{% extends 'layout' %}
|
2
|
+
|
3
|
+
{% block title %}{{item.label }} {{ item.title }}{% endblock %}
|
4
|
+
|
5
|
+
{% block body %}
|
6
|
+
<div class="item chapter">
|
7
|
+
<h1 id="{{ item.id }}"><span>{{ item.label }}</span> {{ item.title }}</h1>
|
8
|
+
{{ item.content }}
|
9
|
+
</div>
|
10
|
+
{% endblock %}
|
@@ -0,0 +1 @@
|
|
1
|
+
{% extends 'item' %}
|
@@ -0,0 +1 @@
|
|
1
|
+
{% extends 'item' %}
|
@@ -0,0 +1 @@
|
|
1
|
+
{% extends 'item' %}
|
@@ -0,0 +1 @@
|
|
1
|
+
{% extends 'item' %}
|
@@ -0,0 +1 @@
|
|
1
|
+
{% extends 'item' %}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<div class="item lof">
|
2
|
+
|
3
|
+
<h1>{{ item.title }}</h1>
|
4
|
+
|
5
|
+
<ul>
|
6
|
+
{% for item in app.get('publishing.list.images') %}
|
7
|
+
{% if item|length > 0 %}
|
8
|
+
{% for entry in item %}
|
9
|
+
{% if entry.item.caption is empty %}
|
10
|
+
<li><a href="#{{ entry.item.slug }}">
|
11
|
+
<span>{{ app.getLabel('figure', entry) }}</span>
|
12
|
+
</a></li>
|
13
|
+
{% else %}
|
14
|
+
<li><a href="#{{ entry.item.slug }}">
|
15
|
+
<span>{{ entry.element.number }}.{{ entry.item.number }}</span>
|
16
|
+
{{ entry.item.caption }}
|
17
|
+
</a></li>
|
18
|
+
{% endif %}
|
19
|
+
{% endfor %}
|
20
|
+
{% endif %}
|
21
|
+
{% endfor %}
|
22
|
+
</ul>
|
23
|
+
|
24
|
+
</div>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<div class="item lot">
|
2
|
+
|
3
|
+
<h1>{{ item.title }}</h1>
|
4
|
+
|
5
|
+
<ul>
|
6
|
+
{% for item in app.get('publishing.list.tables') %}
|
7
|
+
{% if item|length > 0 %}
|
8
|
+
{% for entry in item %}
|
9
|
+
{% if entry.item.caption is empty %}
|
10
|
+
<li><a href="#{{ entry.item.slug }}">
|
11
|
+
<span>{{ app.getLabel('table', entry) }}</span>
|
12
|
+
</a></li>
|
13
|
+
{% else %}
|
14
|
+
<li><a href="#{{ entry.item.slug }}">
|
15
|
+
<span>{{ entry.element.number }}.{{ entry.item.number }}</span>
|
16
|
+
{{ entry.item.caption }}
|
17
|
+
</a></li>
|
18
|
+
{% endif %}
|
19
|
+
{% endfor %}
|
20
|
+
{% endif %}
|
21
|
+
{% endfor %}
|
22
|
+
</ul>
|
23
|
+
|
24
|
+
</div>
|
@@ -0,0 +1 @@
|
|
1
|
+
{% extends 'item' %}
|
@@ -0,0 +1 @@
|
|
1
|
+
{% extends 'item' %}
|
@@ -0,0 +1 @@
|
|
1
|
+
{% extends 'item' %}
|
@@ -0,0 +1 @@
|
|
1
|
+
{% extends 'item' %}
|
@@ -0,0 +1,42 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
2
|
+
<html lang="{{ config.language }}">
|
3
|
+
<head>
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
5
|
+
|
6
|
+
<!-- Metadata used by PrinceXML to set PDF metadata -->
|
7
|
+
<title>{{ config.title }}</title>
|
8
|
+
<meta name="author" content="{% if config.translator %}{{ config.translator }}{% else %}{{ config.author }}{% endif %}" />
|
9
|
+
<meta name="date" content="{{ config.publication_date | date: "%Y-%m-%d" }}" />
|
10
|
+
<meta name="generator" content="{{ generator.name }} v{{ generator.version }}"/>
|
11
|
+
|
12
|
+
<link rel="stylesheet" type="text/css" href="style.css" />
|
13
|
+
</head>
|
14
|
+
|
15
|
+
<body>
|
16
|
+
|
17
|
+
{% if frontmatter.size > 0 %}
|
18
|
+
<div class="frontmatter">
|
19
|
+
{% for item in frontmatter %}
|
20
|
+
{{ item.content }}
|
21
|
+
{% endfor %}
|
22
|
+
</div>
|
23
|
+
{% endif %}
|
24
|
+
|
25
|
+
{% if bodymatter.size > 0 %}
|
26
|
+
<div class="bodymatter">
|
27
|
+
{% for item in bodymatter %}
|
28
|
+
{{ item.content }}
|
29
|
+
{% endfor %}
|
30
|
+
</div>
|
31
|
+
{% endif %}
|
32
|
+
|
33
|
+
{% if backmatter.size > 0 %}
|
34
|
+
<div class="backmatter">
|
35
|
+
{% for item in backmatter %}
|
36
|
+
{{ item.content }}
|
37
|
+
{% endfor %}
|
38
|
+
</div>
|
39
|
+
{% endif %}
|
40
|
+
|
41
|
+
</body>
|
42
|
+
</html>
|
@@ -0,0 +1 @@
|
|
1
|
+
{% extends 'item' %}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
<div class="item cover">
|
2
|
+
{% if config.edition %}<p class="edition">{{ config.edition }}</p>{% endif %}
|
3
|
+
<h1>{{ config.title }}</h1>
|
4
|
+
{% if config.subtitle %}<h2>{{ config.subtitle }}</h2>{% endif %}
|
5
|
+
<h3>{{ config.author }}{% if config.translator %} {{ config.translator }}{% endif %}</h3>
|
6
|
+
</div>
|
@@ -0,0 +1 @@
|
|
1
|
+
{% extends 'item' %}
|
@@ -0,0 +1 @@
|
|
1
|
+
{% extends 'item' %}
|
@@ -0,0 +1 @@
|
|
1
|
+
{% extends 'item' %}
|
@@ -0,0 +1 @@
|
|
1
|
+
{% extends 'item' %}
|
@@ -0,0 +1 @@
|
|
1
|
+
{% extends 'item' %}
|
@@ -0,0 +1 @@
|
|
1
|
+
{% extends 'item' %}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<div class="item lof">
|
2
|
+
|
3
|
+
<h1>{{ item.title }}</h1>
|
4
|
+
|
5
|
+
<ul>
|
6
|
+
{% for item in app.get('publishing.list.images') %}
|
7
|
+
{% if item|length > 0 %}
|
8
|
+
{% for entry in item %}
|
9
|
+
{% if entry.item.caption is empty %}
|
10
|
+
<li><a href="#{{ entry.item.slug }}">
|
11
|
+
<span>{{ app.getLabel('figure', entry) }}</span>
|
12
|
+
</a></li>
|
13
|
+
{% else %}
|
14
|
+
<li><a href="#{{ entry.item.slug }}">
|
15
|
+
<span>{{ entry.element.number }}.{{ entry.item.number }}</span>
|
16
|
+
{{ entry.item.caption }}
|
17
|
+
</a></li>
|
18
|
+
{% endif %}
|
19
|
+
{% endfor %}
|
20
|
+
{% endif %}
|
21
|
+
{% endfor %}
|
22
|
+
</ul>
|
23
|
+
|
24
|
+
</div>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<div class="item lot">
|
2
|
+
|
3
|
+
<h1>{{ item.title }}</h1>
|
4
|
+
|
5
|
+
<ul>
|
6
|
+
{% for item in app.get('publishing.list.tables') %}
|
7
|
+
{% if item|length > 0 %}
|
8
|
+
{% for entry in item %}
|
9
|
+
{% if entry.item.caption is empty %}
|
10
|
+
<li><a href="#{{ entry.item.slug }}">
|
11
|
+
<span>{{ app.getLabel('table', entry) }}</span>
|
12
|
+
</a></li>
|
13
|
+
{% else %}
|
14
|
+
<li><a href="#{{ entry.item.slug }}">
|
15
|
+
<span>{{ entry.element.number }}.{{ entry.item.number }}</span>
|
16
|
+
{{ entry.item.caption }}
|
17
|
+
</a></li>
|
18
|
+
{% endif %}
|
19
|
+
{% endfor %}
|
20
|
+
{% endif %}
|
21
|
+
{% endfor %}
|
22
|
+
</ul>
|
23
|
+
|
24
|
+
</div>
|
@@ -0,0 +1 @@
|
|
1
|
+
{% extends 'item' %}
|
@@ -0,0 +1 @@
|
|
1
|
+
{% extends 'item' %}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<html lang="{{ config.language }}">
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8" />
|
5
|
+
<title>{% block title %}{{ config.title }}{% endblock %}</title>
|
6
|
+
<meta name="author" content="{% if config.translator %}{{ config.translator }}{% else %}{{ config.author }}{% endif %}" />
|
7
|
+
<link rel="stylesheet" href="style.css" />
|
8
|
+
</head>
|
9
|
+
|
10
|
+
<body>
|
11
|
+
<div class="container">
|
12
|
+
{% block body %}{% endblock %}
|
13
|
+
{% block navigation %}
|
14
|
+
{% if item.pre or item.nxt %}
|
15
|
+
<div class="navigation">
|
16
|
+
{% if item.pre %}
|
17
|
+
<a class="prev_page" href="{{ item.pre_url }}">« {{ item.pre }}</a>
|
18
|
+
{% endif %}
|
19
|
+
{% if item.nxt %}
|
20
|
+
<a class="next_page" href="{{ item.nxt_url }}">{{ item.nxt }} »</a>
|
21
|
+
{% endif %}
|
22
|
+
</div>
|
23
|
+
{% endif %}
|
24
|
+
{% endblock %}
|
25
|
+
</div>
|
26
|
+
</body>
|
27
|
+
</html>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
{% extends 'layout' %}
|
2
|
+
|
3
|
+
{% block title %}{{ item.title }}{% endblock %}
|
4
|
+
|
5
|
+
{% block body %}
|
6
|
+
<div class="item author">
|
7
|
+
<h1 id="{{ item.id }}"><span>{{ item.label }}</span> {{ item.title }}</h1>
|
8
|
+
{{ item.toc }}
|
9
|
+
<div class="main">
|
10
|
+
{{ item.content }}
|
11
|
+
</div>
|
12
|
+
</div>
|
13
|
+
{% endblock %}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
{% extends 'layout' %}
|
2
|
+
|
3
|
+
{% block title %}{{item.label }} {{ item.title }}{% endblock %}
|
4
|
+
|
5
|
+
{% block body %}
|
6
|
+
<div class="item chapter">
|
7
|
+
<h1 id="{{ item.id }}"><span>{{ item.label }}</span> {{ item.title }}</h1>
|
8
|
+
{{ item.toc }}
|
9
|
+
<div class="main">
|
10
|
+
{{ item.content }}
|
11
|
+
</div>
|
12
|
+
</div>
|
13
|
+
{% endblock %}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
{% extends 'layout' %}
|
2
|
+
|
3
|
+
{% block title %}{{ item.title }}{% endblock %}
|
4
|
+
|
5
|
+
{% block body %}
|
6
|
+
<div class="item foreword">
|
7
|
+
<h1 id="{{ item.id }}"><span>{{ item.label }}</span> {{ item.title }}</h1>
|
8
|
+
{{ item.toc }}
|
9
|
+
<div class="main">
|
10
|
+
{{ item.content }}
|
11
|
+
</div>
|
12
|
+
</div>
|
13
|
+
{% endblock %}
|