suma 0.5.16 → 0.5.17
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/suma/staged_collection_builder.rb +25 -1
- data/lib/suma/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: e5c15270fcd8076bab49e6fdf940d0f83fb2ad3ca4b3f274ac156eef6af5a8f0
|
|
4
|
+
data.tar.gz: b33b2aae6fbb4322fe010643b65326dad5683c265e3907d78bcaa39ad2fd0ad6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 93696359dfff9571f9705661a1ce6f40f8f78e4eb222dec2d34f4d7a030a6aa7962e091ed9d2688352ab80b31deb730989bedde47871d2c1a7c6e73fb656fffc
|
|
7
|
+
data.tar.gz: 2557f73a80035a6b77f7b35d7289044e5792ee78e91d8edf26b2f293f24013e995991ef079a62a78ebd612d9dcfc13f6ddce8ba0d1b0f61411820138db3bbd96
|
|
@@ -184,15 +184,39 @@ module Suma
|
|
|
184
184
|
.select { |f| f.end_with?(".semantic.xml") }
|
|
185
185
|
compile = { install_fonts: false }
|
|
186
186
|
compile[:novalid] = true if no_valid == "1"
|
|
187
|
-
Metanorma::Collection.parse(one_path)
|
|
187
|
+
collection = Metanorma::Collection.parse(one_path)
|
|
188
|
+
collection.render(
|
|
188
189
|
format: [:xml], output_folder: out,
|
|
189
190
|
preserve_unresolved: true, artifact_store_dir: store_dir,
|
|
190
191
|
compile: compile,
|
|
191
192
|
)
|
|
192
193
|
unless id_slug.empty?
|
|
194
|
+
# A warm artefact cache makes the render a full cache hit:
|
|
195
|
+
# no new artefact files appear, so a produced-files delta
|
|
196
|
+
# never fires. The collection's own keys are what the
|
|
197
|
+
# renderer stored under, so alias every semantic artefact
|
|
198
|
+
# keyed by them to the docref slug as well.
|
|
199
|
+
store_keys = (collection.bibdatas || {}).keys
|
|
193
200
|
produced = Dir.children(store_dir).select do |f|
|
|
194
201
|
f.end_with?(".semantic.xml")
|
|
195
202
|
end - semantics_before
|
|
203
|
+
if produced.empty?
|
|
204
|
+
store_keys.each do |key|
|
|
205
|
+
src_slug = key.to_s
|
|
206
|
+
.gsub(/[^A-Za-z0-9._-]+/, "-").gsub(/-{2,}/, "-")
|
|
207
|
+
.gsub(/\A-|-\z/, "")
|
|
208
|
+
next if src_slug.empty? || src_slug == id_slug
|
|
209
|
+
|
|
210
|
+
Dir[File.join(store_dir,
|
|
211
|
+
"\#{src_slug}.*.semantic.xml")].each do |f|
|
|
212
|
+
alias_name = f.sub(
|
|
213
|
+
%r{/\#{Regexp.escape(src_slug)}.},
|
|
214
|
+
"/\#{id_slug}.",
|
|
215
|
+
)
|
|
216
|
+
FileUtils.cp(f, alias_name)
|
|
217
|
+
end
|
|
218
|
+
end
|
|
219
|
+
end
|
|
196
220
|
produced.each do |f|
|
|
197
221
|
if (m = f.match(/\A(.*).([0-9a-f]+).semantic.xml\z/))
|
|
198
222
|
alias_name = "\#{id_slug}.\#{m[2]}.semantic.xml"
|
data/lib/suma/version.rb
CHANGED