asciibook 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ac1b2f6cc55318830a04ebb0c2051e075ead0a2cd24a66ae9b77a97f04e8727e
4
- data.tar.gz: af327832e1592d2b99f455e41f4d3c32370988d20adc3b6c05b54146e3416343
3
+ metadata.gz: fb4347a438a375868d0a2173c66ea9519341d167eb4a2ea963cb54d614c3cac4
4
+ data.tar.gz: c1f4dadda074a10b9a4431dbbf2ef975083b8c1c25beb316e547c918671b910b
5
5
  SHA512:
6
- metadata.gz: c7a0ea1bd7f7e059f26f339083d11bea1795defd89e8ab06401deb3e0708abdc78a51b87712d45d1e23848d98b7a68311bcbef0fb6f3abfeca85f345182551a2
7
- data.tar.gz: 811f7da4d3876bd5a76ceb5f63ccb61bbc31e13baaeaf6bcfde1177ef435487ea897c9c879451cd027821a9c90f60fe633d3c5b774f844b9fdc9fdc2d1d84e78
6
+ metadata.gz: d0bf598a7570cacd63f6939c55a115f28651b375d87711a08486a6419af87947521ab12ada2b6984efacc3716d3226411f62109b552f877ddd4090c9e1095cad
7
+ data.tar.gz: 0db9909fc5f9cb62775d5d3452522090e79567352cbdd433b9d1162e97bec5a9e0989245f637551c26b5b6cab47d87c8e5f894127ea2969b4f1fbddec0fb5094
@@ -1,5 +1,13 @@
1
1
  source: book.adoc
2
- #formats: ['html', 'pdf', 'epub', 'mobi']
3
- #theme_dir:
4
- #template_dir:
5
- #page_level: 1
2
+ # formats:
3
+ # - html
4
+ # - pdf
5
+ # - epub
6
+ # - mobi
7
+ #
8
+ # theme_dir:
9
+ # template_dir:
10
+ # page_level: 1
11
+ #
12
+ # plugins:
13
+ # - asciidoctor-diagram
@@ -123,6 +123,7 @@ module Asciibook
123
123
  command << 'toc' << '--xsl-style-sheet' << 'toc.xsl'
124
124
  else
125
125
  command << page.path
126
+ command << '--allow' << File.expand_path(@tmp_dir)
126
127
  end
127
128
  end
128
129
  filename = "#{@book.basename}.pdf"
@@ -38,10 +38,18 @@ module Asciibook
38
38
  File.open(File.join(dir, 'asciibook.yml'), 'w') do |file|
39
39
  file.write <<~EOF
40
40
  source: #{filename}
41
- #formats: ['html', 'pdf', 'epub', 'mobi']
42
- #theme_dir:
43
- #template_dir:
44
- #page_level: 1
41
+ # formats:
42
+ # - html
43
+ # - pdf
44
+ # - epub
45
+ # - mobi
46
+ #
47
+ # theme_dir:
48
+ # template_dir:
49
+ # page_level: 1
50
+ #
51
+ # plugins:
52
+ # - asciidoctor-diagram
45
53
  EOF
46
54
  end
47
55
  else
@@ -58,6 +66,7 @@ module Asciibook
58
66
  c.option :template_dir, '--template-dir DIR', 'Template dir.'
59
67
  c.option :dest_dir, '--dest-dir DIR', 'Destination dir.'
60
68
  c.option :page_level, '--page-level NUM', Integer, 'Page split base on section level, default is 1.'
69
+ c.option :plugins, '-r', '--require PLUGIN1[,PLUGIN2[,PLUGIN3...]]', Array, 'Require plugins'
61
70
  c.action do |args, options|
62
71
  source = args[0] || '.'
63
72
  if File.directory?(source)
@@ -66,8 +75,10 @@ module Asciibook
66
75
  hash
67
76
  end
68
77
  options = config_options.merge(options)
78
+ load_plugins(options[:plugins])
69
79
  Asciibook::Book.load_file(options.delete(:source), options).build
70
80
  elsif File.file?(source)
81
+ load_plugins(options[:plugins])
71
82
  Asciibook::Book.load_file(source, options).build
72
83
  else
73
84
  abort "Build target '#{source}' neither a folder nor a file"
@@ -81,5 +92,13 @@ module Asciibook
81
92
 
82
93
  p.go(argv)
83
94
  end
95
+
96
+ def self.load_plugins(plugins)
97
+ if plugins
98
+ plugins.each do |plugin|
99
+ require plugin
100
+ end
101
+ end
102
+ end
84
103
  end
85
104
  end
@@ -1,3 +1,3 @@
1
1
  module Asciibook
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -1 +1 @@
1
- <a class="callout" id="callout-{{ node.id }}" href="#colist-{{ node.id }}">{{ node.text }}</a>
1
+ <a class="callout" id="callout-{{ node.id }}" href="#colist-{{ node.id }}">{{ node.text }}</a>
@@ -54,11 +54,16 @@ pre {
54
54
  white-space: pre-wrap;
55
55
  }
56
56
 
57
- *:not(pre) code {
57
+ code {
58
58
  background: #f8f8f8;
59
59
  padding: 0 4px;
60
60
  }
61
61
 
62
+ pre code {
63
+ background: transparent;
64
+ padding: 0;
65
+ }
66
+
62
67
  .toc ol {
63
68
  list-style: none;
64
69
  padding: 0;
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciibook
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rei
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-19 00:00:00.000000000 Z
11
+ date: 2021-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor
@@ -30,28 +30,28 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.3.0
33
+ version: '0.3'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.3.0
40
+ version: '0.3'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: liquid
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '4.0'
47
+ version: '5.0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '4.0'
54
+ version: '5.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: gepub
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -70,38 +70,52 @@ dependencies:
70
70
  name: mercenary
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: '0.4'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: '0.4'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rouge
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '0'
89
+ version: '3.0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '0'
96
+ version: '3.0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: nokogiri
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '1.0'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '1.0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rake
99
113
  requirement: !ruby/object:Gem::Requirement
100
114
  requirements:
101
115
  - - ">="
102
116
  - !ruby/object:Gem::Version
103
117
  version: '0'
104
- type: :runtime
118
+ type: :development
105
119
  prerelease: false
106
120
  version_requirements: !ruby/object:Gem::Requirement
107
121
  requirements:
@@ -205,7 +219,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
205
219
  - !ruby/object:Gem::Version
206
220
  version: '0'
207
221
  requirements: []
208
- rubygems_version: 3.0.3
222
+ rubygems_version: 3.1.6
209
223
  signing_key:
210
224
  specification_version: 4
211
225
  summary: ''