isodoc 3.7.11 → 3.7.12
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/isodoc/css.rb +20 -0
- data/lib/isodoc/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: 7ff06e0cc7960c3c125d068e085f3d56973a3591c530fdaa096f70d47a2e574d
|
|
4
|
+
data.tar.gz: e04d4ceda3b6f90fed711df3a4d9c1e47b033282f28e70b550fdecff79a97f66
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 14dba4914e496487f29f48349e1086a96fc8a3e92c7a28f9d4e83e1f174761cc7dac42611d605eb1feac25b18ebde9d0e28996d5c4ec3fbadd21729cfebf9ba9
|
|
7
|
+
data.tar.gz: f9b1da627369b9febc2730287a5227cbdccc28fed3e7ed72d132986a743eb49700d853a038ded173ec5470b000e036e5ecb26a6dd41ae92bc1de864a83339709
|
data/lib/isodoc/css.rb
CHANGED
|
@@ -100,10 +100,30 @@ module IsoDoc
|
|
|
100
100
|
File.dirname(filename)]
|
|
101
101
|
end
|
|
102
102
|
|
|
103
|
+
def sassc_available?
|
|
104
|
+
require "sassc-embedded"
|
|
105
|
+
true
|
|
106
|
+
rescue LoadError
|
|
107
|
+
false
|
|
108
|
+
end
|
|
109
|
+
|
|
103
110
|
# stripwordcss if HTML stylesheet, !stripwordcss if DOC stylesheet
|
|
104
111
|
def generate_css(filename, stripwordcss)
|
|
105
112
|
filename.nil? and return nil
|
|
106
113
|
filename = precompiled_style_or_original(filename)
|
|
114
|
+
# The release's precompiled .css twins bake in the DEFAULT font
|
|
115
|
+
# variables, so a flavor overriding default_fonts would be silently
|
|
116
|
+
# dropped when its stylesheet is consumed as precompiled
|
|
117
|
+
# (metanorma-un, metanorma-m3aawg font regressions). When the scss
|
|
118
|
+
# source is present and the consumer bundle carries the optional
|
|
119
|
+
# sassc-embedded toolchain, compile at runtime so the flavor's
|
|
120
|
+
# fonts template in; plain installs without the toolchain keep the
|
|
121
|
+
# precompiled fallback.
|
|
122
|
+
scss = filename.sub(/\.css\z/, ".scss")
|
|
123
|
+
if File.extname(filename) == ".css" && File.file?(scss) &&
|
|
124
|
+
sassc_available?
|
|
125
|
+
filename = scss
|
|
126
|
+
end
|
|
107
127
|
stylesheet = File.read(filename, encoding: "UTF-8")
|
|
108
128
|
stylesheet = preprocess_css(stylesheet, stripwordcss)
|
|
109
129
|
File.extname(filename) == ".scss" and
|
data/lib/isodoc/version.rb
CHANGED