kitabu 1.0.0.rc1 → 1.0.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. data/Gemfile.lock +14 -20
  2. data/README.rdoc +54 -23
  3. data/kitabu.gemspec +1 -1
  4. data/lib/kitabu.rb +11 -4
  5. data/lib/kitabu/cli.rb +49 -6
  6. data/lib/kitabu/dependency.rb +19 -0
  7. data/lib/kitabu/exporter.rb +4 -5
  8. data/lib/kitabu/generator.rb +12 -15
  9. data/lib/kitabu/parser.rb +27 -2
  10. data/lib/kitabu/parser/epub.rb +96 -83
  11. data/lib/kitabu/parser/html.rb +51 -16
  12. data/lib/kitabu/parser/mobi.rb +1 -4
  13. data/lib/kitabu/parser/pdf.rb +23 -20
  14. data/lib/kitabu/parser/txt.rb +1 -5
  15. data/lib/kitabu/syntax.rb +5 -3
  16. data/lib/kitabu/syntax/highlight.rb +22 -0
  17. data/lib/kitabu/toc.rb +4 -78
  18. data/lib/kitabu/toc/epub.rb +41 -0
  19. data/lib/kitabu/toc/html.rb +78 -0
  20. data/lib/kitabu/version.rb +1 -1
  21. data/spec/kitabu/cli/export_spec.rb +2 -2
  22. data/spec/kitabu/cli/new_spec.rb +1 -1
  23. data/spec/kitabu/cli/permalinks_spec.rb +1 -1
  24. data/spec/kitabu/cli/version_spec.rb +1 -1
  25. data/spec/kitabu/extensions/redcloth_spec.rb +6 -6
  26. data/spec/kitabu/extensions/string_spec.rb +1 -1
  27. data/spec/kitabu/parser/epub_spec.rb +5 -1
  28. data/spec/kitabu/parser/html_spec.rb +15 -15
  29. data/spec/kitabu/parser/pdf_spec.rb +4 -4
  30. data/spec/kitabu/syntax_spec.rb +78 -74
  31. data/spec/kitabu/{toc_spec.rb → toc/html_spec.rb} +5 -5
  32. data/spec/spec_helper.rb +3 -1
  33. data/spec/support/mybook/output/mybook.pdf.html +83 -0
  34. data/spec/support/mybook/templates/{cover.erb → epub/cover.erb} +1 -1
  35. data/spec/support/mybook/templates/{epub.erb → epub/page.erb} +1 -1
  36. data/spec/support/mybook/templates/epub/style.css +0 -0
  37. data/spec/support/mybook/templates/html/layout.css +353 -0
  38. data/spec/support/mybook/templates/html/layout.erb +50 -0
  39. data/spec/support/mybook/templates/html/syntax.css +58 -0
  40. data/spec/support/mybook/templates/html/user.css +1 -0
  41. data/spec/support/shared.rb +48 -15
  42. data/templates/cover.erb +1 -1
  43. data/templates/cover.png +0 -0
  44. data/templates/epub.css +1 -0
  45. data/templates/epub.erb +1 -1
  46. data/templates/sample.md +6 -0
  47. data/templates/syntax.css +58 -0
  48. metadata +32 -44
  49. data/spec/support/mybook/templates/epub.css +0 -1
  50. data/spec/support/mybook/templates/layout.css +0 -137
  51. data/spec/support/mybook/templates/layout.erb +0 -46
  52. data/spec/support/mybook/templates/syntax.css +0 -186
  53. data/spec/support/mybook/templates/user.css +0 -1
  54. data/templates/styles/active4d.css +0 -114
  55. data/templates/styles/all_hallows_eve.css +0 -72
  56. data/templates/styles/amy.css +0 -147
  57. data/templates/styles/blackboard.css +0 -88
  58. data/templates/styles/brilliance_black.css +0 -605
  59. data/templates/styles/brilliance_dull.css +0 -599
  60. data/templates/styles/cobalt.css +0 -149
  61. data/templates/styles/dawn.css +0 -121
  62. data/templates/styles/eiffel.css +0 -121
  63. data/templates/styles/espresso_libre.css +0 -109
  64. data/templates/styles/idle.css +0 -62
  65. data/templates/styles/iplastic.css +0 -80
  66. data/templates/styles/lazy.css +0 -73
  67. data/templates/styles/mac_classic.css +0 -123
  68. data/templates/styles/magicwb_amiga.css +0 -104
  69. data/templates/styles/pastels_on_dark.css +0 -188
  70. data/templates/styles/slush_poppies.css +0 -85
  71. data/templates/styles/spacecadet.css +0 -51
  72. data/templates/styles/sunburst.css +0 -180
  73. data/templates/styles/twilight.css +0 -137
  74. data/templates/styles/zenburnesque.css +0 -91
@@ -1,46 +0,0 @@
1
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2
- "http://www.w3.org/TR/html4/strict.dtd">
3
- <html>
4
- <head>
5
- <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
6
- <link rel="stylesheet" type="text/css" href="../templates/layout.css"/>
7
- <link rel="stylesheet" type="text/css" href="../templates/syntax.css"/>
8
- <link rel="stylesheet" type="text/css" href="../templates/user.css"/>
9
-
10
- <meta name="author" content="<%= authors.join(', ') %>" />
11
- <meta name="subject" content="<%= subject %>" />
12
- <meta name="keywords" content="<%= keywords %>" />
13
- </head>
14
- <body>
15
- <div class="frontcover container">
16
- <div>
17
- <h1><%= title %></h1>
18
- <p class="description"><%= subject %></p>
19
- <p class="authors"><%= authors.to_sentence %></p>
20
- </div>
21
- </div>
22
-
23
- <div class="toc">
24
- <h2 class="no-toc">Content</h2>
25
- <%= toc %>
26
- </div>
27
-
28
- <div id="chapters">
29
- <%= content %>
30
- </div>
31
-
32
- <div class="imprint container">
33
- <div>
34
- <h2><%= title %></h2>
35
- <p><%= authors.to_sentence %></p>
36
- <p><%= copyright %></p>
37
- </div>
38
- </div>
39
-
40
- <% if changelog %>
41
- <div class="container changelog">
42
- <%= changelog %>
43
- </div>
44
- <% end %>
45
- </body>
46
- </html>
@@ -1,186 +0,0 @@
1
- pre.idle .InheritedClass {
2
- }
3
- pre.idle .TypeName {
4
- color: #21439C;
5
- }
6
- pre.idle .Number {
7
- }
8
- pre.idle .LibraryVariable {
9
- color: #A535AE;
10
- }
11
- pre.idle .Storage {
12
- color: #FF5600;
13
- }
14
- pre.idle .line-numbers {
15
- background-color: #BAD6FD;
16
- color: #000000;
17
- }
18
- pre.idle {
19
- background-color: #FFFFFF;
20
- color: #000000;
21
- }
22
- pre.idle .StringInterpolation {
23
- color: #990000;
24
- }
25
- pre.idle .TagName {
26
- }
27
- pre.idle .LibraryConstant {
28
- color: #A535AE;
29
- }
30
- pre.idle .FunctionArgument {
31
- }
32
- pre.idle .BuiltInConstant {
33
- color: #A535AE;
34
- }
35
- pre.idle .Invalid {
36
- background-color: #990000;
37
- color: #FFFFFF;
38
- }
39
- pre.idle .LibraryClassType {
40
- color: #A535AE;
41
- }
42
- pre.idle .LibraryFunction {
43
- color: #A535AE;
44
- }
45
- pre.idle .TagAttribute {
46
- }
47
- pre.idle .Keyword {
48
- color: #FF5600;
49
- }
50
- pre.idle .UserDefinedConstant {
51
- }
52
- pre.idle .String {
53
- color: #00A33F;
54
- }
55
- pre.idle .FunctionName {
56
- color: #21439C;
57
- }
58
- pre.idle .Variable {
59
- }
60
- pre.idle .Comment {
61
- color: #919191;
62
- }
63
-
64
- pre.mac_classic .EmbeddedSource {
65
- background-color: #0C0C0C;
66
- }
67
- pre.mac_classic .LibraryObject {
68
- font-weight: bold;
69
- color: #6D79DE;
70
- }
71
- pre.mac_classic .Section {
72
- font-style: italic;
73
- }
74
- pre.mac_classic .FunctionArgumentAndResultTypes {
75
- color: #70727E;
76
- }
77
- pre.mac_classic .TypeName {
78
- text-decoration: underline;
79
- }
80
- pre.mac_classic .Number {
81
- color: #0000CD;
82
- }
83
- pre.mac_classic {
84
- background-color: #FFFFFF;
85
- color: #000000;
86
- }
87
- pre.mac_classic .MarkupList {
88
- color: #B90690;
89
- }
90
- pre.mac_classic .MarkupTagAttribute {
91
- font-style: italic;
92
- }
93
- pre.mac_classic .LibraryVariable {
94
- font-weight: bold;
95
- color: #21439C;
96
- }
97
- pre.mac_classic .line-numbers {
98
- background-color: #4D97FF;
99
- color: #000000;
100
- }
101
- pre.mac_classic .FunctionParameter {
102
- font-style: italic;
103
- }
104
- pre.mac_classic .MarkupTag {
105
- color: #1C02FF;
106
- }
107
- pre.mac_classic .MarkupHeading {
108
- font-weight: bold;
109
- color: #0C07FF;
110
- }
111
- pre.mac_classic .JsOperator {
112
- color: #687687;
113
- }
114
- pre.mac_classic .InheritedClassName {
115
- font-style: italic;
116
- }
117
- pre.mac_classic .StringInterpolation {
118
- color: #26B31A;
119
- }
120
- pre.mac_classic .MarkupQuote {
121
- color: #000000;
122
- font-style: italic;
123
- }
124
- pre.mac_classic .MarkupNameOfTag {
125
- font-weight: bold;
126
- }
127
- pre.mac_classic .InvalidTrailingWhitespace {
128
- background-color: #FFD0D0;
129
- }
130
- pre.mac_classic .LibraryConstant {
131
- font-weight: bold;
132
- color: #06960E;
133
- }
134
- pre.mac_classic .MarkupXmlDeclaration {
135
- color: #68685B;
136
- }
137
- pre.mac_classic .EmbeddedEmbeddedSource {
138
- background-color: #0E0E0E;
139
- }
140
- pre.mac_classic .PreprocessorDirective {
141
- font-weight: bold;
142
- color: #0C450D;
143
- }
144
- pre.mac_classic .BuiltInConstant {
145
- font-weight: bold;
146
- color: #585CF6;
147
- }
148
- pre.mac_classic .MarkupDtd {
149
- font-style: italic;
150
- }
151
- pre.mac_classic .Invalid {
152
- background-color: #990000;
153
- color: #FFFFFF;
154
- }
155
- pre.mac_classic .LibraryFunction {
156
- font-weight: bold;
157
- color: #3C4C72;
158
- }
159
- pre.mac_classic .String {
160
- color: #036A07;
161
- }
162
- pre.mac_classic .UserDefinedConstant {
163
- font-weight: bold;
164
- color: #C5060B;
165
- }
166
- pre.mac_classic .Keyword {
167
- font-weight: bold;
168
- color: #0000FF;
169
- }
170
- pre.mac_classic .MarkupDoctype {
171
- color: #888888;
172
- }
173
- pre.mac_classic .FunctionName {
174
- font-weight: bold;
175
- color: #0000A2;
176
- }
177
- pre.mac_classic .PreprocessorLine {
178
- color: #1A921C;
179
- }
180
- pre.mac_classic .Variable {
181
- color: #318495;
182
- }
183
- pre.mac_classic .Comment {
184
- color: #0066FF;
185
- font-style: italic;
186
- }
@@ -1 +0,0 @@
1
- /* add custom CSS */
@@ -1,114 +0,0 @@
1
- pre.active4d .DiffHeader {
2
- background-color: #656565;
3
- color: #FFFFFF;
4
- }
5
- pre.active4d .Operator {
6
- }
7
- pre.active4d .InheritedClass {
8
- }
9
- pre.active4d .TypeName {
10
- color: #21439C;
11
- }
12
- pre.active4d .Number {
13
- color: #A8017E;
14
- }
15
- pre.active4d .EmbeddedSource {
16
- background-color: #ECF1FF;
17
- }
18
- pre.active4d {
19
- background-color: #FFFFFF;
20
- color: #000000;
21
- }
22
- pre.active4d .DiffInsertedLine {
23
- background-color: #98FF9A;
24
- color: #000000;
25
- }
26
- pre.active4d .LibraryVariable {
27
- color: #A535AE;
28
- }
29
- pre.active4d .Storage {
30
- color: #FF5600;
31
- }
32
- pre.active4d .InterpolatedEntity {
33
- font-weight: bold;
34
- color: #66CCFF;
35
- }
36
- pre.active4d .line-numbers {
37
- background-color: #BAD6FD;
38
- color: #000000;
39
- }
40
- pre.active4d .LocalVariable {
41
- font-weight: bold;
42
- color: #6392FF;
43
- }
44
- pre.active4d .DiffLineRange {
45
- background-color: #1B63FF;
46
- color: #FFFFFF;
47
- }
48
- pre.active4d .BlockComment {
49
- color: #D33435;
50
- }
51
- pre.active4d .TagName {
52
- color: #016CFF;
53
- }
54
- pre.active4d .FunctionArgument {
55
- }
56
- pre.active4d .BuiltInConstant {
57
- color: #A535AE;
58
- }
59
- pre.active4d .LineComment {
60
- color: #D33535;
61
- }
62
- pre.active4d .DiffDeletedLine {
63
- background-color: #FF7880;
64
- color: #000000;
65
- }
66
- pre.active4d .NamedConstant {
67
- color: #B7734C;
68
- }
69
- pre.active4d .CommandMethod {
70
- font-weight: bold;
71
- color: #45AE34;
72
- }
73
- pre.active4d .TableField {
74
- color: #0BB600;
75
- }
76
- pre.active4d .PlainXmlText {
77
- color: #000000;
78
- }
79
- pre.active4d .Invalid {
80
- background-color: #990000;
81
- color: #FFFFFF;
82
- }
83
- pre.active4d .LibraryClassType {
84
- color: #A535AE;
85
- }
86
- pre.active4d .TagAttribute {
87
- color: #963DFF;
88
- }
89
- pre.active4d .Keyword {
90
- font-weight: bold;
91
- color: #006699;
92
- }
93
- pre.active4d .UserDefinedConstant {
94
- }
95
- pre.active4d .String {
96
- color: #666666;
97
- }
98
- pre.active4d .DiffUnchangedLine {
99
- color: #5E5E5E;
100
- }
101
- pre.active4d .TagContainer {
102
- color: #7A7A7A;
103
- }
104
- pre.active4d .FunctionName {
105
- color: #21439C;
106
- }
107
- pre.active4d .Variable {
108
- font-weight: bold;
109
- color: #0053FF;
110
- }
111
- pre.active4d .DateTimeLiteral {
112
- font-weight: bold;
113
- color: #66CCFF;
114
- }
@@ -1,72 +0,0 @@
1
- pre.all_hallows_eve .ClassInheritance {
2
- font-style: italic;
3
- }
4
- pre.all_hallows_eve .Constant {
5
- color: #3387CC;
6
- }
7
- pre.all_hallows_eve .TypeName {
8
- text-decoration: underline;
9
- }
10
- pre.all_hallows_eve .TextBase {
11
- background-color: #434242;
12
- color: #FFFFFF;
13
- }
14
- pre.all_hallows_eve {
15
- background-color: #000000;
16
- color: #FFFFFF;
17
- }
18
- pre.all_hallows_eve .StringEscapesExecuted {
19
- color: #555555;
20
- }
21
- pre.all_hallows_eve .line-numbers {
22
- background-color: #73597E;
23
- color: #FFFFFF;
24
- }
25
- pre.all_hallows_eve .StringExecuted {
26
- background-color: #CCCC33;
27
- color: #000000;
28
- }
29
- pre.all_hallows_eve .BlockComment {
30
- background-color: #9B9B9B;
31
- color: #FFFFFF;
32
- }
33
- pre.all_hallows_eve .TagName {
34
- text-decoration: underline;
35
- }
36
- pre.all_hallows_eve .PreProcessorLine {
37
- color: #D0D0FF;
38
- }
39
- pre.all_hallows_eve .SupportFunction {
40
- color: #C83730;
41
- }
42
- pre.all_hallows_eve .FunctionArgument {
43
- font-style: italic;
44
- }
45
- pre.all_hallows_eve .PreProcessorDirective {
46
- }
47
- pre.all_hallows_eve .StringEscapes {
48
- color: #AAAAAA;
49
- }
50
- pre.all_hallows_eve .SourceBase {
51
- background-color: #000000;
52
- color: #FFFFFF;
53
- }
54
- pre.all_hallows_eve .TagAttribute {
55
- }
56
- pre.all_hallows_eve .StringLiteral {
57
- color: #CCCC33;
58
- }
59
- pre.all_hallows_eve .String {
60
- color: #66CC33;
61
- }
62
- pre.all_hallows_eve .Keyword {
63
- color: #CC7833;
64
- }
65
- pre.all_hallows_eve .RegularExpression {
66
- color: #CCCC33;
67
- }
68
- pre.all_hallows_eve .FunctionName {
69
- }
70
- pre.all_hallows_eve .Comment {
71
- color: #9933CC;
72
- }
@@ -1,147 +0,0 @@
1
- pre.amy .PolymorphicVariants {
2
- color: #60B0FF;
3
- font-style: italic;
4
- }
5
- pre.amy .KeywordDecorator {
6
- color: #D0D0FF;
7
- }
8
- pre.amy .Punctuation {
9
- color: #805080;
10
- }
11
- pre.amy .InheritedClass {
12
- }
13
- pre.amy .InvalidDepricated {
14
- background-color: #CC66FF;
15
- color: #200020;
16
- }
17
- pre.amy .LibraryVariable {
18
- }
19
- pre.amy .TokenReferenceOcamlyacc {
20
- color: #3CB0D0;
21
- }
22
- pre.amy .Storage {
23
- color: #B0FFF0;
24
- }
25
- pre.amy .KeywordOperator {
26
- color: #A0A0FF;
27
- }
28
- pre.amy .CharacterConstant {
29
- color: #666666;
30
- }
31
- pre.amy .line-numbers {
32
- background-color: #800000;
33
- color: #000000;
34
- }
35
- pre.amy .ClassName {
36
- color: #70E080;
37
- }
38
- pre.amy .Int64Constant {
39
- font-style: italic;
40
- }
41
- pre.amy .NonTerminalReferenceOcamlyacc {
42
- color: #C0F0F0;
43
- }
44
- pre.amy .TokenDefinitionOcamlyacc {
45
- color: #3080A0;
46
- }
47
- pre.amy .ClassType {
48
- color: #70E0A0;
49
- }
50
- pre.amy .ControlKeyword {
51
- color: #80A0FF;
52
- }
53
- pre.amy .LineNumberDirectives {
54
- text-decoration: underline;
55
- color: #C080C0;
56
- }
57
- pre.amy .FloatingPointConstant {
58
- text-decoration: underline;
59
- }
60
- pre.amy .Int32Constant {
61
- font-weight: bold;
62
- }
63
- pre.amy .TagName {
64
- color: #009090;
65
- }
66
- pre.amy .ModuleTypeDefinitions {
67
- text-decoration: underline;
68
- color: #B000B0;
69
- }
70
- pre.amy .Integer {
71
- color: #7090B0;
72
- }
73
- pre.amy .Camlp4TempParser {
74
- }
75
- pre.amy .InvalidIllegal {
76
- font-weight: bold;
77
- background-color: #FFFF00;
78
- color: #400080;
79
- }
80
- pre.amy .LibraryConstant {
81
- background-color: #200020;
82
- }
83
- pre.amy .ModuleDefinitions {
84
- color: #B000B0;
85
- }
86
- pre.amy .Variants {
87
- color: #60B0FF;
88
- }
89
- pre.amy .CompilerDirectives {
90
- color: #C080C0;
91
- }
92
- pre.amy .FloatingPointInfixOperator {
93
- text-decoration: underline;
94
- }
95
- pre.amy .BuiltInConstant1 {
96
- }
97
- pre.amy {
98
- background-color: #200020;
99
- color: #D0D0FF;
100
- }
101
- pre.amy .FunctionArgument {
102
- color: #80B0B0;
103
- }
104
- pre.amy .FloatingPointPrefixOperator {
105
- text-decoration: underline;
106
- }
107
- pre.amy .NativeintConstant {
108
- font-weight: bold;
109
- }
110
- pre.amy .BuiltInConstant {
111
- color: #707090;
112
- }
113
- pre.amy .BooleanConstant {
114
- color: #8080A0;
115
- }
116
- pre.amy .LibraryClassType {
117
- }
118
- pre.amy .TagAttribute {
119
- }
120
- pre.amy .Keyword {
121
- color: #A080FF;
122
- }
123
- pre.amy .UserDefinedConstant {
124
- }
125
- pre.amy .String {
126
- color: #999999;
127
- }
128
- pre.amy .Camlp4Code {
129
- background-color: #350060;
130
- }
131
- pre.amy .NonTerminalDefinitionOcamlyacc {
132
- color: #90E0E0;
133
- }
134
- pre.amy .FunctionName {
135
- color: #50A0A0;
136
- }
137
- pre.amy .SupportModules {
138
- color: #A00050;
139
- }
140
- pre.amy .Variable {
141
- color: #008080;
142
- }
143
- pre.amy .Comment {
144
- background-color: #200020;
145
- color: #404080;
146
- font-style: italic;
147
- }