asciidoctor-epub3 1.5.0.alpha.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.yardopts +12 -0
- data/CHANGELOG.adoc +199 -0
- data/Gemfile +16 -0
- data/LICENSE.adoc +25 -0
- data/NOTICE.adoc +54 -0
- data/README.adoc +1001 -0
- data/Rakefile +5 -0
- data/asciidoctor-epub3.gemspec +42 -0
- data/bin/adb-push-ebook +35 -0
- data/bin/asciidoctor-epub3 +30 -0
- data/data/fonts/assorted-icons.ttf +0 -0
- data/data/fonts/fontawesome-icons.ttf +0 -0
- data/data/fonts/mplus1mn-bold-ascii.ttf +0 -0
- data/data/fonts/mplus1mn-bolditalic-ascii.ttf +0 -0
- data/data/fonts/mplus1mn-italic-ascii.ttf +0 -0
- data/data/fonts/mplus1mn-regular-ascii-conums.ttf +0 -0
- data/data/fonts/mplus1p-bold-latin-cyrillic.ttf +0 -0
- data/data/fonts/mplus1p-bold-latin-ext.ttf +0 -0
- data/data/fonts/mplus1p-bold-latin.ttf +0 -0
- data/data/fonts/mplus1p-bold-multilingual.ttf +0 -0
- data/data/fonts/mplus1p-light-latin-cyrillic.ttf +0 -0
- data/data/fonts/mplus1p-light-latin-ext.ttf +0 -0
- data/data/fonts/mplus1p-light-latin.ttf +0 -0
- data/data/fonts/mplus1p-light-multilingual.ttf +0 -0
- data/data/fonts/mplus1p-regular-latin-cyrillic.ttf +0 -0
- data/data/fonts/mplus1p-regular-latin-ext.ttf +0 -0
- data/data/fonts/mplus1p-regular-latin.ttf +0 -0
- data/data/fonts/mplus1p-regular-multilingual.ttf +0 -0
- data/data/fonts/notoserif-bold-latin-cyrillic.ttf +0 -0
- data/data/fonts/notoserif-bold-latin-ext.ttf +0 -0
- data/data/fonts/notoserif-bold-latin.ttf +0 -0
- data/data/fonts/notoserif-bold-multilingual.ttf +0 -0
- data/data/fonts/notoserif-bolditalic-latin-cyrillic.ttf +0 -0
- data/data/fonts/notoserif-bolditalic-latin-ext.ttf +0 -0
- data/data/fonts/notoserif-bolditalic-latin.ttf +0 -0
- data/data/fonts/notoserif-bolditalic-multilingual.ttf +0 -0
- data/data/fonts/notoserif-italic-latin-cyrillic.ttf +0 -0
- data/data/fonts/notoserif-italic-latin-ext.ttf +0 -0
- data/data/fonts/notoserif-italic-latin.ttf +0 -0
- data/data/fonts/notoserif-italic-multilingual.ttf +0 -0
- data/data/fonts/notoserif-regular-latin-cyrillic.ttf +0 -0
- data/data/fonts/notoserif-regular-latin-ext.ttf +0 -0
- data/data/fonts/notoserif-regular-latin.ttf +0 -0
- data/data/fonts/notoserif-regular-multilingual.ttf +0 -0
- data/data/images/default-avatar.jpg +0 -0
- data/data/images/default-avatar.png +0 -0
- data/data/images/default-avatar.svg +67 -0
- data/data/images/default-cover.svg +53 -0
- data/data/images/default-headshot.jpg +0 -0
- data/data/images/default-headshot.png +0 -0
- data/data/styles/color-palette.css +28 -0
- data/data/styles/epub3-css3-only.css +226 -0
- data/data/styles/epub3-fonts.css +94 -0
- data/data/styles/epub3.css +1266 -0
- data/lib/asciidoctor-epub3.rb +11 -0
- data/lib/asciidoctor-epub3/converter.rb +951 -0
- data/lib/asciidoctor-epub3/ext.rb +4 -0
- data/lib/asciidoctor-epub3/ext/asciidoctor.rb +3 -0
- data/lib/asciidoctor-epub3/ext/asciidoctor/logging_shim.rb +33 -0
- data/lib/asciidoctor-epub3/ext/core.rb +3 -0
- data/lib/asciidoctor-epub3/ext/core/string.rb +9 -0
- data/lib/asciidoctor-epub3/font_icon_map.rb +378 -0
- data/lib/asciidoctor-epub3/packager.rb +722 -0
- data/lib/asciidoctor-epub3/spine_item_processor.rb +92 -0
- data/lib/asciidoctor-epub3/version.rb +7 -0
- metadata +237 -0
data/Rakefile
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'lib/asciidoctor-epub3/version'
|
4
|
+
require 'open3' unless defined? Open3
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = 'asciidoctor-epub3'
|
8
|
+
s.version = Asciidoctor::Epub3::VERSION
|
9
|
+
|
10
|
+
s.summary = 'Converts AsciiDoc documents to EPUB3 and KF8/MOBI (Kindle) e-book formats'
|
11
|
+
s.description = <<-EOS
|
12
|
+
An extension for Asciidoctor that converts AsciiDoc documents to EPUB3 and KF8/MOBI (Kindle) e-book archives.
|
13
|
+
EOS
|
14
|
+
|
15
|
+
s.authors = ['Dan Allen', 'Sarah White']
|
16
|
+
s.email = 'dan@opendevise.com'
|
17
|
+
s.homepage = 'https://github.com/asciidoctor/asciidoctor-epub3'
|
18
|
+
s.license = 'MIT'
|
19
|
+
|
20
|
+
s.required_ruby_version = '>= 2.3.0'
|
21
|
+
|
22
|
+
files = begin
|
23
|
+
(result = Open3.popen3('git ls-files -z') {|_, out| out.read }.split %(\0)).empty? ? Dir['**/*'] : result
|
24
|
+
rescue
|
25
|
+
Dir['**/*']
|
26
|
+
end
|
27
|
+
s.files = files.grep %r/^(?:(?:data\/(?:fonts|images|styles)|lib)\/.+|Gemfile|Rakefile|(?:CHANGELOG|LICENSE|NOTICE|README)\.adoc|\.yardopts|#{s.name}\.gemspec)$/
|
28
|
+
s.executables = %w(asciidoctor-epub3 adb-push-ebook)
|
29
|
+
s.test_files = s.files.grep(/^(?:test|spec|feature)\/.*$/)
|
30
|
+
|
31
|
+
s.require_paths = ['lib']
|
32
|
+
|
33
|
+
s.add_development_dependency 'rake', '~> 13.0.0'
|
34
|
+
s.add_development_dependency 'rspec', '~> 3.9.0'
|
35
|
+
s.add_development_dependency 'rubocop', '~> 0.79.0'
|
36
|
+
s.add_development_dependency 'rubocop-rspec', '~> 1.37.0'
|
37
|
+
|
38
|
+
s.add_runtime_dependency 'asciidoctor', '>= 1.5.3', '< 3.0.0'
|
39
|
+
s.add_runtime_dependency 'epubcheck-ruby', '~> 4.2.2.0'
|
40
|
+
s.add_runtime_dependency 'gepub', '~> 1.0.0'
|
41
|
+
s.add_runtime_dependency 'kindlegen', '>= 3.0.3', '<= 3.0.5'
|
42
|
+
end
|
data/bin/adb-push-ebook
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
ADB = ENV['ADB'] || 'adb'
|
5
|
+
TARGETS = {
|
6
|
+
'.epub' => '/sdcard/',
|
7
|
+
'.mobi' => '/sdcard/Android/data/com.amazon.kindle/files/',
|
8
|
+
}
|
9
|
+
|
10
|
+
unless ::File.executable? ADB
|
11
|
+
warn %(adb-push-ebook: `adb` not found.\nPlease set the ADB environment variable or add `adb` to your PATH.)
|
12
|
+
exit 1
|
13
|
+
end
|
14
|
+
|
15
|
+
require 'open3'
|
16
|
+
require 'shellwords'
|
17
|
+
|
18
|
+
payload_file = ARGV[0] || '_output/sample-book'
|
19
|
+
|
20
|
+
if (payload_file_ext = File.extname payload_file).empty?
|
21
|
+
transfers = TARGETS.map do |(ext, target_dir)|
|
22
|
+
{
|
23
|
+
src: %(#{payload_file}#{ext}),
|
24
|
+
dest: target_dir,
|
25
|
+
}
|
26
|
+
end
|
27
|
+
else
|
28
|
+
transfers = [{ src: payload_file, dest: TARGETS[payload_file_ext] }]
|
29
|
+
end
|
30
|
+
|
31
|
+
transfers.each do |transfer|
|
32
|
+
Open3.popen2e Shellwords.join([ADB, 'push', transfer[:src], transfer[:dest]]) do |_input, output, _wait_thr|
|
33
|
+
output.each {|line| puts line }
|
34
|
+
end if File.file? transfer[:src]
|
35
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
if File.exist? asciidoctor_epub3 = (File.expand_path '../lib/asciidoctor-epub3', __dir__)
|
5
|
+
require asciidoctor_epub3
|
6
|
+
else
|
7
|
+
require 'asciidoctor-epub3'
|
8
|
+
end
|
9
|
+
require 'asciidoctor/cli'
|
10
|
+
|
11
|
+
options = Asciidoctor::Cli::Options.new backend: 'epub3'
|
12
|
+
|
13
|
+
# FIXME: provide an API in Asciidoctor for sub-components to print version information
|
14
|
+
unless ARGV != ['-v'] && (ARGV & ['-V', '--version']).empty?
|
15
|
+
require_relative '../lib/asciidoctor-epub3/version'
|
16
|
+
$stdout.write %(Asciidoctor EPUB3 #{Asciidoctor::Epub3::VERSION} using )
|
17
|
+
options.print_version
|
18
|
+
exit 0
|
19
|
+
end
|
20
|
+
|
21
|
+
# FIXME: This is a really bizarre API. Please make me simpler.
|
22
|
+
case (result = options.parse! ARGV)
|
23
|
+
when Integer
|
24
|
+
exit result
|
25
|
+
else
|
26
|
+
invoker = Asciidoctor::Cli::Invoker.new options
|
27
|
+
GC.start
|
28
|
+
invoker.invoke!
|
29
|
+
exit invoker.code
|
30
|
+
end
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,67 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
2
|
+
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
3
|
+
|
4
|
+
<svg
|
5
|
+
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
6
|
+
xmlns:cc="http://creativecommons.org/ns#"
|
7
|
+
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
8
|
+
xmlns:svg="http://www.w3.org/2000/svg"
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
10
|
+
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
11
|
+
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
12
|
+
width="125"
|
13
|
+
height="125"
|
14
|
+
id="svg3896"
|
15
|
+
version="1.1"
|
16
|
+
inkscape:version="0.48.4 r9939"
|
17
|
+
sodipodi:docname="default-avatar.svg">
|
18
|
+
<defs
|
19
|
+
id="defs3898" />
|
20
|
+
<sodipodi:namedview
|
21
|
+
id="base"
|
22
|
+
pagecolor="#ffffff"
|
23
|
+
bordercolor="#666666"
|
24
|
+
borderopacity="1.0"
|
25
|
+
inkscape:pageopacity="0.0"
|
26
|
+
inkscape:pageshadow="2"
|
27
|
+
inkscape:zoom="1.4385429"
|
28
|
+
inkscape:cx="57.476305"
|
29
|
+
inkscape:cy="126.28564"
|
30
|
+
inkscape:document-units="px"
|
31
|
+
inkscape:current-layer="layer1"
|
32
|
+
showgrid="false"
|
33
|
+
inkscape:window-width="2560"
|
34
|
+
inkscape:window-height="1337"
|
35
|
+
inkscape:window-x="0"
|
36
|
+
inkscape:window-y="49"
|
37
|
+
inkscape:window-maximized="1" />
|
38
|
+
<metadata
|
39
|
+
id="metadata3901">
|
40
|
+
<rdf:RDF>
|
41
|
+
<cc:Work
|
42
|
+
rdf:about="">
|
43
|
+
<dc:format>image/svg+xml</dc:format>
|
44
|
+
<dc:type
|
45
|
+
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
46
|
+
<dc:title />
|
47
|
+
</cc:Work>
|
48
|
+
</rdf:RDF>
|
49
|
+
</metadata>
|
50
|
+
<g
|
51
|
+
inkscape:label="Layer 1"
|
52
|
+
inkscape:groupmode="layer"
|
53
|
+
id="layer1"
|
54
|
+
transform="translate(0,-927.36218)">
|
55
|
+
<text
|
56
|
+
xml:space="preserve"
|
57
|
+
style="font-size:144px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#242422;fill-opacity:1;stroke:none;font-family:FontAwesome;-inkscape-font-specification:FontAwesome"
|
58
|
+
x="5.9285712"
|
59
|
+
y="1041.2908"
|
60
|
+
id="text3904"
|
61
|
+
sodipodi:linespacing="125%"><tspan
|
62
|
+
sodipodi:role="line"
|
63
|
+
id="tspan3906"
|
64
|
+
x="5.9285712"
|
65
|
+
y="1041.2908"></tspan></text>
|
66
|
+
</g>
|
67
|
+
</svg>
|
@@ -0,0 +1,53 @@
|
|
1
|
+
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
2
|
+
<svg xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" viewBox="0 0 1050 1600">
|
3
|
+
<defs>
|
4
|
+
<filter id="filter3874" color-interpolation-filters="sRGB">
|
5
|
+
<feGaussianBlur stdDeviation="0.01 5" in="SourceGraphic"/>
|
6
|
+
</filter>
|
7
|
+
<filter id="filter4056" color-interpolation-filters="sRGB">
|
8
|
+
<feGaussianBlur in="SourceGraphic" stdDeviation="3" result="result6"/>
|
9
|
+
<feColorMatrix in="SourceGraphic" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 " result="result7"/>
|
10
|
+
<feComposite operator="in" result="fbSourceGraphic" in2="result7" in="result6"/>
|
11
|
+
<feColorMatrix values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" result="fbSourceGraphicAlpha" in="fbSourceGraphic"/>
|
12
|
+
<feGaussianBlur in="fbSourceGraphic" stdDeviation="3" result="result6"/>
|
13
|
+
<feColorMatrix in="fbSourceGraphic" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 " result="result7"/>
|
14
|
+
<feComposite operator="in" in2="result7" in="result6"/>
|
15
|
+
</filter>
|
16
|
+
<filter id="filter4098" color-interpolation-filters="sRGB">
|
17
|
+
<feGaussianBlur in="SourceGraphic" stdDeviation="3" result="result6"/>
|
18
|
+
<feColorMatrix in="SourceGraphic" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 " result="result7"/>
|
19
|
+
<feComposite operator="in" result="fbSourceGraphic" in2="result7" in="result6"/>
|
20
|
+
<feColorMatrix values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" result="fbSourceGraphicAlpha" in="fbSourceGraphic"/>
|
21
|
+
<feGaussianBlur in="fbSourceGraphic" stdDeviation="3" result="result6"/>
|
22
|
+
<feColorMatrix in="fbSourceGraphic" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 " result="result7"/>
|
23
|
+
<feComposite operator="in" in2="result7" in="result6"/>
|
24
|
+
</filter>
|
25
|
+
</defs>
|
26
|
+
<metadata>
|
27
|
+
<rdf:RDF>
|
28
|
+
<cc:Work rdf:about="">
|
29
|
+
<dc:format>image/svg+xml</dc:format>
|
30
|
+
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
|
31
|
+
<dc:title/>
|
32
|
+
</cc:Work>
|
33
|
+
</rdf:RDF>
|
34
|
+
</metadata>
|
35
|
+
<rect style="enable-background:accumulate;fill-rule:nonzero;color:#000000;fill:#333332;" height="1600" width="1050" y="0" x="0"/>
|
36
|
+
<rect style="enable-background:accumulate;fill-rule:nonzero;color:#000000;fill:#264e2e;" height="20" width="1050" y="468" x="0"/>
|
37
|
+
<path style="filter:url(#filter4056);fill:#264e2e;" d="m525,349.3-495,25c127.6,50,67.95,230,40,240l455-10,455,10c-27.95-10-87.65-190,40-240l-495-25z"/>
|
38
|
+
<path style="filter:url(#filter4098);fill:#57ad68;" d="m525,379.3-460,5c93.17,34.67,55,190,40,205h420,420c-15-15-53.17-170.3,40-205l-460-5z"/>
|
39
|
+
<path style="fill:#333332;" d="m95,394.3c55.42,25.11,45.36,131.3,35,165l395,15,395-15c-10.36-33.66-20.42-139.9,35-165l-430,5-430-5z"/>
|
40
|
+
<rect style="enable-background:accumulate;fill-rule:nonzero;color:#000000;filter:url(#filter3874);fill:#264e2e;" height="169.5" width="1050" y="1435" x="0"/>
|
41
|
+
<rect style="enable-background:accumulate;fill-rule:nonzero;color:#000000;fill:#57ad68;" height="6" width="1050" y="1453" x="0"/>
|
42
|
+
<g transform="translate(1.2573242e-5,-10)">
|
43
|
+
<text style="font-size:86px;stroke-width:3;writing-mode:lr-tb;fill:#b3b3b1;letter-spacing:-4px;text-anchor:start;line-height:100%;word-spacing:0px;stroke:#b3b3b1;font-stretch:normal;stroke-miterlimit:4;font-family:'M+ 1p';font-variant:normal;stroke-dasharray:none;font-weight:bold;font-style:normal;text-align:start;" y="529.82001" x="162.99142" xml:space="preserve"><tspan y="529.82001" x="162.99142">Asciidoctor</tspan></text>
|
44
|
+
<text style="font-size:86px;stroke-width:3;writing-mode:lr-tb;fill:#b3b3b1;letter-spacing:-4px;text-anchor:start;line-height:100%;word-spacing:0px;stroke:#b3b3b1;font-stretch:normal;stroke-miterlimit:4;font-family:'M+ 1p';font-variant:normal;stroke-dasharray:none;font-weight:bold;font-style:normal;text-align:start;" xml:space="preserve" y="529.82001" x="632.99139"><tspan x="632.99139" y="529.82001">EPUB3</tspan></text>
|
45
|
+
</g>
|
46
|
+
<g transform="translate(1.2573242e-5,-10)">
|
47
|
+
<text style="font-size:86px;font-family:'M+ 1p';writing-mode:lr-tb;fill:#ffffff;letter-spacing:-4px;text-anchor:start;line-height:100%;word-spacing:0px;font-stretch:normal;font-variant:normal;font-weight:bold;font-style:normal;text-align:start;" xml:space="preserve" y="529.82001" x="162.99142"><tspan x="162.99142" y="529.82001">Asciidoctor</tspan></text>
|
48
|
+
<text style="font-size:86px;font-family:'M+ 1p';writing-mode:lr-tb;fill:#ffffff;letter-spacing:-4px;text-anchor:start;line-height:100%;word-spacing:0px;font-stretch:normal;font-variant:normal;font-weight:bold;font-style:normal;text-align:start;" y="529.82001" x="632.99139" xml:space="preserve"><tspan y="529.82001" x="632.99139">EPUB3</tspan></text>
|
49
|
+
</g>
|
50
|
+
<g transform="translate(0,547.6378)">
|
51
|
+
<path style="stroke-linejoin:miter;stroke:#122616;stroke-linecap:square;stroke-miterlimit:4;stroke-dasharray:none;stroke-width:32;fill:none;" d="m11.87,3098,1021,0"/>
|
52
|
+
</g>
|
53
|
+
</svg>
|
Binary file
|
Binary file
|
@@ -0,0 +1,28 @@
|
|
1
|
+
.palette-grayscale {
|
2
|
+
color: #191918; /* black :: literal, blockquote text */
|
3
|
+
color: #333332; /* off-black :: body text, heading default, chapter header background */
|
4
|
+
color: #4F4F4C; /* deep gray :: h4 */
|
5
|
+
/* what about 40403E or 4C4C4B? for h4 */
|
6
|
+
color: #666665; /* dark gray :: h5, visited link, list bullets, abstract, caption, open quote */
|
7
|
+
color: #80807F; /* medium gray :: table borders */
|
8
|
+
color: #B3B3B1; /* gray :: chapter title, footer subtitle, sidebar border */
|
9
|
+
color: #DCDCDE; /* lighter gray :: footer lines, byline text, pre border, masthead bottom line */
|
10
|
+
/* what about DEDEDC instead of DCDCDE? */
|
11
|
+
color: #F2F2F2; /* off white :: pre background, sidebar background */
|
12
|
+
color: #FFFFFF; /* white :: chapter subtitle */
|
13
|
+
}
|
14
|
+
|
15
|
+
.palette-color {
|
16
|
+
color: #468C54; /* medium green :: code annotation numbers */
|
17
|
+
color: #57AD68; /* green :: end mark, chapter title keyword */
|
18
|
+
color: #A9D8B2; /* light green */
|
19
|
+
}
|
20
|
+
|
21
|
+
/*
|
22
|
+
type scale::
|
23
|
+
50 2.27
|
24
|
+
32 1.45
|
25
|
+
30 1.36
|
26
|
+
24 1.1
|
27
|
+
22 1
|
28
|
+
*/
|
@@ -0,0 +1,226 @@
|
|
1
|
+
/* @page is for EPUB2 only */
|
2
|
+
@page {
|
3
|
+
margin: 0;
|
4
|
+
}
|
5
|
+
|
6
|
+
body.calibre-desktop {
|
7
|
+
padding: 20pt 0 !important;
|
8
|
+
}
|
9
|
+
|
10
|
+
body.calibre-desktop > section {
|
11
|
+
margin: 0 25pt;
|
12
|
+
}
|
13
|
+
|
14
|
+
/* Gitden & Namo default to 16px font-size; bump it to 19px (118.75%) */
|
15
|
+
body.gitden-reader,
|
16
|
+
body.namo-epub-library {
|
17
|
+
font-size: 118.75%;
|
18
|
+
}
|
19
|
+
|
20
|
+
/* Gitden doesn't give us much margin, so let's roughly match Aldiko and Kindle (narrow setting) */
|
21
|
+
body.gitden-reader {
|
22
|
+
margin: 0 5pt !important;
|
23
|
+
}
|
24
|
+
|
25
|
+
/* Namo has the same margin problem, except setting side margins doesn't work */
|
26
|
+
/*body.namo-epub-library > section.chapter {
|
27
|
+
margin: 0 5pt;
|
28
|
+
}*/
|
29
|
+
|
30
|
+
/* Use tighter margins and smaller font (18px) on phones (Nexus 4 and smaller) */
|
31
|
+
@media only screen and (max-device-width: 768px) and (max-device-height: 1280px),
|
32
|
+
only screen and (max-device-width: 1280px) and (max-device-height: 768px) {
|
33
|
+
body.gitden-reader,
|
34
|
+
body.namo-epub-library {
|
35
|
+
font-size: 112.5%;
|
36
|
+
}
|
37
|
+
|
38
|
+
/*body.gitden-reader {
|
39
|
+
margin: 0 5pt !important;
|
40
|
+
}*/
|
41
|
+
|
42
|
+
/*body.namo-epub-library > section.chapter {
|
43
|
+
margin: 0 5pt;
|
44
|
+
}*/
|
45
|
+
}
|
46
|
+
|
47
|
+
body.gitden-reader pre {
|
48
|
+
white-space: pre-wrap !important; /* Gitden must be applying white-space: pre !important */
|
49
|
+
}
|
50
|
+
|
51
|
+
body h1, body h2, body h3:not(.list-heading), body h4, body h5, body h6,
|
52
|
+
h1 :not(code), h2 :not(code), h3:not(.list-heading) :not(code), h4 :not(code), h5 :not(code), h6 :not(code) {
|
53
|
+
/* !important required to override custom font setting in Kindle / Gitden / Namo */
|
54
|
+
/* Gitden requires the extra weight of a parent selector; it also makes headings bold when custom font is specified */
|
55
|
+
/* Kindle and Gitden require the override on heading child elements */
|
56
|
+
font-family: "M+ 1p", sans-serif !important;
|
57
|
+
}
|
58
|
+
|
59
|
+
/* QUESTION what about nested elements inside code? */
|
60
|
+
body code, body kbd, body pre, pre :not(code) {
|
61
|
+
/* !important required to override custom font setting in Kindle / Gitden / Namo */
|
62
|
+
/* Gitden requires the extra weight of a parent selector */
|
63
|
+
/* Kindle and Gitden require the override on pre child elements */
|
64
|
+
font-family: "M+ 1mn", monospace !important;
|
65
|
+
}
|
66
|
+
|
67
|
+
@media amzn-kf8 {
|
68
|
+
/* Kindle does its own margin management, so don't use an explicit margin */
|
69
|
+
/*body {
|
70
|
+
margin: 0 !important;
|
71
|
+
}*/
|
72
|
+
|
73
|
+
/* text-rendering is the only way to enable kerning in Kindle (and Calibre, though it seems to kern automatically) */
|
74
|
+
/* personally, I think Kindle overdoes kerning, but we're running with it for now */
|
75
|
+
/* text-rendering: optimizeLegibility kills certain Kindle eInk devices */
|
76
|
+
/*h1, h2, h3, h4, h5, h6,
|
77
|
+
body p, li, dd, blockquote > footer,
|
78
|
+
th, td, figcaption, caption {
|
79
|
+
text-rendering: optimizeLegibility;
|
80
|
+
}*/
|
81
|
+
|
82
|
+
/* hack line height of subtitle using floats on Kindle */
|
83
|
+
h1.chapter-title .subtitle {
|
84
|
+
margin-top: -0.2em;
|
85
|
+
margin-bottom: 0.3em; /* compensate for reduced line height */
|
86
|
+
}
|
87
|
+
|
88
|
+
/* NOTE using b instead of span since Firefox ePubReader applies immutable styles to span */
|
89
|
+
h1.chapter-title .subtitle > b {
|
90
|
+
float: left;
|
91
|
+
display: inline-block;
|
92
|
+
margin-bottom: -0.3em; /* reduce the line height */
|
93
|
+
padding-right: 0.2em; /* spacing between words */
|
94
|
+
}
|
95
|
+
|
96
|
+
h1.chapter-title .subtitle > b:last-child {
|
97
|
+
padding-right: 0;
|
98
|
+
}
|
99
|
+
|
100
|
+
h1.chapter-title .subtitle::after {
|
101
|
+
display: table;
|
102
|
+
content: ' ';
|
103
|
+
clear: both;
|
104
|
+
}
|
105
|
+
}
|
106
|
+
|
107
|
+
/* Use darker font colors on Kindle Paperwhite */
|
108
|
+
@media amzn-kf8 and (device-height: 1024px) and (device-width: 758px),
|
109
|
+
amzn-kf8 and (device-height: 758px) and (device-width: 1024px) {
|
110
|
+
body p,
|
111
|
+
div.abstract > p,
|
112
|
+
ul, ol, li, dl, dt, dd, footer,
|
113
|
+
div.verse .attribution, table.table th, table.table td,
|
114
|
+
figcaption, caption,
|
115
|
+
h1, h2, h3, h4, h5 {
|
116
|
+
color: #000000;
|
117
|
+
}
|
118
|
+
|
119
|
+
body a:link,
|
120
|
+
div.abstract > p a:link {
|
121
|
+
color: #000000;
|
122
|
+
-webkit-text-fill-color: #000000;
|
123
|
+
}
|
124
|
+
|
125
|
+
body a:visited {
|
126
|
+
color: #333332;
|
127
|
+
-webkit-text-fill-color: #333332;
|
128
|
+
}
|
129
|
+
|
130
|
+
.chapter-header {
|
131
|
+
color: #191918;
|
132
|
+
border-bottom-color: #191918;
|
133
|
+
}
|
134
|
+
|
135
|
+
h1.chapter-title .subtitle,
|
136
|
+
.chapter-header p.byline {
|
137
|
+
color: #000000;
|
138
|
+
}
|
139
|
+
}
|
140
|
+
|
141
|
+
.chapter-header p.byline {
|
142
|
+
height: auto; /* Aldiko requires this value to be 0; reset it for all others */
|
143
|
+
}
|
144
|
+
|
145
|
+
/* Font-based icons */
|
146
|
+
.icon {
|
147
|
+
display: inline-block;
|
148
|
+
/* !important required to override custom font setting in Kindle (since .icon can appear inside a span) */
|
149
|
+
font-family: "FontAwesome" !important;
|
150
|
+
font-style: normal !important;
|
151
|
+
font-weight: normal !important;
|
152
|
+
line-height: 1;
|
153
|
+
}
|
154
|
+
|
155
|
+
.icon-1_5x {
|
156
|
+
padding: 0 0.25em;
|
157
|
+
-webkit-transform: scale(1.5, 1.5);
|
158
|
+
transform: scale(1.5, 1.5);
|
159
|
+
}
|
160
|
+
|
161
|
+
.icon-2x {
|
162
|
+
padding: 0 0.5em;
|
163
|
+
-webkit-transform: scale(2, 2);
|
164
|
+
transform: scale(2, 2);
|
165
|
+
}
|
166
|
+
|
167
|
+
.icon-small {
|
168
|
+
font-size: 0.85em;
|
169
|
+
vertical-align: 0.075em;
|
170
|
+
}
|
171
|
+
|
172
|
+
.icon-1_5em {
|
173
|
+
font-size: 1.5em;
|
174
|
+
}
|
175
|
+
|
176
|
+
.icon-2em {
|
177
|
+
font-size: 2em;
|
178
|
+
}
|
179
|
+
|
180
|
+
.icon-3em {
|
181
|
+
font-size: 3em;
|
182
|
+
}
|
183
|
+
|
184
|
+
.icon-4em {
|
185
|
+
font-size: 4em;
|
186
|
+
}
|
187
|
+
|
188
|
+
.icon-rotate-90 {
|
189
|
+
-webkit-transform: rotate(90deg);
|
190
|
+
transform: rotate(90deg);
|
191
|
+
}
|
192
|
+
|
193
|
+
.icon-rotate-90i {
|
194
|
+
-webkit-transform: scale(-1, 1) rotate(90deg);
|
195
|
+
transform: scale(-1, 1) rotate(90deg);
|
196
|
+
}
|
197
|
+
|
198
|
+
.icon-rotate-180 {
|
199
|
+
-webkit-transform: rotate(180deg);
|
200
|
+
transform: rotate(180deg);
|
201
|
+
}
|
202
|
+
|
203
|
+
.icon-rotate-180i {
|
204
|
+
-webkit-transform: scale(-1, 1) rotate(180deg);
|
205
|
+
transform: scale(-1, 1) rotate(180deg);
|
206
|
+
}
|
207
|
+
|
208
|
+
.icon-rotate-270 {
|
209
|
+
-webkit-transform: rotate(270deg);
|
210
|
+
transform: rotate(270deg);
|
211
|
+
}
|
212
|
+
|
213
|
+
.icon-rotate-270i {
|
214
|
+
-webkit-transform: scale(-1, 1) rotate(270deg);
|
215
|
+
transform: scale(-1, 1) rotate(270deg);
|
216
|
+
}
|
217
|
+
|
218
|
+
.icon-flip-h {
|
219
|
+
-webkit-transform: scale(-1, 1);
|
220
|
+
transform: scale(-1, 1);
|
221
|
+
}
|
222
|
+
|
223
|
+
.icon-flip-v {
|
224
|
+
-webkit-transform: scale(1, -1);
|
225
|
+
transform: scale(1, -1);
|
226
|
+
}
|