Skip to content

Commit b084fae

Browse files
committed
Update documentation for cdx-core v0.7.0 alignment
- Update mark type names to namespaced forms throughout README - Document measurement as core type with display field - Document math mark source field - Document subfigures array format - Note reader backward compatibility with non-namespaced marks - Update content version in output structure example - Add CHANGELOG entry for v0.6.0
1 parent 4a0575b commit b084fae

2 files changed

Lines changed: 26 additions & 14 deletions

File tree

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
66

77
## [Unreleased]
88

9+
## [0.6.0] - 2026-02-17
10+
11+
### Changed
12+
- **Mark namespacing**: semantic marks now use `semantic:` prefix (`semantic:citation`, `semantic:entity`, `semantic:glossary`), academic marks use `academic:` prefix (`academic:theorem-ref`, `academic:equation-ref`, `academic:algorithm-ref`). Core marks (`footnote`, `anchor`, `math`, `link`, `code`) are unchanged.
13+
- **Measurement** is now a core block type (`measurement`) with a `display` field containing the original text. Removed `semantic:measurement` type and `schema` (schema.org QuantitativeValue) field.
14+
- **Figure subfigures** moved from `children` to a dedicated `subfigures` array. Subfigure objects have `id`, `label`, and `children` fields (no `type`).
15+
- **Inline math** mark now includes `source` field containing the LaTeX string alongside `format: "latex"`.
16+
- **Content version** bumped from `0.1` to `0.7.0` to align with cdx-core serialization format.
17+
- Extension tracking now covers inline marks (semantic and academic), not just blocks.
18+
- Reader accepts both namespaced and legacy non-namespaced mark formats for backward compatibility.
19+
920
## [0.5.0] - 2026-02-04
1021

1122
### Added

README.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pandoc -f cdx-reader.lua output.json -o document.tex
5858
pandoc -f cdx-reader.lua output.json -o document.html
5959
```
6060

61-
The reader handles core block types (paragraphs, headings, lists, code blocks, blockquotes, tables, math, images, figures, definition lists, admonitions) and academic extension blocks (theorems, proofs, exercises, algorithms, abstracts, equation groups). Semantic blocks like `semantic:term`, `semantic:measurement`, and `semantic:ref` are converted to their closest Pandoc equivalents. Footnotes are restored via inline references. Extension blocks without equivalents (e.g., `semantic:bibliography`, `semantic:glossary`) are skipped.
61+
The reader handles core block types (paragraphs, headings, lists, code blocks, blockquotes, tables, math, images, figures, definition lists, admonitions, measurements) and academic extension blocks (theorems, proofs, exercises, algorithms, abstracts, equation groups). Semantic blocks like `semantic:term` and `semantic:ref` are converted to their closest Pandoc equivalents. The reader accepts both namespaced (e.g., `semantic:citation`) and legacy non-namespaced mark formats. Footnotes are restored via inline references. Extension blocks without equivalents (e.g., `semantic:bibliography`, `semantic:glossary`) are skipped.
6262

6363
## Features
6464

@@ -77,8 +77,9 @@ The reader handles core block types (paragraphs, headings, lists, code blocks, b
7777
| Math (display) | math | LaTeX format, display=true |
7878
| Math (inline) | math mark | LaTeX format on text node |
7979
| DefinitionList | definitionList | Core block with term/description items |
80+
| Span (.measurement) | measurement | Core block: value, unit, display |
8081
| DefinitionList (.glossary) | semantic:term | Glossary Div context only |
81-
| Cite | citation mark | refs, locator, prefix, suffix, suppressAuthor |
82+
| Cite | semantic:citation mark | refs, locator, prefix, suffix, suppressAuthor |
8283
| Note | semantic:footnote | Superscript ref + block content |
8384
| Image | image | src, alt, title, width, height |
8485
| Figure | figure | Container with image children + figcaption |
@@ -101,10 +102,10 @@ The reader handles core block types (paragraphs, headings, lists, code blocks, b
101102
| Emph | italic |
102103
| Code | code |
103104
| Link | link (with href, title) |
104-
| Link (#thm-*, #lem-*, ...) | theorem-ref |
105-
| Link (#eq-*) | equation-ref |
106-
| Link (#alg-*) | algorithm-ref |
107-
| Math (inline) | math (format: latex) |
105+
| Link (#thm-*, #lem-*, ...) | academic:theorem-ref |
106+
| Link (#eq-*) | academic:equation-ref |
107+
| Link (#alg-*) | academic:algorithm-ref |
108+
| Math (inline) | math (format: latex, source) |
108109
| Strikeout | strikethrough |
109110
| Underline | underline |
110111
| Superscript | superscript |
@@ -124,7 +125,7 @@ Link text to knowledge bases (Wikidata, DBpedia, etc.):
124125
[Large Hadron Collider]{.entity uri="https://www.wikidata.org/wiki/Q83492" entityType="Place" source="Wikidata"}
125126
```
126127

127-
Produces an `entity` mark with `uri`, `entityType`, and optional `source` fields.
128+
Produces a `semantic:entity` mark with `uri`, `entityType`, and optional `source` fields.
128129

129130
#### Glossary References
130131

@@ -137,7 +138,7 @@ We discuss [CRDT]{.glossary ref="term-crdt"} technologies.
137138
[eventual consistency]{.glossary}
138139
```
139140

140-
Produces a `glossary` mark with `ref` field pointing to a `semantic:term` block ID.
141+
Produces a `semantic:glossary` mark with `ref` field pointing to a `semantic:term` block ID.
141142

142143
#### Measurements
143144

@@ -149,7 +150,7 @@ The sample weighed [42.5 kg]{.measurement value="42.5" unit="kg"}.
149150
Temperature reached [100 °C]{.measurement value="100" unit="°C"}.
150151
```
151152

152-
Produces a `semantic:measurement` block with `value`, `unit`, and schema.org `QuantitativeValue` metadata.
153+
Produces a core `measurement` block with `value`, `unit`, and `display` (the original text).
153154

154155
### Academic Extension Blocks
155156

@@ -199,7 +200,7 @@ Admonition classes: `note`, `warning`, `tip`, `danger`, `important`, `caution`.
199200

200201
Aligned LaTeX environments (`\begin{align}`, `\begin{gather}`, `\begin{split}`) in display math are automatically detected and converted to `academic:equation-group` blocks.
201202

202-
Cross-references to academic blocks use standard Markdown links with `#`-prefixed IDs (e.g., `[Theorem 1](#thm-max)`). Links targeting `#thm-*`, `#lem-*`, `#eq-*`, `#alg-*`, etc. are converted to typed reference marks (`theorem-ref`, `equation-ref`, `algorithm-ref`).
203+
Cross-references to academic blocks use standard Markdown links with `#`-prefixed IDs (e.g., `[Theorem 1](#thm-max)`). Links targeting `#thm-*`, `#lem-*`, `#eq-*`, `#alg-*`, etc. are converted to namespaced reference marks (`academic:theorem-ref`, `academic:equation-ref`, `academic:algorithm-ref`).
203204

204205
### Metadata Mapping
205206

@@ -237,7 +238,7 @@ The writer produces a JSON structure with three sections:
237238
}
238239
},
239240
"content": {
240-
"version": "0.1",
241+
"version": "0.7.0",
241242
"blocks": [...]
242243
},
243244
"dublin_core": {
@@ -363,16 +364,16 @@ Display math should use double dollar signs or the equation environment:
363364
$$E = mc^2$$
364365
```
365366

366-
Inline math uses single dollar signs: `$x = y$`. Inline math is preserved as a `math` mark on text nodes (stays inside the paragraph). Display math produces a block-level `math` block. Aligned LaTeX environments (`align`, `gather`, `split`) are automatically detected and converted to `academic:equation-group` blocks.
367+
Inline math uses single dollar signs: `$x = y$`. Inline math is preserved as a `math` mark on text nodes (stays inside the paragraph) with `format: "latex"` and `source` containing the LaTeX string. Display math produces a block-level `math` block. Aligned LaTeX environments (`align`, `gather`, `split`) are automatically detected and converted to `academic:equation-group` blocks.
367368

368369
### Reader round-trip loses semantic data
369370

370371
The reader converts Codex back to standard Pandoc elements. Most block types survive round-trip faithfully:
371372

372373
- **Core blocks**: paragraphs, headings, lists, tables, code, math, images, figures, definition lists, admonitions all round-trip cleanly.
373374
- **Academic blocks**: theorems (variant, id, title), proofs (of, method), exercises (difficulty, hints, solutions), algorithms (title, pseudocode), abstracts (keywords), and equation groups (reconstructed LaTeX environments) all survive via Pandoc Div attributes.
374-
- **Semantic blocks**: `semantic:term` round-trips via DefinitionList, `semantic:measurement` via Span attributes. `semantic:bibliography` and `semantic:glossary` are skipped as they have no direct Pandoc equivalent.
375-
- **Inline marks**: formatting, links, math, citations, footnotes, entity URIs, and academic cross-references all survive round-trip.
375+
- **Semantic blocks**: `semantic:term` round-trips via DefinitionList, `measurement` via Span attributes. `semantic:bibliography` and `semantic:glossary` are skipped as they have no direct Pandoc equivalent.
376+
- **Inline marks**: formatting, links, math, `semantic:citation`, footnotes, `semantic:entity` URIs, `semantic:glossary` references, and `academic:*-ref` cross-references all survive round-trip.
376377

377378
## Related Projects
378379

0 commit comments

Comments
 (0)