metanorma-custom-assets 0.0.1

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 5c539f127310123b54c11dd736b0479f4155b7c78f564f22c24947a744dc6014
4
+ data.tar.gz: c13fc84e65daf21439886efd5be3ca39a7e7556a16641280b683d88f2278f73d
5
+ SHA512:
6
+ metadata.gz: 29a923d6dffe2793cf8f46a1df2019f169d54d7aefeba404066027cb7caf4ba2ee4e385c81e008059ed35031f5ff589c61664a4e1bff3387e51be6a9f3d99378
7
+ data.tar.gz: 328718020345c18842e21927a6766ce7279cf368caa0e1a23448b964c777422e6e398810e3f9714a5d07145788e312133a8cee85e8676aa4f5ef9c61d37bd0ad
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --require spec_helper
2
+ --format documentation
3
+ --color
data/.rubocop.yml ADDED
@@ -0,0 +1,13 @@
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
3
+ inherit_from:
4
+ - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
5
+
6
+ # local repo-specific modifications
7
+ # ...
8
+
9
+ AllCops:
10
+ TargetRubyVersion: 3.1
11
+
12
+ Lint/MissingSuper:
13
+ AllowedParentClasses: [Liquid::Drop]
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,24 @@
1
+ BSD 2-Clause License
2
+
3
+ Copyright (c) 2025, Metanorma
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
19
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
data/README.adoc ADDED
@@ -0,0 +1,27 @@
1
+ = metanorma-custom-assets
2
+ Assets with which to customise Metanorma flavours based on other flavours
3
+
4
+ image:https://img.shields.io/gem/v/metanorma-custom-assets.svg["Gem Version", link="https://rubygems.org/gems/metanorma-custom-assets"]
5
+ image:https://github.com/metanorma/metanorma-custom-assets/workflows/rake/badge.svg["Build Status", link="https://github.com/metanorma/metanorma-custom-assets/actions?workflow=rake"]
6
+ image:https://codeclimate.com/github/metanorma/metanorma-custom-assets/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/metanorma/metanorma-custom-assets"]
7
+ image:https://img.shields.io/github/issues-pr-raw/metanorma/metanorma-custom-assets.svg["Pull Requests", link="https://github.com/metanorma/metanorma-custom-assets/pulls"]
8
+ image:https://img.shields.io/github/commits-since/metanorma/metanorma-custom-assets/latest.svg["Commits since latest",link="https://github.com/metanorma/metanorma-custom-assets/releases"]
9
+
10
+ == Usage
11
+ [source,console]
12
+ ----
13
+ require "metanorma-custom-assets"
14
+
15
+ c = Metanorma::CustomAssets.new(:icc)
16
+ c.process_input_adoc_hdr(attributes, options)
17
+ ----
18
+
19
+ The function `process_input_doc_hdr` rewrites the document attributes of a document (given as an array of docuemnt attribute lines
20
+ from the document header), and the options hash passed to `Metanorma::Compile.process_input_adoc()`, to conform with the expectations
21
+ of the flavour named in the class initialisation. Any document attributes are inserted before the current attributes of the document,
22
+ so that the document can override them if necessary with its own values.
23
+
24
+ The module method `aliases` maps the flavour to predefined Metanorma flavours, and indicates that the nominated flavour is a customisation
25
+ of that flavour.
26
+
27
+
@@ -0,0 +1,70 @@
1
+ == copyright-statement
2
+ === Copyright notice
3
+
4
+ Copyright (c) {{ docyear }} International Color Consortium
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
7
+ this Specification (the "Specification") to exploit the Specification without
8
+ restriction including, without limitation, the rights to use, copy, modify,
9
+ merge, publish, distribute, and/or sublicense, copies of the Specification, and
10
+ to permit persons to whom the Specification is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ Elements of this Specification may be the subject of intellectual property
14
+ rights of third parties throughout the world including, without limitation,
15
+ patents, patent application, utility, models, copyrights, trade secrets or other
16
+ proprietary rights ("Third Party IP Rights"). Although no Third Party IP Rights
17
+ have been brought to the attention of the International Color Consortium (the
18
+ "ICC") by its members, or as a result of the publication of this Specification
19
+ in certain trade journals, the ICC has not conducted any independent
20
+ investigation regarding the existence of Third Party IP Rights. The ICC shall
21
+ not be held responsible for identifying Third Party IP Rights that may be
22
+ implicated by the practice of this Specification or the permissions granted
23
+ above, for conducting inquiries into the applicability, existence, validity, or
24
+ scope of any Third Party IP Rights that are brought to the ICC's attention, or
25
+ for obtaining licensing assurances with respect to any Third Party IP Rights.
26
+
27
+ THE SPECIFICATION IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS,
28
+ IMPLIED, OR OTHERWISE INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF
29
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, QUIET
30
+ ENJOYMENT, SYSTEM INTEGRATION, AND DATA ACCURACY. IN NO EVENT SHALL THE ICC BE
31
+ LIABLE FOR ANY CLAIM, DAMAGES, LOSSES, EXPENSES OR OTHER LIABILITY, WHETHER IN
32
+ AN ACTION OF CONTRACT, TORT OR OTHERWISE, CAUSED BY, ARISING OR RESULTING FROM,
33
+ OR THAT RELATE TO THE SPECIFICATION OR THE PRACTICE OR OTHER EXPLOITATION OF THE
34
+ SPECIFICATION. FURTHER, YOU HEREBY AGREE TO DEFEND, INDEMNIFY AND HOLD HARMLESS
35
+ THE ICC, AND ITS DIRECTORS AND EMPLOYEES, FROM AND AGAINST ANY AND ALL THIRD
36
+ PARTY CLAIMS, ACTIONS SUITS, DAMAGES, LOSSES, COSTS, EXPENSES, OR OTHER
37
+ LIABILITIES (INCLUDING REASONABLE ATTORNEY'S FEES AND EXPENSES) THAT WERE CAUSED
38
+ BY, ARISE OR RESULT FROM, OR RELATE TO, YOUR PRACTICE OR OTHER EXPLOITATION OF
39
+ THE SPECIFICATION (INCLUDING, WITHOUT LIMITATION, CLAIMS OF INFRINGEMENT).
40
+
41
+ The above copyright notice, permission, and conditions and disclaimers shall be
42
+ included in all copies of any material portion of the Specification. Except as
43
+ contained in this statement, the name "International Color Consortium" shall not
44
+ be used in advertising or otherwise to promote the use or other dealings in this
45
+ Specification without prior written authorization from the ICC.
46
+
47
+ === Licenses and trademarks
48
+
49
+ International Color Consortium and the ICC logo are registered trademarks of the
50
+ International Color Consortium.
51
+
52
+ Rather than put a trademark symbol in every occurrence of other trademarked
53
+ names, we state that we are using the names only in an editorial fashion, and to
54
+ the benefit of the trademark owner, with no intention of infringement of the
55
+ trademark.
56
+
57
+ === For additional information on the ICC
58
+
59
+ Visit the ICC Web site: http://www.color.org
60
+
61
+
62
+ == feedback-statement
63
+
64
+ === {blank}
65
+
66
+ // [align=center]
67
+ // **International Color Consortium**:
68
+ // Standardizing [css color:blue]#color# fidelity since 1993.
69
+
70
+ // (c) ICC {{ docyear }} - All rights reserved
@@ -0,0 +1,2 @@
1
+ doctype_dict:
2
+ international-standard: Specification
@@ -0,0 +1,33 @@
1
+ module Metanorma
2
+ class CustomAssets
3
+ def initialize(flavor)
4
+ @flavor = flavor
5
+ end
6
+
7
+ def self.aliases
8
+ { icc: :iso }
9
+ end
10
+
11
+ def process_input_adoc_overrides(attrs, options)
12
+ # Insert after the second element (index 1)
13
+ # If attrs has fewer than 2 elements, this will handle it appropriately
14
+ insertion_index = [attrs.length, 2].min
15
+ case @flavor
16
+ when :icc
17
+ f1 = File.join(File.dirname(__FILE__), "assets", "icc-boilerplate.adoc")
18
+ f2 = File.join(File.dirname(__FILE__), "assets", "icc-i18n.yaml")
19
+ new_attrs = [
20
+ ":boilerplate-authority: #{f1}",
21
+ ":i18nyaml: #{f2}",
22
+ ":publisher: International Color Consortium",
23
+ ":publisher_abbr: ICC",
24
+ ":presentation-metadata-color-secondary: #376795",
25
+ ":presentation-metadata-backcover-text: color.org",
26
+ ]
27
+ attrs.insert(insertion_index, *new_attrs)
28
+ options[":boilerplate-authority:"] = f1
29
+ end
30
+ attrs
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,5 @@
1
+ module Metanorma
2
+ class CustomAssets
3
+ VERSION = "0.0.1".freeze
4
+ end
5
+ end
@@ -0,0 +1,2 @@
1
+ require_relative "metanorma/customassets/customassets"
2
+ require_relative "metanorma/customassets/version"
@@ -0,0 +1,41 @@
1
+ lib = File.expand_path("lib", __dir__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require "metanorma/customassets/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "metanorma-custom-assets"
7
+ spec.version = Metanorma::CustomAssets::VERSION
8
+ spec.authors = ["Ribose Inc."]
9
+ spec.email = ["open.source@ribose.com"]
10
+
11
+ spec.summary = "Metanorma is the standard of standards; the metanorma gem allows you to create any standard document type supported by Metanorma."
12
+ spec.description = "Library to process any Metanorma standard."
13
+ spec.homepage = "https://github.com/metanorma/metanorma-custom-assets"
14
+ spec.license = "BSD-2-Clause"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
17
+ f.match(%r{^(test|spec|features|bin|.github)/}) \
18
+ || f.match(%r{Rakefile|bin/rspec}) \
19
+ || f.match(%r{flake|\.(?:direnv|pryrc|irbrc|nix)})
20
+ end
21
+ spec.extra_rdoc_files = %w[README.adoc LICENSE.txt]
22
+ spec.bindir = "bin"
23
+ # spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
+ spec.require_paths = ["lib"]
25
+ spec.required_ruby_version = ">= 3.1.0"
26
+
27
+ spec.add_development_dependency "debug"
28
+ spec.add_development_dependency "equivalent-xml", "~> 0.6"
29
+ spec.add_development_dependency "metanorma-iso"
30
+ spec.add_development_dependency "mnconvert"
31
+ spec.add_development_dependency "pry"
32
+ spec.add_development_dependency "rake", "~> 13.0"
33
+ spec.add_development_dependency "rspec", "~> 3.0"
34
+ spec.add_development_dependency "rspec-command", "~> 1.0"
35
+ spec.add_development_dependency "rubocop", "~> 1"
36
+ spec.add_development_dependency "rubocop-performance"
37
+ spec.add_development_dependency "sassc-embedded", "~> 1"
38
+ spec.add_development_dependency "simplecov", "~> 0.15"
39
+ spec.add_development_dependency "xml-c14n"
40
+ spec.add_development_dependency "metanorma"
41
+ end
metadata ADDED
@@ -0,0 +1,250 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: metanorma-custom-assets
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Ribose Inc.
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: debug
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '0'
19
+ type: :development
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: '0'
26
+ - !ruby/object:Gem::Dependency
27
+ name: equivalent-xml
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - "~>"
31
+ - !ruby/object:Gem::Version
32
+ version: '0.6'
33
+ type: :development
34
+ prerelease: false
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '0.6'
40
+ - !ruby/object:Gem::Dependency
41
+ name: metanorma-iso
42
+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ type: :development
48
+ prerelease: false
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ - !ruby/object:Gem::Dependency
55
+ name: mnconvert
56
+ requirement: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ type: :development
62
+ prerelease: false
63
+ version_requirements: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ - !ruby/object:Gem::Dependency
69
+ name: pry
70
+ requirement: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ type: :development
76
+ prerelease: false
77
+ version_requirements: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ - !ruby/object:Gem::Dependency
83
+ name: rake
84
+ requirement: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: '13.0'
89
+ type: :development
90
+ prerelease: false
91
+ version_requirements: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - "~>"
94
+ - !ruby/object:Gem::Version
95
+ version: '13.0'
96
+ - !ruby/object:Gem::Dependency
97
+ name: rspec
98
+ requirement: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - "~>"
101
+ - !ruby/object:Gem::Version
102
+ version: '3.0'
103
+ type: :development
104
+ prerelease: false
105
+ version_requirements: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - "~>"
108
+ - !ruby/object:Gem::Version
109
+ version: '3.0'
110
+ - !ruby/object:Gem::Dependency
111
+ name: rspec-command
112
+ requirement: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - "~>"
115
+ - !ruby/object:Gem::Version
116
+ version: '1.0'
117
+ type: :development
118
+ prerelease: false
119
+ version_requirements: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - "~>"
122
+ - !ruby/object:Gem::Version
123
+ version: '1.0'
124
+ - !ruby/object:Gem::Dependency
125
+ name: rubocop
126
+ requirement: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - "~>"
129
+ - !ruby/object:Gem::Version
130
+ version: '1'
131
+ type: :development
132
+ prerelease: false
133
+ version_requirements: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - "~>"
136
+ - !ruby/object:Gem::Version
137
+ version: '1'
138
+ - !ruby/object:Gem::Dependency
139
+ name: rubocop-performance
140
+ requirement: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - ">="
143
+ - !ruby/object:Gem::Version
144
+ version: '0'
145
+ type: :development
146
+ prerelease: false
147
+ version_requirements: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - ">="
150
+ - !ruby/object:Gem::Version
151
+ version: '0'
152
+ - !ruby/object:Gem::Dependency
153
+ name: sassc-embedded
154
+ requirement: !ruby/object:Gem::Requirement
155
+ requirements:
156
+ - - "~>"
157
+ - !ruby/object:Gem::Version
158
+ version: '1'
159
+ type: :development
160
+ prerelease: false
161
+ version_requirements: !ruby/object:Gem::Requirement
162
+ requirements:
163
+ - - "~>"
164
+ - !ruby/object:Gem::Version
165
+ version: '1'
166
+ - !ruby/object:Gem::Dependency
167
+ name: simplecov
168
+ requirement: !ruby/object:Gem::Requirement
169
+ requirements:
170
+ - - "~>"
171
+ - !ruby/object:Gem::Version
172
+ version: '0.15'
173
+ type: :development
174
+ prerelease: false
175
+ version_requirements: !ruby/object:Gem::Requirement
176
+ requirements:
177
+ - - "~>"
178
+ - !ruby/object:Gem::Version
179
+ version: '0.15'
180
+ - !ruby/object:Gem::Dependency
181
+ name: xml-c14n
182
+ requirement: !ruby/object:Gem::Requirement
183
+ requirements:
184
+ - - ">="
185
+ - !ruby/object:Gem::Version
186
+ version: '0'
187
+ type: :development
188
+ prerelease: false
189
+ version_requirements: !ruby/object:Gem::Requirement
190
+ requirements:
191
+ - - ">="
192
+ - !ruby/object:Gem::Version
193
+ version: '0'
194
+ - !ruby/object:Gem::Dependency
195
+ name: metanorma
196
+ requirement: !ruby/object:Gem::Requirement
197
+ requirements:
198
+ - - ">="
199
+ - !ruby/object:Gem::Version
200
+ version: '0'
201
+ type: :development
202
+ prerelease: false
203
+ version_requirements: !ruby/object:Gem::Requirement
204
+ requirements:
205
+ - - ">="
206
+ - !ruby/object:Gem::Version
207
+ version: '0'
208
+ description: Library to process any Metanorma standard.
209
+ email:
210
+ - open.source@ribose.com
211
+ executables: []
212
+ extensions: []
213
+ extra_rdoc_files:
214
+ - LICENSE.txt
215
+ - README.adoc
216
+ files:
217
+ - ".rspec"
218
+ - ".rubocop.yml"
219
+ - Gemfile
220
+ - LICENSE.txt
221
+ - README.adoc
222
+ - lib/metanorma-custom-assets.rb
223
+ - lib/metanorma/customassets/assets/icc-boilerplate.adoc
224
+ - lib/metanorma/customassets/assets/icc-i18n.yaml
225
+ - lib/metanorma/customassets/customassets.rb
226
+ - lib/metanorma/customassets/version.rb
227
+ - metanorma-custom-assets.gemspec
228
+ homepage: https://github.com/metanorma/metanorma-custom-assets
229
+ licenses:
230
+ - BSD-2-Clause
231
+ metadata: {}
232
+ rdoc_options: []
233
+ require_paths:
234
+ - lib
235
+ required_ruby_version: !ruby/object:Gem::Requirement
236
+ requirements:
237
+ - - ">="
238
+ - !ruby/object:Gem::Version
239
+ version: 3.1.0
240
+ required_rubygems_version: !ruby/object:Gem::Requirement
241
+ requirements:
242
+ - - ">="
243
+ - !ruby/object:Gem::Version
244
+ version: '0'
245
+ requirements: []
246
+ rubygems_version: 3.6.7
247
+ specification_version: 4
248
+ summary: Metanorma is the standard of standards; the metanorma gem allows you to create
249
+ any standard document type supported by Metanorma.
250
+ test_files: []