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,62 +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
- }
@@ -1,80 +0,0 @@
1
- pre.iplastic .Constant {
2
- color: #6782D3;
3
- }
4
- pre.iplastic .Support {
5
- font-weight: bold;
6
- color: #3333FF;
7
- }
8
- pre.iplastic .EmbeddedSource {
9
- background-color: #F9F9F9;
10
- color: #000000;
11
- }
12
- pre.iplastic .Arguments {
13
- font-style: italic;
14
- }
15
- pre.iplastic .TypeName {
16
- font-weight: bold;
17
- }
18
- pre.iplastic .Identifier {
19
- color: #9700CC;
20
- }
21
- pre.iplastic .Number {
22
- color: #0066FF;
23
- }
24
- pre.iplastic .SectionName {
25
- font-weight: bold;
26
- }
27
- pre.iplastic .Storage {
28
- font-weight: bold;
29
- }
30
- pre.iplastic .line-numbers {
31
- background-color: #BAD6FD;
32
- color: #000000;
33
- }
34
- pre.iplastic {
35
- background-color: #EEEEEE;
36
- color: #000000;
37
- }
38
- pre.iplastic .FrameTitle {
39
- font-weight: bold;
40
- color: #000000;
41
- }
42
- pre.iplastic .TagName {
43
- font-weight: bold;
44
- }
45
- pre.iplastic .Tag {
46
- color: #0033CC;
47
- }
48
- pre.iplastic .Exception {
49
- color: #990000;
50
- }
51
- pre.iplastic .XmlDeclaration {
52
- color: #333333;
53
- }
54
- pre.iplastic .TrailingWhitespace {
55
- background-color: #EEEEEE;
56
- }
57
- pre.iplastic .TagAttribute {
58
- color: #3366CC;
59
- font-style: italic;
60
- }
61
- pre.iplastic .Invalid {
62
- background-color: #E7342D;
63
- color: #FF0000;
64
- }
65
- pre.iplastic .Keyword {
66
- color: #0000FF;
67
- }
68
- pre.iplastic .String {
69
- color: #009933;
70
- }
71
- pre.iplastic .Comment {
72
- color: #0066FF;
73
- font-style: italic;
74
- }
75
- pre.iplastic .FunctionName {
76
- color: #FF8000;
77
- }
78
- pre.iplastic .RegularExpression {
79
- color: #FF0080;
80
- }
@@ -1,73 +0,0 @@
1
- pre.lazy .OcamlInfixFPOperator {
2
- text-decoration: underline;
3
- }
4
- pre.lazy .OcamlInfixOperator {
5
- color: #3B5BB5;
6
- }
7
- pre.lazy .MetaFunctionCallPy {
8
- color: #3E4558;
9
- }
10
- pre.lazy .Superclass {
11
- color: #3B5BB5;
12
- font-style: italic;
13
- }
14
- pre.lazy .LatexEntity {
15
- color: #D62A28;
16
- }
17
- pre.lazy .Constant {
18
- color: #3B5BB5;
19
- }
20
- pre.lazy .OcamlFPConstant {
21
- text-decoration: underline;
22
- }
23
- pre.lazy .Support {
24
- color: #3B5BB5;
25
- }
26
- pre.lazy .OcamlOperator {
27
- color: #000000;
28
- }
29
- pre.lazy .line-numbers {
30
- background-color: #E3FC8D;
31
- color: #000000;
32
- }
33
- pre.lazy .StringInterpolation {
34
- color: #671EBB;
35
- }
36
- pre.lazy .InvalidIllegal {
37
- background-color: #9D1E15;
38
- color: #F8F8F8;
39
- }
40
- pre.lazy .OcamlVariant {
41
- color: #7F90AA;
42
- }
43
- pre.lazy .MetaTag {
44
- color: #3A4A64;
45
- }
46
- pre.lazy .OcamlPrefixFPOperator {
47
- text-decoration: underline;
48
- }
49
- pre.lazy .OcamlPrefixOperator {
50
- color: #3B5BB5;
51
- }
52
- pre.lazy .String {
53
- color: #409B1C;
54
- }
55
- pre.lazy .Keyword {
56
- color: #FF7800;
57
- }
58
- pre.lazy {
59
- background-color: #FFFFFF;
60
- color: #000000;
61
- }
62
- pre.lazy .InvalidDeprecated {
63
- color: #990000;
64
- font-style: italic;
65
- }
66
- pre.lazy .Variable {
67
- }
68
- pre.lazy .Entity {
69
- color: #3B5BB5;
70
- }
71
- pre.lazy .Comment {
72
- color: #8C868F;
73
- }
@@ -1,123 +0,0 @@
1
- pre.mac_classic .EmbeddedSource {
2
- background-color: #0C0C0C;
3
- }
4
- pre.mac_classic .LibraryObject {
5
- font-weight: bold;
6
- color: #6D79DE;
7
- }
8
- pre.mac_classic .Section {
9
- font-style: italic;
10
- }
11
- pre.mac_classic .FunctionArgumentAndResultTypes {
12
- color: #70727E;
13
- }
14
- pre.mac_classic .TypeName {
15
- text-decoration: underline;
16
- }
17
- pre.mac_classic .Number {
18
- color: #0000CD;
19
- }
20
- pre.mac_classic {
21
- background-color: #FFFFFF;
22
- color: #000000;
23
- }
24
- pre.mac_classic .MarkupList {
25
- color: #B90690;
26
- }
27
- pre.mac_classic .MarkupTagAttribute {
28
- font-style: italic;
29
- }
30
- pre.mac_classic .LibraryVariable {
31
- font-weight: bold;
32
- color: #21439C;
33
- }
34
- pre.mac_classic .line-numbers {
35
- background-color: #4D97FF;
36
- color: #000000;
37
- }
38
- pre.mac_classic .FunctionParameter {
39
- font-style: italic;
40
- }
41
- pre.mac_classic .MarkupTag {
42
- color: #1C02FF;
43
- }
44
- pre.mac_classic .MarkupHeading {
45
- font-weight: bold;
46
- color: #0C07FF;
47
- }
48
- pre.mac_classic .JsOperator {
49
- color: #687687;
50
- }
51
- pre.mac_classic .InheritedClassName {
52
- font-style: italic;
53
- }
54
- pre.mac_classic .StringInterpolation {
55
- color: #26B31A;
56
- }
57
- pre.mac_classic .MarkupQuote {
58
- color: #000000;
59
- font-style: italic;
60
- }
61
- pre.mac_classic .MarkupNameOfTag {
62
- font-weight: bold;
63
- }
64
- pre.mac_classic .InvalidTrailingWhitespace {
65
- background-color: #FFD0D0;
66
- }
67
- pre.mac_classic .LibraryConstant {
68
- font-weight: bold;
69
- color: #06960E;
70
- }
71
- pre.mac_classic .MarkupXmlDeclaration {
72
- color: #68685B;
73
- }
74
- pre.mac_classic .EmbeddedEmbeddedSource {
75
- background-color: #0E0E0E;
76
- }
77
- pre.mac_classic .PreprocessorDirective {
78
- font-weight: bold;
79
- color: #0C450D;
80
- }
81
- pre.mac_classic .BuiltInConstant {
82
- font-weight: bold;
83
- color: #585CF6;
84
- }
85
- pre.mac_classic .MarkupDtd {
86
- font-style: italic;
87
- }
88
- pre.mac_classic .Invalid {
89
- background-color: #990000;
90
- color: #FFFFFF;
91
- }
92
- pre.mac_classic .LibraryFunction {
93
- font-weight: bold;
94
- color: #3C4C72;
95
- }
96
- pre.mac_classic .String {
97
- color: #036A07;
98
- }
99
- pre.mac_classic .UserDefinedConstant {
100
- font-weight: bold;
101
- color: #C5060B;
102
- }
103
- pre.mac_classic .Keyword {
104
- font-weight: bold;
105
- color: #0000FF;
106
- }
107
- pre.mac_classic .MarkupDoctype {
108
- color: #888888;
109
- }
110
- pre.mac_classic .FunctionName {
111
- font-weight: bold;
112
- color: #0000A2;
113
- }
114
- pre.mac_classic .PreprocessorLine {
115
- color: #1A921C;
116
- }
117
- pre.mac_classic .Variable {
118
- color: #318495;
119
- }
120
- pre.mac_classic .Comment {
121
- color: #0066FF;
122
- font-style: italic;
123
- }
@@ -1,104 +0,0 @@
1
- pre.magicwb_amiga .MarkupQuoteEmail {
2
- color: #00F0C9;
3
- }
4
- pre.magicwb_amiga .EmbeddedSource {
5
- background-color: #8A9ECB;
6
- }
7
- pre.magicwb_amiga .InheritedClass {
8
- font-style: italic;
9
- }
10
- pre.magicwb_amiga .TypeName {
11
- text-decoration: underline;
12
- }
13
- pre.magicwb_amiga .Number {
14
- color: #FFFFFF;
15
- }
16
- pre.magicwb_amiga .LibraryVariable {
17
- color: #3A68A3;
18
- }
19
- pre.magicwb_amiga .Storage {
20
- font-weight: bold;
21
- color: #3A68A3;
22
- }
23
- pre.magicwb_amiga .line-numbers {
24
- background-color: #B1B1B1;
25
- color: #000000;
26
- }
27
- pre.magicwb_amiga .IncludeUser {
28
- background-color: #969696;
29
- color: #FFA995;
30
- }
31
- pre.magicwb_amiga .ObjectiveCMethodCall {
32
- color: #000000;
33
- }
34
- pre.magicwb_amiga .ConstantUserDefined {
35
- background-color: #1D1DEA;
36
- color: #FFA995;
37
- }
38
- pre.magicwb_amiga .LibraryConstant {
39
- color: #FFFFFF;
40
- }
41
- pre.magicwb_amiga .EntityName {
42
- font-weight: bold;
43
- color: #0000FF;
44
- }
45
- pre.magicwb_amiga .ConstantBuiltIn {
46
- font-weight: bold;
47
- color: #FFA995;
48
- }
49
- pre.magicwb_amiga .MarkupRaw {
50
- background-color: #0000FF;
51
- color: #FFFFFF;
52
- }
53
- pre.magicwb_amiga .MarkupListItem {
54
- color: #4D4E60;
55
- }
56
- pre.magicwb_amiga .FunctionArgument {
57
- font-style: italic;
58
- }
59
- pre.magicwb_amiga .ObjectiveCMethodCall1 {
60
- font-style: italic;
61
- }
62
- pre.magicwb_amiga .MarkupQuoteDoubleEmail {
63
- color: #4C457E;
64
- }
65
- pre.magicwb_amiga .IncludeSystem {
66
- background-color: #969696;
67
- color: #FFA995;
68
- font-style: italic;
69
- }
70
- pre.magicwb_amiga .Invalid {
71
- background-color: #797979;
72
- color: #FFFFFF;
73
- }
74
- pre.magicwb_amiga .LibraryClassType {
75
- color: #FFA995;
76
- }
77
- pre.magicwb_amiga .LibraryFunction {
78
- color: #E5B3FF;
79
- }
80
- pre.magicwb_amiga .TagAttribute {
81
- color: #3A68A3;
82
- font-style: italic;
83
- }
84
- pre.magicwb_amiga .Keyword {
85
- font-weight: bold;
86
- }
87
- pre.magicwb_amiga .String {
88
- background-color: #EA1D1D;
89
- color: #FFFFFF;
90
- }
91
- pre.magicwb_amiga {
92
- background-color: #969696;
93
- color: #000000;
94
- }
95
- pre.magicwb_amiga .FunctionName {
96
- color: #FFA995;
97
- }
98
- pre.magicwb_amiga .Variable {
99
- color: #FFA995;
100
- }
101
- pre.magicwb_amiga .Comment {
102
- color: #8D2E75;
103
- font-style: italic;
104
- }
@@ -1,188 +0,0 @@
1
- pre.pastels_on_dark .CssPropertyColours {
2
- color: #666633;
3
- }
4
- pre.pastels_on_dark .CssPropertyValue {
5
- color: #9B2E4D;
6
- }
7
- pre.pastels_on_dark .HtmlDocinfoDtd {
8
- font-style: italic;
9
- }
10
- pre.pastels_on_dark .Exceptions {
11
- font-weight: bold;
12
- color: #C82255;
13
- }
14
- pre.pastels_on_dark .ClassInheritance {
15
- font-style: italic;
16
- }
17
- pre.pastels_on_dark .CssInvalidComma {
18
- background-color: #FF0000;
19
- color: #FFFFFF;
20
- }
21
- pre.pastels_on_dark .HtmlTag {
22
- color: #858EF4;
23
- }
24
- pre.pastels_on_dark .Constants {
25
- color: #6782D3;
26
- }
27
- pre.pastels_on_dark .Section {
28
- font-style: italic;
29
- }
30
- pre.pastels_on_dark .PhpPhpdocs {
31
- color: #777777;
32
- }
33
- pre.pastels_on_dark .Variables {
34
- color: #C1C144;
35
- }
36
- pre.pastels_on_dark .RegularExpressions {
37
- color: #666666;
38
- }
39
- pre.pastels_on_dark .Comments {
40
- color: #555555;
41
- }
42
- pre.pastels_on_dark .line-numbers {
43
- background-color: #73597E;
44
- color: #FFFFFF;
45
- }
46
- pre.pastels_on_dark .PhpVariablesGlobals {
47
- color: #B72E1D;
48
- }
49
- pre.pastels_on_dark .PhpConstantsCorePredefined {
50
- font-weight: bold;
51
- color: #DE8E20;
52
- }
53
- pre.pastels_on_dark .HtmlDoctype {
54
- color: #888888;
55
- }
56
- pre.pastels_on_dark .HtmlDocinfoXml {
57
- color: #68685B;
58
- }
59
- pre.pastels_on_dark .AttributeName {
60
- color: #9B456F;
61
- }
62
- pre.pastels_on_dark .ClassName {
63
- text-decoration: underline;
64
- }
65
- pre.pastels_on_dark .FunctionArgumentName {
66
- font-weight: bold;
67
- }
68
- pre.pastels_on_dark .FunctionResult {
69
- color: #0000FF;
70
- }
71
- pre.pastels_on_dark .TmlangdefKeys {
72
- color: #7171F3;
73
- }
74
- pre.pastels_on_dark .CssSelectorsElements {
75
- font-weight: bold;
76
- color: #B8CD06;
77
- }
78
- pre.pastels_on_dark .CssSelectorsId {
79
- color: #EC9E00;
80
- }
81
- pre.pastels_on_dark .ControlStructures {
82
- font-weight: bold;
83
- color: #6969FA;
84
- }
85
- pre.pastels_on_dark .Interpolation {
86
- color: #C10006;
87
- }
88
- pre.pastels_on_dark .CommentsBlock {
89
- color: #555555;
90
- }
91
- pre.pastels_on_dark .CssSelectorsPseudoclass {
92
- color: #2E759C;
93
- }
94
- pre.pastels_on_dark .Operators {
95
- color: #47B8D6;
96
- }
97
- pre.pastels_on_dark .TagName {
98
- color: #858EF4;
99
- }
100
- pre.pastels_on_dark .EmbeddedCode {
101
- text-decoration: underline;
102
- }
103
- pre.pastels_on_dark .PhpVariablesSaferGlobals {
104
- color: #00FF00;
105
- }
106
- pre.pastels_on_dark .InvalidTrailingWhitespace {
107
- background-color: #FFD0D0;
108
- }
109
- pre.pastels_on_dark .Functions {
110
- color: #A1A1FF;
111
- }
112
- pre.pastels_on_dark .Keywords {
113
- color: #A1A1FF;
114
- }
115
- pre.pastels_on_dark {
116
- background-color: #211E1E;
117
- color: #DADADA;
118
- }
119
- pre.pastels_on_dark .PhpKeywordsStorage {
120
- color: #6969FA;
121
- }
122
- pre.pastels_on_dark .PhpIncludeRequire {
123
- color: #C82255;
124
- }
125
- pre.pastels_on_dark .HtmlAttribute {
126
- color: #9B456F;
127
- }
128
- pre.pastels_on_dark .AttributeWithValue {
129
- color: #9B456F;
130
- }
131
- pre.pastels_on_dark .FunctionArgumentType {
132
- color: #0000FF;
133
- }
134
- pre.pastels_on_dark .PreprocessorDirective {
135
- font-weight: bold;
136
- }
137
- pre.pastels_on_dark .CssUnits {
138
- color: #6969FA;
139
- }
140
- pre.pastels_on_dark .CssFontNames {
141
- color: #666633;
142
- }
143
- pre.pastels_on_dark .CssSelectorsClassname {
144
- color: #EDCA06;
145
- }
146
- pre.pastels_on_dark .PhpStringsSingleQuoted {
147
- color: #BFA36D;
148
- }
149
- pre.pastels_on_dark .PhpConstantsStandardPredefined {
150
- font-weight: bold;
151
- color: #DE8E10;
152
- }
153
- pre.pastels_on_dark .HtmlServersideIncludes {
154
- color: #909090;
155
- }
156
- pre.pastels_on_dark .CssPropertyKeyword {
157
- color: #E1C96B;
158
- }
159
- pre.pastels_on_dark .LanguageConstants {
160
- font-weight: bold;
161
- color: #DE8E30;
162
- }
163
- pre.pastels_on_dark .CharacterConstants {
164
- color: #AFA472;
165
- }
166
- pre.pastels_on_dark .Invalid {
167
- font-weight: bold;
168
- background-color: #FF0000;
169
- color: #FFF9F9;
170
- }
171
- pre.pastels_on_dark .FunctionArgumentVariable {
172
- font-style: italic;
173
- }
174
- pre.pastels_on_dark .Strings {
175
- color: #AD9361;
176
- }
177
- pre.pastels_on_dark .PhpStringsDoubleQuoted {
178
- color: #AD9361;
179
- }
180
- pre.pastels_on_dark .FunctionName {
181
- font-weight: bold;
182
- }
183
- pre.pastels_on_dark .PreprocessorLine {
184
- color: #2F006E;
185
- }
186
- pre.pastels_on_dark .Numbers {
187
- color: #CCCCCC;
188
- }