@ai-matrx/print 0.7.1 → 0.8.0

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,54 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.8.0
4
+
5
+ - **Citations through a real CSL processor.** citeproc-js (the engine Zotero
6
+ uses) over the official Citation Style Language styles replaces the three
7
+ hand-written formatters. `csl:` takes any style in the CSL repository by name
8
+ (`apa`, `mla`, `chicago`, `chicago-notes`, `ieee`, `harvard` ship inside the
9
+ package; `nature`, `vancouver`, … are fetched at export time, a dependent
10
+ style follows its parent) or a `.csl` URL. Note styles turn every citation
11
+ into a numbered note; numeric styles number by first use. Locales follow
12
+ `lang`. New `prepareDocument(source, { resolveReferences, cslFetcher })`
13
+ loads what a document needs; `exportDocument` uses it.
14
+ - **Host-resolved references.** `resolveReferences(keys)` receives citation
15
+ keys the frontmatter does not define (e.g. `[@research:<id>]`,
16
+ `[@file:<id>]`) and returns CSL-JSON items. `DocumentPrintPreview` takes the
17
+ same prop.
18
+ - **PDF hyphenation.** Knuth–Liang patterns (the `hyphen` package, ~30
19
+ languages, chosen by `lang`; `hyphenate: false` turns it off) with lines
20
+ broken by the package using the embedded font's own metrics, so every split
21
+ word carries its hyphen. An unsupported language is announced.
22
+ - **Font fallback in PDF.** Characters the body font cannot draw go to Noto
23
+ Emoji (emoji, including skin tones, ZWJ sequences and flags) and then Noto
24
+ Sans Math (arrows, math, box drawing), loaded only when the document needs
25
+ them (`fonts: { emoji, symbols }` loaders; default jsDelivr). Anything no face
26
+ can draw is left out and announced — never an empty box.
27
+ - **Math, typeset in every format.** `$…$`, `$$…$$`, `\(…\)`, `\[…\]` are
28
+ lifted out before markdown parsing by the core's shared rules
29
+ (`@ai-matrx/content-ir/source`: a stray prose `$$` never pairs with a
30
+ formula; `$5` stays money; `\,` survives) and typeset with MathJax: PDF
31
+ display math is drawn as vector SVG and inline math is set as text with real
32
+ super/subscripts; Word gets native editable equations (OMML); HTML and EPUB
33
+ carry MathML (EPUB declares `properties="mathml"`). A formula that does not
34
+ parse is announced (`math-error`) and prints as marked source.
35
+ - **Fixed (PDF, lost content):** a table row taller than a page vanished with
36
+ the header row and no notice. Rows now split when any row cannot fit a page,
37
+ and a **loss guard** checks every PDF: any text pdfmake did not place is
38
+ counted and announced (`content-lost`).
39
+ - **PDF tables:** content-aware column widths (min/max content, like a
40
+ browser's automatic table layout) — a 10-column landscape table fits in 3
41
+ pages instead of 13.
42
+ - **Fixed (EPUB):** footnote back-links point into the chapter holding the
43
+ reference; epubcheck clean (the tests run epubcheck when it is installed).
44
+ - **Fixed:** an author's own heading above `<!-- bibliography -->` is used —
45
+ no second "References" heading.
46
+ - **Breaking:** `formatCitation` / `formatBibliography` are removed (use the
47
+ CSL engine: `CitationEngine`, `prepareDocument`); `DocumentSettings.citationStyle`
48
+ is now a CSL style id string.
49
+ - Consumer action: pass `resolveReferences` where your app has source records;
50
+ nothing else.
51
+
3
52
  ## 0.7.1
4
53
 
5
54
  - **Fixed (PDF):** a heading followed by a table taller than a page vanished
package/README.md CHANGED
@@ -230,6 +230,18 @@ In the body: `<!-- pagebreak -->`, `<!-- section landscape columns=2 -->`,
230
230
  `[[toc]]`, `![Caption](url){#fig:chart}`, `Table: Caption {#tbl:sales}`,
231
231
  `## Methods {#sec:methods}`, `see @fig:chart`, `[@smith2020, p. 4]`.
232
232
  All four formats come from one parsed tree (`parseDocument`), so they agree.
233
+
234
+ Citations are formatted by **citeproc-js** over the official **CSL styles**:
235
+ `csl:` accepts any style name from the CSL repository (zotero.org/styles) or a
236
+ `.csl` URL; `apa`, `mla`, `chicago`, `chicago-notes`, `ieee` and `harvard` are
237
+ bundled (offline). References come from the frontmatter and from your app via
238
+ `exportDocument(md, fmt, { resolveReferences: async (keys) => cslItems })`.
239
+ PDFs are hyphenated with Knuth–Liang patterns for the document's `lang`, and
240
+ emoji / symbols print through Noto Emoji and Noto Sans Math.
241
+
242
+ CSL styles and locales © the Citation Style Language project, CC BY-SA 3.0.
243
+ Noto Emoji and Noto Sans Math are SIL Open Font License fonts (loaded at
244
+ export time from jsDelivr).
233
245
  `DocumentPrintPreview` (in `/react`) shows the real PDF pages with Print and
234
246
  every download.
235
247