svg_conform 0.2.7 → 0.2.9
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/Gemfile.lock +106 -18
- data/README.adoc +7 -0
- data/config/profiles/{metanorma.yml → metanorma-sample.yml} +6 -6
- data/docs/api_reference.adoc +21 -21
- data/docs/cli_guide.adoc +41 -41
- data/docs/profiles.adoc +8 -2
- data/docs/reference_manifest.adoc +3 -3
- data/lib/svg_conform/cli.rb +4 -4
- data/lib/svg_conform/errors/validation_issue.rb +6 -1
- data/lib/svg_conform/version.rb +1 -1
- data/spec/svg_conform/errors/validation_issue_spec.rb +53 -0
- data/spec/svg_conform/gemspec_spec.rb +21 -7
- data/spec/svg_conform/profiles/metanorma_profile_spec.rb +64 -8
- data/spec/svg_conform/profiles_plantuml_spec.rb +1 -1
- data/spec/svg_conform/references/integration_spec.rb +1 -1
- data/spec/svg_conform/requirements/id_reference_state_spec.rb +5 -5
- data/spec/svg_conform/requirements/text_as_path_requirement_spec.rb +5 -5
- data/spec/svg_conform/validator_input_types_spec.rb +11 -11
- data/spec/svg_conform_spec.rb +3 -3
- data/svg_conform.gemspec +6 -0
- metadata +17 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f1bb2e0bc6387159b268055587a32744edbf3e95d778fc56e5b96930525333f9
|
|
4
|
+
data.tar.gz: 0fd0c9e6ed4a141b7589033abf09664aa561514a6249a27edbdab8dfdbbf8c6d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 402a882d57a09d6940235905f13defc5ef30ddb2c8b749fac2eb1bf7ee150eae4557204ffeca46f4d7583857d17946e5c09ebd1a658e8e7b814f7763a6e75390
|
|
7
|
+
data.tar.gz: e5da72b068630f3b38e8ca1d656fe923da5991c8a75f0da07b85338ece772b60f4e8617ca36f2dd0269b6c9bb5a429756547c40be572c9c67842b23e8f3fda22
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
svg_conform (0.2.
|
|
4
|
+
svg_conform (0.2.8)
|
|
5
|
+
lens_core (~> 0.1)
|
|
5
6
|
lutaml-model (~> 0.8.155)
|
|
6
7
|
moxml (~> 0.6.0)
|
|
7
8
|
nokogiri (~> 1.16)
|
|
@@ -39,21 +40,21 @@ GEM
|
|
|
39
40
|
json (3.1.0)
|
|
40
41
|
language_server-protocol (3.17.0.6)
|
|
41
42
|
lens_core (0.1.0)
|
|
42
|
-
leptris (1.9.
|
|
43
|
+
leptris (1.9.417.0-aarch64-linux)
|
|
43
44
|
ffi (~> 1.15)
|
|
44
|
-
leptris (1.9.
|
|
45
|
+
leptris (1.9.417.0-aarch64-linux-musl)
|
|
45
46
|
ffi (~> 1.15)
|
|
46
|
-
leptris (1.9.
|
|
47
|
+
leptris (1.9.417.0-arm-linux)
|
|
47
48
|
ffi (~> 1.15)
|
|
48
|
-
leptris (1.9.
|
|
49
|
+
leptris (1.9.417.0-arm-linux-musl)
|
|
49
50
|
ffi (~> 1.15)
|
|
50
|
-
leptris (1.9.
|
|
51
|
+
leptris (1.9.417.0-arm64-darwin)
|
|
51
52
|
ffi (~> 1.15)
|
|
52
|
-
leptris (1.9.
|
|
53
|
+
leptris (1.9.417.0-x86_64-darwin)
|
|
53
54
|
ffi (~> 1.15)
|
|
54
|
-
leptris (1.9.
|
|
55
|
+
leptris (1.9.417.0-x86_64-linux)
|
|
55
56
|
ffi (~> 1.15)
|
|
56
|
-
leptris (1.9.
|
|
57
|
+
leptris (1.9.417.0-x86_64-linux-musl)
|
|
57
58
|
ffi (~> 1.15)
|
|
58
59
|
lint_roller (1.1.0)
|
|
59
60
|
liquid (5.14.0)
|
|
@@ -160,21 +161,21 @@ GEM
|
|
|
160
161
|
unicode-name (1.15.1)
|
|
161
162
|
unicode-types (~> 1.12)
|
|
162
163
|
unicode-types (1.12.0)
|
|
163
|
-
yeptris (0.6.
|
|
164
|
+
yeptris (0.6.62.2-aarch64-linux)
|
|
164
165
|
ffi (~> 1.15)
|
|
165
|
-
yeptris (0.6.
|
|
166
|
+
yeptris (0.6.62.2-aarch64-linux-musl)
|
|
166
167
|
ffi (~> 1.15)
|
|
167
|
-
yeptris (0.6.
|
|
168
|
+
yeptris (0.6.62.2-arm-linux-eabihf)
|
|
168
169
|
ffi (~> 1.15)
|
|
169
|
-
yeptris (0.6.
|
|
170
|
+
yeptris (0.6.62.2-arm-linux-musleabihf)
|
|
170
171
|
ffi (~> 1.15)
|
|
171
|
-
yeptris (0.6.
|
|
172
|
+
yeptris (0.6.62.2-arm64-darwin)
|
|
172
173
|
ffi (~> 1.15)
|
|
173
|
-
yeptris (0.6.
|
|
174
|
+
yeptris (0.6.62.2-x86_64-darwin)
|
|
174
175
|
ffi (~> 1.15)
|
|
175
|
-
yeptris (0.6.
|
|
176
|
+
yeptris (0.6.62.2-x86_64-linux)
|
|
176
177
|
ffi (~> 1.15)
|
|
177
|
-
yeptris (0.6.
|
|
178
|
+
yeptris (0.6.62.2-x86_64-linux-musl)
|
|
178
179
|
ffi (~> 1.15)
|
|
179
180
|
|
|
180
181
|
PLATFORMS
|
|
@@ -207,5 +208,92 @@ DEPENDENCIES
|
|
|
207
208
|
rubocop-rspec
|
|
208
209
|
svg_conform!
|
|
209
210
|
|
|
211
|
+
CHECKSUMS
|
|
212
|
+
ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383
|
|
213
|
+
base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b
|
|
214
|
+
bigdecimal (4.1.3) sha256=61ebe1e5e559bdc3cc6f2c0ee7f427321fc838f59611c294356eb04d6e21cf66
|
|
215
|
+
bundler (4.0.24) sha256=16ca64e20816a0cf151a948fb141d788602996d2b4d73577b74388fe84fa98bc
|
|
216
|
+
canon (0.1.23) sha256=502646c0d50cd9e17c8867d24e5808b4adb85230482ad02157f4d4f161f74cc0
|
|
217
|
+
concurrent-ruby (1.3.8) sha256=b2f1be836e968ccc78ccfce277ea79c72a88633f22306782c16ff23fb415d1e1
|
|
218
|
+
csv (3.3.7) sha256=15a3f16f6628da8664d455eb634e7f22031bcf53044923caf56975109e71b9f8
|
|
219
|
+
diff-lcs (1.6.2) sha256=9ae0d2cba7d4df3075fe8cd8602a8604993efc0dfa934cff568969efb1909962
|
|
220
|
+
ffi (1.17.4-aarch64-linux-gnu) sha256=b208f06f91ffd8f5e1193da3cae3d2ccfc27fc36fba577baf698d26d91c080df
|
|
221
|
+
ffi (1.17.4-aarch64-linux-musl) sha256=9286b7a615f2676245283aef0a0a3b475ae3aae2bb5448baace630bb77b91f39
|
|
222
|
+
ffi (1.17.4-arm-linux-gnu) sha256=d6dbddf7cb77bf955411af5f187a65b8cd378cb003c15c05697f5feee1cb1564
|
|
223
|
+
ffi (1.17.4-arm-linux-musl) sha256=9d4838ded0465bef6e2426935f6bcc93134b6616785a84ffd2a3d82bc3cf6f95
|
|
224
|
+
ffi (1.17.4-arm64-darwin) sha256=19071aaf1419251b0a46852abf960e77330a3b334d13a4ab51d58b31a937001b
|
|
225
|
+
ffi (1.17.4-x86_64-darwin) sha256=aa70390523cf3235096cf64962b709b4cfbd5c082a2cb2ae714eb0fe2ccda496
|
|
226
|
+
ffi (1.17.4-x86_64-linux-gnu) sha256=9d3db14c2eae074b382fa9c083fe95aec6e0a1451da249eab096c34002bc752d
|
|
227
|
+
ffi (1.17.4-x86_64-linux-musl) sha256=3fdf9888483de005f8ef8d1cf2d3b20d86626af206cbf780f6a6a12439a9c49e
|
|
228
|
+
json (3.1.0) sha256=3ce7ccf8fde58960177a3a756c31f292a4c1e1dedee884547096a5b0604e3bd8
|
|
229
|
+
language_server-protocol (3.17.0.6) sha256=5ef2c0c138f8267e1bc631d3328347d354f96724b0af22f2c79516120443b7f0
|
|
230
|
+
lens_core (0.1.0) sha256=9481ce7721be1b9ddb08e0edde349775849614d40a78ff05ec5887de2aa9e2b6
|
|
231
|
+
leptris (1.9.417.0-aarch64-linux) sha256=dba75a31e71573b14f0c9247db99cbc7888c315738c435989aac1352c4a94e56
|
|
232
|
+
leptris (1.9.417.0-aarch64-linux-musl) sha256=011a67588f22d397a98d5a52fb32d40cdfd1456caaae68a5b646a11d851c8e44
|
|
233
|
+
leptris (1.9.417.0-arm-linux) sha256=6eff14e2d464cc95d7671833b485eaf5ceef45663ef3d7b0024d2c3dca414ca4
|
|
234
|
+
leptris (1.9.417.0-arm-linux-musl) sha256=b862cd5cf644f107a536f9c4a72e4346bcf221522c4a54747232155c4aa19862
|
|
235
|
+
leptris (1.9.417.0-arm64-darwin) sha256=cb40ee5c4f1b6c507a626e5a1fe35cf81265c470ff48ce7e6cb51336bc3572bc
|
|
236
|
+
leptris (1.9.417.0-x86_64-darwin) sha256=f48f3b8ea5e395633cf0925106e1196831a9b8666217d8b1289d7b9b865ddcd1
|
|
237
|
+
leptris (1.9.417.0-x86_64-linux) sha256=ea69ee2a4e4b6f22d85d890adf6b03a2e791f7cc7a9f267140c5d12b0c2bfe34
|
|
238
|
+
leptris (1.9.417.0-x86_64-linux-musl) sha256=ec4ba05b66afb308a770f842312cd3346b9117be0b0c0812d6be13851a1368a9
|
|
239
|
+
lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87
|
|
240
|
+
liquid (5.14.0) sha256=e1020c2b2ee58c7a4d3bfdc7a331537bd27a783353748bff0bf27c6ac0c17065
|
|
241
|
+
lutaml-model (0.8.174) sha256=d8e92d630a5972fe98bf5fe3f778db47afa328fb36a712c71531e6f82b49d110
|
|
242
|
+
memo_wise (1.13.0) sha256=30220c38c4cef410849bc73553c58664dc2c91c6379e4a1df22aea02358b716b
|
|
243
|
+
moxml (0.6.4) sha256=2038a222a367132b5fdcc40d669d67e6bb913145e4b5e5bd3b7b62fd73a25912
|
|
244
|
+
nokogiri (1.19.7-aarch64-linux-gnu) sha256=8f5e15d299602456406e1f03a9f3456cceb33a0722811e818d2ee2214eb4c84a
|
|
245
|
+
nokogiri (1.19.7-aarch64-linux-musl) sha256=efe0c3602e6e54521bc21c681930ce5568e2d11203de17400710b2b3ca2e4cb4
|
|
246
|
+
nokogiri (1.19.7-arm-linux-gnu) sha256=7fd1907125691aa89e838cc91161761c758b4e17bb32f0dd9b5515a82cc759af
|
|
247
|
+
nokogiri (1.19.7-arm-linux-musl) sha256=28d0ff0c87b6bb2e56580323a6fb049d5d4a02b94f0958fdd47e9ac146991c77
|
|
248
|
+
nokogiri (1.19.7-arm64-darwin) sha256=f27d7f25f4873fbc3aa35a2cc2fb680c98555fec1925348da439d0869d541142
|
|
249
|
+
nokogiri (1.19.7-x86_64-darwin) sha256=508e81e8c5f84aaa240dce981bf1c43faae60808726f0ce7024ee92effc5cafe
|
|
250
|
+
nokogiri (1.19.7-x86_64-linux-gnu) sha256=25865ccb462f714e712fdf8906fde07849cb6704a808e3d629d75baa5af5dd3b
|
|
251
|
+
nokogiri (1.19.7-x86_64-linux-musl) sha256=464d1f3dfb0d53cf54c0c6a7e23e8e91cf68ec3cafc2b27dc4a7682f2d9bf546
|
|
252
|
+
openssl (3.3.3) sha256=d46902138f2987c13122fab826030a11c2bb9b8a16394215cbfc5062c5e2d335
|
|
253
|
+
ostruct (0.6.3) sha256=95a2ed4a4bd1d190784e666b47b2d3f078e4a9efda2fccf18f84ddc6538ed912
|
|
254
|
+
paint (2.3.0) sha256=327d623e4038619d5bd99ae5db07973859cd78400c7f0329eea283cef8e83be5
|
|
255
|
+
parallel (2.3.0) sha256=f75a3e904101ce6a1ccb6b8dc800cbafd42166d83330192438dcf29395167a6f
|
|
256
|
+
parser (3.3.13.0) sha256=e02f9b63c2fe05b0c68f692ba4df89b3cb113b663964f75d988fbebfd6c3deca
|
|
257
|
+
prism (2.1.0-aarch64-linux-gnu) sha256=808dddc72def68e1a0463689414c97e0ba211938eddbab05387a4844aa2b3ec2
|
|
258
|
+
prism (2.1.0-aarch64-linux-musl) sha256=dd1a0732620c1e575dabb07a297a62911fabd72f8e20ce850b522a866f877930
|
|
259
|
+
prism (2.1.0-arm-linux-gnu) sha256=96b2426b9dbab05448c4add735619929042be3cd7e871ff186468121b62bcfa8
|
|
260
|
+
prism (2.1.0-arm-linux-musl) sha256=00ef918e42a3dc98f11a461bf473586a3424b0f78bee8a4e43b5a65a5f5e2cd0
|
|
261
|
+
prism (2.1.0-arm64-darwin) sha256=2d0c2e3e011cfd89c041940907d3ff3def379d7b0f2ba158d1d42238e8ad8afc
|
|
262
|
+
prism (2.1.0-x86_64-darwin) sha256=6c645d8e6afc742956c7518220ce5106367727c4d9980ac9ab386d55004ddab4
|
|
263
|
+
prism (2.1.0-x86_64-linux-gnu) sha256=b2b647afce09551e650b8bb3e2fc91d7d73d392a09534ca307ec0d619c33bfd4
|
|
264
|
+
prism (2.1.0-x86_64-linux-musl) sha256=249f45981726923e259b927902246219fa25ad10a76f43849c9aee1a3d3ec5b8
|
|
265
|
+
racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f
|
|
266
|
+
rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a
|
|
267
|
+
rake (13.4.2) sha256=cb825b2bd5f1f8e91ca37bddb4b9aaf345551b4731da62949be002fa89283701
|
|
268
|
+
regexp_parser (2.13.1) sha256=5aedb6b7c35688f51e86eef17a15374dfd287c83f4ca644b2c5f3ec50a33b44b
|
|
269
|
+
rspec (3.13.2) sha256=206284a08ad798e61f86d7ca3e376718d52c0bc944626b2349266f239f820587
|
|
270
|
+
rspec-core (3.13.7) sha256=c64ff16d9788119805cbc6a3f4b6d87cc22417c2d25976a3330de136896b5469
|
|
271
|
+
rspec-expectations (3.13.6) sha256=bf538ca6d367ff5b0d85a87fdb5c0c6038f2cd1308a0eeba07476caa02d22f35
|
|
272
|
+
rspec-mocks (3.13.9) sha256=ea5c7ff3054a6098ca6039aacef80aec69d5a8a3ef80be8fc88337359b672a30
|
|
273
|
+
rspec-support (3.13.8) sha256=e4160030309b7e3e9d9863dfe720a35dfcc577162f5402cd68fc8c5258a0ffd6
|
|
274
|
+
rubocop (1.92.2) sha256=14fb31eed143a0dc6f78186c550c1715e81cd38f59d05d1165050e445c1f5382
|
|
275
|
+
rubocop-ast (1.51.0) sha256=0ec311e36b191b3872d909078a35274e962ae97dbce64be6812d145ca59acfcb
|
|
276
|
+
rubocop-performance (1.27.0) sha256=eeeb1374d062a368ee1c787b70eb0b0cc4b184cb1f8565f424760946146d61ce
|
|
277
|
+
rubocop-rake (0.7.1) sha256=3797f2b6810c3e9df7376c26d5f44f3475eda59eb1adc38e6f62ecf027cbae4d
|
|
278
|
+
rubocop-rspec (3.10.2) sha256=0b3e2ecc592cd10ecbf0095bb58d1e357905276e069643523cc19eb7495f65e2
|
|
279
|
+
ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
|
|
280
|
+
rubyzip (3.7.0) sha256=65c19294da75297a939006f3516deacc33185fbd721ff1954f7a231db6d3e121
|
|
281
|
+
strscan (3.1.8) sha256=aae2db611a225559f21ffbb71765c9a4e60fd262534a9ea84f4f11c7f32f679e
|
|
282
|
+
svg_conform (0.2.8)
|
|
283
|
+
table_tennis (1.0.0) sha256=955f76ca4debd42ee88682af8d4554a74d533c89de4f1581bc37855b15faa956
|
|
284
|
+
thor (1.5.0) sha256=e3a9e55fe857e44859ce104a84675ab6e8cd59c650a49106a05f55f136425e73
|
|
285
|
+
unicode-display_width (3.3.0) sha256=4b7aa66a4b11db50f6f7e98411215cd0dd10eaecb665d36eec5bcacb3fa0b613
|
|
286
|
+
unicode-emoji (4.3.0) sha256=11c02fa73290378c066bb0562cd4c87d8e1b706fbbe0059ca12746a4244de8ce
|
|
287
|
+
unicode-name (1.15.1) sha256=b8f2e3ca14bc24799f84a4f74d43a3612d02a051700d88bc6ca8e3bd53cda3f6
|
|
288
|
+
unicode-types (1.12.0) sha256=7e26a4352cecc2a50325a3793df834b732581ca9f25c5e29f46f3378934363f6
|
|
289
|
+
yeptris (0.6.62.2-aarch64-linux) sha256=9dd3bc757f24dad7ca0c939787be1014aa60a06e6457b0eab5688b8b2710631e
|
|
290
|
+
yeptris (0.6.62.2-aarch64-linux-musl) sha256=0571ebfe60beefaa43bfbb7761e3116d62f14bc3cfbfe526b64bb06c536cb327
|
|
291
|
+
yeptris (0.6.62.2-arm-linux-eabihf) sha256=0390680ed96caa7d86de4adeb8af6f9b519c3bc7f64e32b6ae9bcef1c1a6a36e
|
|
292
|
+
yeptris (0.6.62.2-arm-linux-musleabihf) sha256=54f2fe3926320d5f2fdf25d582408f23557cb0b4e5cc537dc70aa1ba6ebfd745
|
|
293
|
+
yeptris (0.6.62.2-arm64-darwin) sha256=aaf5669775735ac1e26c55d6087348976534fbccd8b04b4abf7f73016173dc05
|
|
294
|
+
yeptris (0.6.62.2-x86_64-darwin) sha256=24fd9cdfb1eed94349f8db421a8563b5f2979d3a48b609959977ec4c8099a0d3
|
|
295
|
+
yeptris (0.6.62.2-x86_64-linux) sha256=84ff1b20ce25ae0dd2ec65ea1abc14d881310ab0efef65ddc89e1384cd50a745
|
|
296
|
+
yeptris (0.6.62.2-x86_64-linux-musl) sha256=dd093c8ae7699fd3040fb006be34833412a207edf58b4885ec4f1de8eb4b271b
|
|
297
|
+
|
|
210
298
|
BUNDLED WITH
|
|
211
|
-
|
|
299
|
+
4.0.24
|
data/README.adoc
CHANGED
|
@@ -35,6 +35,13 @@ SvgConform is distributed as a Ruby gem.
|
|
|
35
35
|
* **Generic namespace handling**: Configuration-driven foreign namespace validation
|
|
36
36
|
* **Text-as-path detection**: Warns when text is rendered as outlined path glyphs (quality check)
|
|
37
37
|
|
|
38
|
+
Profiles are consumer policy: the bundled profiles under `config/profiles/`
|
|
39
|
+
(including `metanorma-sample.yml`, a testing reference for the Metanorma
|
|
40
|
+
requirements) are samples, and the operative profile for a consumer lives
|
|
41
|
+
with that consumer — metanorma-standoc ships and loads its own instance by
|
|
42
|
+
path. Canonical diagnostics rendering rides the link:https://github.com/claricle/lens_core[lens_core]
|
|
43
|
+
gem, a declared runtime dependency.
|
|
44
|
+
|
|
38
45
|
|
|
39
46
|
== Concepts
|
|
40
47
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
name: "metanorma"
|
|
1
|
+
name: "metanorma-sample"
|
|
2
2
|
description: "Metanorma SVG Profile - SVG requirements for Metanorma technical documents with embedded resources"
|
|
3
3
|
|
|
4
4
|
requirements:
|
|
@@ -34,7 +34,7 @@ requirements:
|
|
|
34
34
|
attributes: ["id", "role", "shape-rendering", "text-rendering", "buffered-rendering", "visibility", "base", "lang", "class", "rel", "rev", "typeof", "content", "datatype", "resource", "about", "property", "space", "fill-rule"]
|
|
35
35
|
allowed_children: ["text"]
|
|
36
36
|
- tag: "path"
|
|
37
|
-
attributes: ["d", "pathLength", "stroke-miterlimit", "id", "role", "fill", "style", "transform", "font-size", "fill-rule", "base", "lang", "class", "rel", "rev", "typeof", "content", "datatype", "resource", "about", "property", "space", "clip-path", "mask"]
|
|
37
|
+
attributes: ["d", "pathLength", "stroke-miterlimit", "id", "role", "fill", "style", "transform", "font-size", "fill-rule", "base", "lang", "class", "rel", "rev", "typeof", "content", "datatype", "resource", "about", "property", "space", "marker-start", "marker-mid", "marker-end", "clip-path", "mask"]
|
|
38
38
|
allowed_children: ["title", "desc"]
|
|
39
39
|
- tag: "rect"
|
|
40
40
|
attributes: ["x", "y", "width", "height", "rx", "ry", "stroke-miterlimit", "id", "role", "fill", "style", "transform", "fill-rule", "base", "lang", "class", "rel", "rev", "typeof", "content", "datatype", "resource", "about", "property", "space", "clip-path", "mask"]
|
|
@@ -43,16 +43,16 @@ requirements:
|
|
|
43
43
|
attributes: ["cx", "cy", "r", "id", "role", "fill", "style", "transform", "fill-rule", "base", "lang", "class", "rel", "rev", "typeof", "content", "datatype", "resource", "about", "property", "space", "clip-path", "mask"]
|
|
44
44
|
allowed_children: ["title", "desc"]
|
|
45
45
|
- tag: "line"
|
|
46
|
-
attributes: ["x1", "y1", "x2", "y2", "id", "role", "fill", "transform", "fill-rule", "base", "lang", "class", "rel", "rev", "typeof", "content", "datatype", "resource", "about", "property", "space", "clip-path", "mask"]
|
|
46
|
+
attributes: ["x1", "y1", "x2", "y2", "id", "role", "fill", "transform", "fill-rule", "base", "lang", "class", "rel", "rev", "typeof", "content", "datatype", "resource", "about", "property", "space", "marker-start", "marker-mid", "marker-end", "clip-path", "mask"]
|
|
47
47
|
allowed_children: ["title", "desc"]
|
|
48
48
|
- tag: "ellipse"
|
|
49
49
|
attributes: ["cx", "cy", "rx", "ry", "id", "role", "fill", "style", "transform", "fill-rule", "base", "lang", "class", "rel", "rev", "typeof", "content", "datatype", "resource", "about", "property", "space", "clip-path", "mask"]
|
|
50
50
|
allowed_children: ["title", "desc"]
|
|
51
51
|
- tag: "polyline"
|
|
52
|
-
attributes: ["points", "id", "role", "fill", "transform", "fill-rule", "base", "lang", "class", "rel", "rev", "typeof", "content", "datatype", "resource", "about", "property", "space", "clip-path", "mask"]
|
|
52
|
+
attributes: ["points", "id", "role", "fill", "transform", "fill-rule", "base", "lang", "class", "rel", "rev", "typeof", "content", "datatype", "resource", "about", "property", "space", "marker-start", "marker-mid", "marker-end", "clip-path", "mask"]
|
|
53
53
|
allowed_children: ["title", "desc"]
|
|
54
54
|
- tag: "polygon"
|
|
55
|
-
attributes: ["points", "id", "role", "fill", "style", "transform", "fill-rule", "base", "lang", "class", "rel", "rev", "typeof", "content", "datatype", "resource", "about", "property", "space", "clip-path", "mask"]
|
|
55
|
+
attributes: ["points", "id", "role", "fill", "style", "transform", "fill-rule", "base", "lang", "class", "rel", "rev", "typeof", "content", "datatype", "resource", "about", "property", "space", "marker-start", "marker-mid", "marker-end", "clip-path", "mask"]
|
|
56
56
|
allowed_children: ["title", "desc"]
|
|
57
57
|
- tag: "solidColor"
|
|
58
58
|
attributes: ["id", "role", "fill", "fill-rule", "base", "lang", "class", "rel", "rev", "typeof", "content", "datatype", "resource", "about", "property", "space", "clip-path", "mask"]
|
|
@@ -64,7 +64,7 @@ requirements:
|
|
|
64
64
|
attributes: ["x", "y", "rotate", "id", "role", "fill", "style", "transform", "font-size", "fill-rule", "base", "lang", "class", "rel", "rev", "typeof", "content", "datatype", "resource", "about", "property", "space", "font-stretch", "writing-mode", "text-decoration", "clip-path", "mask", "textLength", "lengthAdjust"]
|
|
65
65
|
allowed_children: ["desc", "title", "tspan", "text", "a"]
|
|
66
66
|
- tag: "g"
|
|
67
|
-
attributes: ["label", "class", "id", "role", "fill", "style", "transform", "fill-rule", "visibility", "base", "lang", "rel", "rev", "typeof", "content", "datatype", "resource", "about", "property", "space", "data-name", "clip-path", "mask"]
|
|
67
|
+
attributes: ["label", "class", "id", "role", "fill", "style", "transform", "fill-rule", "visibility", "base", "lang", "rel", "rev", "typeof", "content", "datatype", "resource", "about", "property", "space", "data-name", "clip-path", "clip-rule", "mask", "opacity"]
|
|
68
68
|
allowed_children: ["title", "path", "rect", "circle", "line", "ellipse", "polyline", "polygon", "solidColor", "textArea", "text", "g", "defs", "use", "a", "tspan", "desc", "image"]
|
|
69
69
|
- tag: "defs"
|
|
70
70
|
attributes: ["id", "role", "fill", "fill-rule", "base", "lang", "class", "rel", "rev", "typeof", "content", "datatype", "resource", "about", "property", "space", "clip-path", "mask"]
|
data/docs/api_reference.adoc
CHANGED
|
@@ -25,7 +25,7 @@ require 'svg_conform'
|
|
|
25
25
|
|
|
26
26
|
# Validate an SVG file
|
|
27
27
|
validator = SvgConform::Validator.new
|
|
28
|
-
result = validator.validate_file('image.svg', profile: :metanorma)
|
|
28
|
+
result = validator.validate_file('image.svg', profile: :"metanorma-sample")
|
|
29
29
|
|
|
30
30
|
if result.valid?
|
|
31
31
|
puts "✓ SVG is valid"
|
|
@@ -90,15 +90,15 @@ Validate SVG content or document object.
|
|
|
90
90
|
[source,ruby]
|
|
91
91
|
----
|
|
92
92
|
# String input
|
|
93
|
-
result = validator.validate(svg_string, profile: :metanorma)
|
|
93
|
+
result = validator.validate(svg_string, profile: :"metanorma-sample")
|
|
94
94
|
|
|
95
95
|
# Nokogiri element (common in Metanorma integration)
|
|
96
96
|
nokogiri_element = Nokogiri::XML(svg_string).root
|
|
97
|
-
result = validator.validate(nokogiri_element, profile: :metanorma)
|
|
97
|
+
result = validator.validate(nokogiri_element, profile: :"metanorma-sample")
|
|
98
98
|
|
|
99
99
|
# Moxml document
|
|
100
100
|
moxml_doc = Moxml.new.parse(svg_string)
|
|
101
|
-
result = validator.validate(moxml_doc, profile: :metanorma)
|
|
101
|
+
result = validator.validate(moxml_doc, profile: :"metanorma-sample")
|
|
102
102
|
----
|
|
103
103
|
|
|
104
104
|
===== validate_file(file_path, profile:, **options)
|
|
@@ -139,7 +139,7 @@ Validate multiple files.
|
|
|
139
139
|
[source,ruby]
|
|
140
140
|
----
|
|
141
141
|
files = ['image1.svg', 'image2.svg', 'image3.svg']
|
|
142
|
-
results = validator.validate_files(files, profile: :metanorma)
|
|
142
|
+
results = validator.validate_files(files, profile: :"metanorma-sample")
|
|
143
143
|
|
|
144
144
|
results.each do |file, result|
|
|
145
145
|
puts "#{file}: #{result.valid? ? '✓' : '✗'}"
|
|
@@ -157,7 +157,7 @@ Get list of available profiles.
|
|
|
157
157
|
[source,ruby]
|
|
158
158
|
----
|
|
159
159
|
profiles = validator.available_profiles
|
|
160
|
-
# => [:base, :svg_1_2_rfc, :metanorma, :lucid, ...]
|
|
160
|
+
# => [:base, :svg_1_2_rfc, :"metanorma-sample", :lucid, ...]
|
|
161
161
|
----
|
|
162
162
|
|
|
163
163
|
=== SvgConform::Profile
|
|
@@ -215,7 +215,7 @@ Validate a document against this profile.
|
|
|
215
215
|
|
|
216
216
|
[source,ruby]
|
|
217
217
|
----
|
|
218
|
-
profile = SvgConform::Profiles.get(:metanorma)
|
|
218
|
+
profile = SvgConform::Profiles.get(:"metanorma-sample")
|
|
219
219
|
document = SvgConform::Document.from_file('image.svg')
|
|
220
220
|
result = profile.validate(document)
|
|
221
221
|
----
|
|
@@ -234,7 +234,7 @@ Apply all remediations defined in the profile.
|
|
|
234
234
|
|
|
235
235
|
[source,ruby]
|
|
236
236
|
----
|
|
237
|
-
profile = SvgConform::Profiles.get(:metanorma)
|
|
237
|
+
profile = SvgConform::Profiles.get(:"metanorma-sample")
|
|
238
238
|
document = SvgConform::Document.from_file('image.svg')
|
|
239
239
|
|
|
240
240
|
changes = profile.apply_remediations(document)
|
|
@@ -448,7 +448,7 @@ Convert result to JSON string.
|
|
|
448
448
|
|
|
449
449
|
[source,ruby]
|
|
450
450
|
----
|
|
451
|
-
result = validator.validate(svg_content, profile: :metanorma)
|
|
451
|
+
result = validator.validate(svg_content, profile: :"metanorma-sample")
|
|
452
452
|
|
|
453
453
|
puts "Valid: #{result.valid?}"
|
|
454
454
|
puts "Errors: #{result.error_count}"
|
|
@@ -648,7 +648,7 @@ Get remediations from the profile.
|
|
|
648
648
|
|
|
649
649
|
[source,ruby]
|
|
650
650
|
----
|
|
651
|
-
profile = SvgConform::Profiles.get(:metanorma)
|
|
651
|
+
profile = SvgConform::Profiles.get(:"metanorma-sample")
|
|
652
652
|
runner = SvgConform::RemediationRunner.new(profile: profile)
|
|
653
653
|
|
|
654
654
|
result = runner.run_remediation_file('input.svg')
|
|
@@ -740,7 +740,7 @@ Get a profile by name.
|
|
|
740
740
|
|
|
741
741
|
[source,ruby]
|
|
742
742
|
----
|
|
743
|
-
profile = SvgConform::Profiles.get(:metanorma)
|
|
743
|
+
profile = SvgConform::Profiles.get(:"metanorma-sample")
|
|
744
744
|
profile = SvgConform::Profiles.get('svg_1_2_rfc')
|
|
745
745
|
----
|
|
746
746
|
|
|
@@ -755,7 +755,7 @@ Get list of available profile names.
|
|
|
755
755
|
[source,ruby]
|
|
756
756
|
----
|
|
757
757
|
profiles = SvgConform::Profiles.available_profiles
|
|
758
|
-
# => [:base, :svg_1_2_rfc, :metanorma, ...]
|
|
758
|
+
# => [:base, :svg_1_2_rfc, :"metanorma-sample", ...]
|
|
759
759
|
|
|
760
760
|
profiles.each do |name|
|
|
761
761
|
profile = SvgConform::Profiles.get(name)
|
|
@@ -778,7 +778,7 @@ end
|
|
|
778
778
|
| `:svg_1_2_rfc_with_rdf`
|
|
779
779
|
| RFC 7996 with RDF/Dublin Core metadata support
|
|
780
780
|
|
|
781
|
-
| `:metanorma`
|
|
781
|
+
| `:"metanorma-sample"`
|
|
782
782
|
| Metanorma document generation requirements
|
|
783
783
|
|
|
784
784
|
| `:lucid`
|
|
@@ -1004,7 +1004,7 @@ Convert to hash.
|
|
|
1004
1004
|
|
|
1005
1005
|
[source,ruby]
|
|
1006
1006
|
----
|
|
1007
|
-
result = validator.validate(svg_content, profile: :metanorma)
|
|
1007
|
+
result = validator.validate(svg_content, profile: :"metanorma-sample")
|
|
1008
1008
|
manifest = result.reference_manifest
|
|
1009
1009
|
|
|
1010
1010
|
puts "IDs defined: #{manifest.available_ids.size}"
|
|
@@ -1121,7 +1121,7 @@ errors = []
|
|
|
1121
1121
|
|
|
1122
1122
|
Dir.glob('images/**/*.svg') do |file|
|
|
1123
1123
|
begin
|
|
1124
|
-
result = validator.validate_file(file, profile: :metanorma)
|
|
1124
|
+
result = validator.validate_file(file, profile: :"metanorma-sample")
|
|
1125
1125
|
results[file] = result
|
|
1126
1126
|
|
|
1127
1127
|
unless result.valid?
|
|
@@ -1154,7 +1154,7 @@ end
|
|
|
1154
1154
|
|
|
1155
1155
|
[source,ruby]
|
|
1156
1156
|
----
|
|
1157
|
-
profile = SvgConform::Profiles.get(:metanorma)
|
|
1157
|
+
profile = SvgConform::Profiles.get(:"metanorma-sample")
|
|
1158
1158
|
runner = SvgConform::RemediationRunner.new(profile: profile)
|
|
1159
1159
|
|
|
1160
1160
|
Dir.glob('input/**/*.svg').each do |input_file|
|
|
@@ -1179,7 +1179,7 @@ end
|
|
|
1179
1179
|
|
|
1180
1180
|
[source,ruby]
|
|
1181
1181
|
----
|
|
1182
|
-
result = validator.validate(svg_content, profile: :metanorma)
|
|
1182
|
+
result = validator.validate(svg_content, profile: :"metanorma-sample")
|
|
1183
1183
|
manifest = result.reference_manifest
|
|
1184
1184
|
|
|
1185
1185
|
# Export manifest
|
|
@@ -1214,13 +1214,13 @@ end
|
|
|
1214
1214
|
class SVGProcessor
|
|
1215
1215
|
def initialize
|
|
1216
1216
|
@validator = SvgConform::Validator.new
|
|
1217
|
-
@profile = SvgConform::Profiles.get(:metanorma)
|
|
1217
|
+
@profile = SvgConform::Profiles.get(:"metanorma-sample")
|
|
1218
1218
|
@runner = SvgConform::RemediationRunner.new(profile: @profile)
|
|
1219
1219
|
end
|
|
1220
1220
|
|
|
1221
1221
|
def process_svg_element(nokogiri_element)
|
|
1222
1222
|
# Validate without serializing by user
|
|
1223
|
-
result = @validator.validate(nokogiri_element, profile: :metanorma)
|
|
1223
|
+
result = @validator.validate(nokogiri_element, profile: :"metanorma-sample")
|
|
1224
1224
|
|
|
1225
1225
|
if result.valid?
|
|
1226
1226
|
return { status: :valid, element: nokogiri_element }
|
|
@@ -1259,7 +1259,7 @@ Raised when validation fails due to invalid input.
|
|
|
1259
1259
|
[source,ruby]
|
|
1260
1260
|
----
|
|
1261
1261
|
begin
|
|
1262
|
-
result = validator.validate_file('missing.svg', profile: :metanorma)
|
|
1262
|
+
result = validator.validate_file('missing.svg', profile: :"metanorma-sample")
|
|
1263
1263
|
rescue SvgConform::ValidationError => e
|
|
1264
1264
|
puts "Validation error: #{e.message}"
|
|
1265
1265
|
end
|
|
@@ -1342,7 +1342,7 @@ validator = SvgConform::Validator.new(mode: :dom)
|
|
|
1342
1342
|
----
|
|
1343
1343
|
# Efficient batch processing
|
|
1344
1344
|
validator = SvgConform::Validator.new(mode: :sax)
|
|
1345
|
-
profile = SvgConform::Profiles.get(:metanorma) # Cache profile
|
|
1345
|
+
profile = SvgConform::Profiles.get(:"metanorma-sample") # Cache profile
|
|
1346
1346
|
|
|
1347
1347
|
files.each do |file|
|
|
1348
1348
|
result = validator.validate_file(file, profile: profile)
|