asciidoctor-dita-map 0.9.2 → 0.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/dita-map/cli.rb +13 -4
- data/lib/dita-map/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7868b5b984e99b8e02f45f267b4d493943d4232c1dc69e52169e39076f42bc01
|
|
4
|
+
data.tar.gz: 664073302552d392ba455a64fa4f28affd2b3fa890dfb333620b077094291835
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c707f1e3aedc8aaec0b8be683eb9b01df94c1ce7812a994d5d6d09e727de1bd4e3c2e66a4cd84fbb06cfcb0e7fdbc0528e3b6d992c4787d1e6537450aa2f2130
|
|
7
|
+
data.tar.gz: f7cfb07b8374bd7f5d20fcde17b2b9221a019bb236592860a09a73b87b9483f47eb65ee2e113a979a0268756f6d384fe4d463aa7a4048dd843261b8f5aebb8e9
|
data/lib/dita-map/cli.rb
CHANGED
|
@@ -41,7 +41,8 @@ module AsciidoctorDitaMap
|
|
|
41
41
|
:toc => true,
|
|
42
42
|
:type => true,
|
|
43
43
|
:self => false,
|
|
44
|
-
:verbose => false
|
|
44
|
+
:verbose => false,
|
|
45
|
+
:zero_offset => false
|
|
45
46
|
}
|
|
46
47
|
@prep = []
|
|
47
48
|
@name = name
|
|
@@ -102,6 +103,10 @@ module AsciidoctorDitaMap
|
|
|
102
103
|
|
|
103
104
|
opt.separator ''
|
|
104
105
|
|
|
106
|
+
opt.on('-z', '--zero-offset', 'allow include directives with zero leveloffset') do
|
|
107
|
+
@opts[:zero_offset] = true
|
|
108
|
+
end
|
|
109
|
+
|
|
105
110
|
opt.on('-v', '--verbose', 'report additional problems in the supplied files') do
|
|
106
111
|
@opts[:verbose] = true
|
|
107
112
|
end
|
|
@@ -249,14 +254,18 @@ module AsciidoctorDitaMap
|
|
|
249
254
|
end
|
|
250
255
|
|
|
251
256
|
if offset == 0
|
|
252
|
-
|
|
253
|
-
|
|
257
|
+
if @opts[:zero_offset]
|
|
258
|
+
offset = 0
|
|
259
|
+
else
|
|
260
|
+
warn "#{@name}: warning: invalid leveloffset - expected 1, got 0: #{target}"
|
|
261
|
+
offset = 1
|
|
262
|
+
end
|
|
254
263
|
elsif offset > last_offset and offset - last_offset > 1
|
|
255
264
|
expected_offset = last_offset + 1
|
|
256
265
|
warn "#{@name}: warning: invalid leveloffset - expected #{expected_offset}, got #{offset}: #{target}"
|
|
257
266
|
end
|
|
258
267
|
|
|
259
|
-
while stack.last[:offset] >= offset
|
|
268
|
+
while stack.length > 1 and stack.last[:offset] >= offset
|
|
260
269
|
stack.pop
|
|
261
270
|
end
|
|
262
271
|
|
data/lib/dita-map/version.rb
CHANGED