metanorma-plugin-asciichem 0.1.0 → 0.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 582411f25fabc8527cec867947b12b663e2e3944724910676c56c562e485de3e
4
- data.tar.gz: d49a888d06069c133646bdc2f7e7ecb628662804a508c35858454d27437af862
3
+ metadata.gz: 38557a9ad544255e0a1d900860ed6e90a1113cccb568d32007f4c4e7ffc3c123
4
+ data.tar.gz: 8a68e216ad44f73faea707a37c0e2ca417540ba37180e131db29035636634d89
5
5
  SHA512:
6
- metadata.gz: d51b92da35d3cf24e9d1da8acca09f8d95abf1f98e6ed9aa3b9e8ada5912c9218f8341b1f7fa4627a16e072bf6d270b2b597d8457ced0d6466082c7298d0650a
7
- data.tar.gz: 73213d86ba4cbc8d7c4adbbc91920e55f2a3c67aa3da2989a442c8af26f7c31a3caf7a6a45d0ae56df3f1bf28f6f5738413ed399c2cea56369511f1b8e2cfc52
6
+ metadata.gz: 91aaca9dd9733d33b6238c1da2c45cf1f6380ae639fd5bccb08395e5ca70f5a5710a55c46449a7c2970cecccfb6e3f0c789006c6b030e6085957f849d09faab3
7
+ data.tar.gz: fe94c46d1bda2827cdc99728ab69eecd99e7b31323d3a06f9717e01864eb24f4b188c39bf21c44bb5e2af2b4c5d2359ea2cbd154d186a962b22a9a591904f79e
data/CHANGELOG.md CHANGED
@@ -6,17 +6,26 @@ All notable changes to this project will be documented in this file.
6
6
 
7
7
  ### Changed
8
8
 
9
- - Requires asciichem >= 0.29.2 (relaton-bib `< 3`), enabling
10
- co-resolution with current metanorma gems; metanorma-standoc is
11
- now a development dependency.
12
- - End-to-end standoc compile wired into the suite
13
- (`standoc_spec.rb`): `[chem]` → `<formula><stem type="MathML">`,
14
- dataset bibitems verbatim in `<references normative="false">`,
15
- InChIKey anchors.
16
- - Citation anchors are derived from the emitted bibitem XML (works
17
- under both relaton-bib major lines) instead of vendor object APIs.
9
+ - Runtime dependencies slimmed: `asciidoctor` and `nokogiri` are
10
+ gone. The host provides asciidoctor (metanorma-standoc requires
11
+ and registers the gem); the one direct XML touchpoint (setting
12
+ the InChIKey anchor on the emitted bibitem) now goes through
13
+ `moxml` (`~> 0.5`), the same adapter layer the rest of the
14
+ lutaml ecosystem uses.
15
+
16
+ ## [0.1.1] - 2026-09-22
17
+
18
+ ### Changed
18
19
 
19
- ## [0.1.0] - 2026-09-16
20
+ - Dependency floors raised to the suite-validated versions,
21
+ pessimistically: `asciichem ~> 0.29, >= 0.29.2`, `nokogiri
22
+ ~> 1.18`; `asciidoctor` unchanged.
23
+
24
+ ## [0.1.0] - 2026-09-22
25
+
26
+ First release, published under the final name and namespace (the
27
+ rename from the pre-release `asciichem/metanorma-asciichem` layout
28
+ happened before anything shipped, so it is invisible to users).
20
29
 
21
30
  ### Added
22
31
 
@@ -25,24 +34,17 @@ All notable changes to this project will be documented in this file.
25
34
  Metanorma semantic XML). Block ids and titles carry over; invalid
26
35
  sources log an error and keep the block as sourcecode.
27
36
  - `chem:[]` inline macro (target and attribute forms) for inline
28
- chemistry.
37
+ chemistry, emitting the core-stem node shape so metanorma
38
+ converters dispatch it correctly.
29
39
  - Substance citations: `@cite`-annotated molecules in `[chem]` blocks
30
40
  resolve through `AsciiChem::Citation` to dataset-type Relaton
31
41
  bibitems, one per (source, substance), deduplicated, anchored by
32
42
  InChIKey, appended as a `[bibliography]` section.
33
43
  - `:asciichem-cache-dir:` document attribute for offline,
34
44
  reproducible citation resolution.
35
-
36
- ## [0.1.0-renamed] - 2026-09-17
37
- ### Renamed
38
-
39
- - The gem moves to the metanorma org as
40
- `metanorma-plugin-asciichem` (from asciichem/metanorma-asciichem),
41
- following the plugin-family convention (lutaml, glossarist,
42
- plantuml). Namespace is now `Metanorma::Plugin::Asciichem` with
43
- lib at `metanorma/plugin/asciichem`; the require-by-name entry is
44
- `metanorma-plugin-asciichem`. Per the plugin contract the gem no
45
- longer self-registers with Asciidoctor — metanorma-standoc
46
- requires and registers it (as it does for lutaml/glossarist).
47
- Not released under the previous name, so the rename is invisible
48
- to users.
45
+ - End-to-end metanorma-standoc compile spec (`standoc_spec.rb`);
46
+ per the plugin contract the gem exposes extension classes and the
47
+ host (metanorma-standoc) registers them, as it does for
48
+ lutaml/glossarist.
49
+ - Citation anchors are derived from the emitted bibitem XML (works
50
+ under both relaton-bib major lines) instead of vendor object APIs.
data/README.md CHANGED
@@ -111,9 +111,12 @@ A worked example document ships in `docs/example.adoc`.
111
111
 
112
112
  ## Compatibility
113
113
 
114
- Runtime dependencies are `asciichem` (>= 0.29.2), `asciidoctor`, and
115
- `nokogiri` — the extension operates at the Asciidoctor AST level and
116
- needs no Metanorma gem to run.
114
+ Runtime dependencies are `asciichem` (`~> 0.29`, `>= 0.29.2`) and
115
+ `moxml` — the extension operates at the Asciidoctor AST level and
116
+ needs no Metanorma gem to run. Asciidoctor itself is provided by the
117
+ host (metanorma-standoc requires and registers this gem; outside
118
+ Metanorma, bring your own asciidoctor and register the extension as
119
+ shown under Installation).
117
120
 
118
121
  The full metanorma-standoc compile is exercised by the suite:
119
122
  `spec/metanorma/plugin/asciichem/standoc_spec.rb` compiles a document
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'nokogiri'
3
+ require 'moxml'
4
4
 
5
5
  module Metanorma
6
6
  module Plugin
@@ -89,9 +89,9 @@ module Metanorma
89
89
  # docidentifier; the anchor (InChIKey) replaces it so document
90
90
  # cross-references <<INCHIKEY>> land on the entry.
91
91
  def with_anchor(xml, anchor)
92
- root = Nokogiri::XML(xml).root
93
- root['id'] = anchor
94
- root.to_xml
92
+ doc = Moxml.parse(xml)
93
+ doc.root['id'] = anchor
94
+ doc.to_xml
95
95
  end
96
96
 
97
97
  def bibliography_section(document, entries)
@@ -3,7 +3,7 @@
3
3
  module Metanorma
4
4
  module Plugin
5
5
  module Asciichem
6
- VERSION = '0.1.0'
6
+ VERSION = '0.1.2'
7
7
  end
8
8
  end
9
9
  end
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'asciidoctor' unless defined?(Asciidoctor)
4
3
  require 'asciichem'
5
4
 
6
5
  module Metanorma
@@ -33,13 +33,6 @@ Gem::Specification.new do |spec|
33
33
  end
34
34
  spec.require_paths = ['lib']
35
35
 
36
- spec.add_dependency 'asciichem', '>= 0.29.2'
37
- spec.add_dependency 'asciidoctor', '~> 2.0'
38
- spec.add_dependency 'nokogiri', '~> 1.16'
39
-
40
- # metanorma-standoc lives in the Gemfile dev group: it is the
41
- # integration-test backend (spec/metanorma/plugin/asciichem/
42
- # standoc_spec.rb), not a runtime requirement — following the
43
- # plugin contract, metanorma-standoc requires and registers this
44
- # gem, like it does for metanorma-plugin-lutaml.
36
+ spec.add_dependency 'asciichem', '~> 0.29', '>= 0.29.2'
37
+ spec.add_dependency 'moxml', '~> 0.5'
45
38
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-plugin-asciichem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
@@ -13,44 +13,36 @@ dependencies:
13
13
  name: asciichem
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
- - - ">="
16
+ - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: 0.29.2
19
- type: :runtime
20
- prerelease: false
21
- version_requirements: !ruby/object:Gem::Requirement
22
- requirements:
18
+ version: '0.29'
23
19
  - - ">="
24
20
  - !ruby/object:Gem::Version
25
21
  version: 0.29.2
26
- - !ruby/object:Gem::Dependency
27
- name: asciidoctor
28
- requirement: !ruby/object:Gem::Requirement
29
- requirements:
30
- - - "~>"
31
- - !ruby/object:Gem::Version
32
- version: '2.0'
33
22
  type: :runtime
34
23
  prerelease: false
35
24
  version_requirements: !ruby/object:Gem::Requirement
36
25
  requirements:
37
26
  - - "~>"
38
27
  - !ruby/object:Gem::Version
39
- version: '2.0'
28
+ version: '0.29'
29
+ - - ">="
30
+ - !ruby/object:Gem::Version
31
+ version: 0.29.2
40
32
  - !ruby/object:Gem::Dependency
41
- name: nokogiri
33
+ name: moxml
42
34
  requirement: !ruby/object:Gem::Requirement
43
35
  requirements:
44
36
  - - "~>"
45
37
  - !ruby/object:Gem::Version
46
- version: '1.16'
38
+ version: '0.5'
47
39
  type: :runtime
48
40
  prerelease: false
49
41
  version_requirements: !ruby/object:Gem::Requirement
50
42
  requirements:
51
43
  - - "~>"
52
44
  - !ruby/object:Gem::Version
53
- version: '1.16'
45
+ version: '0.5'
54
46
  description: 'Adds [chem] blocks and chem:[] inline macros to Metanorma AsciiDoc:
55
47
  chemistry written in AsciiChem parses to MathML for rendering, and @cite-annotated
56
48
  molecules resolve to dataset-type Relaton bibitems - one per (source, substance),