@ai-matrx/print 0.7.1 → 0.8.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.
- package/CHANGELOG.md +58 -0
- package/README.md +12 -0
- package/dist/document.cjs +3014 -291
- package/dist/document.cjs.map +1 -1
- package/dist/document.d.cts +225 -55
- package/dist/document.d.ts +225 -55
- package/dist/document.js +3014 -291
- package/dist/document.js.map +1 -1
- package/dist/react.cjs +4 -4
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +34 -2
- package/dist/react.d.ts +34 -2
- package/dist/react.js +4 -4
- package/dist/react.js.map +1 -1
- package/package.json +14 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,63 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.8.1
|
|
4
|
+
|
|
5
|
+
- **Fixed (Word):** exporting DOCX laid out a whole PDF to number the table of
|
|
6
|
+
contents even when the document has no table of contents; now only with a
|
|
7
|
+
TOC, and a failed measuring pass never fails the export — the TOC lists every
|
|
8
|
+
heading and Word fills in the page numbers on open (`toc-pages-deferred`
|
|
9
|
+
notice).
|
|
10
|
+
- Consumer action: none — refresh to latest.
|
|
11
|
+
|
|
12
|
+
## 0.8.0
|
|
13
|
+
|
|
14
|
+
- **Citations through a real CSL processor.** citeproc-js (the engine Zotero
|
|
15
|
+
uses) over the official Citation Style Language styles replaces the three
|
|
16
|
+
hand-written formatters. `csl:` takes any style in the CSL repository by name
|
|
17
|
+
(`apa`, `mla`, `chicago`, `chicago-notes`, `ieee`, `harvard` ship inside the
|
|
18
|
+
package; `nature`, `vancouver`, … are fetched at export time, a dependent
|
|
19
|
+
style follows its parent) or a `.csl` URL. Note styles turn every citation
|
|
20
|
+
into a numbered note; numeric styles number by first use. Locales follow
|
|
21
|
+
`lang`. New `prepareDocument(source, { resolveReferences, cslFetcher })`
|
|
22
|
+
loads what a document needs; `exportDocument` uses it.
|
|
23
|
+
- **Host-resolved references.** `resolveReferences(keys)` receives citation
|
|
24
|
+
keys the frontmatter does not define (e.g. `[@research:<id>]`,
|
|
25
|
+
`[@file:<id>]`) and returns CSL-JSON items. `DocumentPrintPreview` takes the
|
|
26
|
+
same prop.
|
|
27
|
+
- **PDF hyphenation.** Knuth–Liang patterns (the `hyphen` package, ~30
|
|
28
|
+
languages, chosen by `lang`; `hyphenate: false` turns it off) with lines
|
|
29
|
+
broken by the package using the embedded font's own metrics, so every split
|
|
30
|
+
word carries its hyphen. An unsupported language is announced.
|
|
31
|
+
- **Font fallback in PDF.** Characters the body font cannot draw go to Noto
|
|
32
|
+
Emoji (emoji, including skin tones, ZWJ sequences and flags) and then Noto
|
|
33
|
+
Sans Math (arrows, math, box drawing), loaded only when the document needs
|
|
34
|
+
them (`fonts: { emoji, symbols }` loaders; default jsDelivr). Anything no face
|
|
35
|
+
can draw is left out and announced — never an empty box.
|
|
36
|
+
- **Math, typeset in every format.** `$…$`, `$$…$$`, `\(…\)`, `\[…\]` are
|
|
37
|
+
lifted out before markdown parsing by the core's shared rules
|
|
38
|
+
(`@ai-matrx/content-ir/source`: a stray prose `$$` never pairs with a
|
|
39
|
+
formula; `$5` stays money; `\,` survives) and typeset with MathJax: PDF
|
|
40
|
+
display math is drawn as vector SVG and inline math is set as text with real
|
|
41
|
+
super/subscripts; Word gets native editable equations (OMML); HTML and EPUB
|
|
42
|
+
carry MathML (EPUB declares `properties="mathml"`). A formula that does not
|
|
43
|
+
parse is announced (`math-error`) and prints as marked source.
|
|
44
|
+
- **Fixed (PDF, lost content):** a table row taller than a page vanished with
|
|
45
|
+
the header row and no notice. Rows now split when any row cannot fit a page,
|
|
46
|
+
and a **loss guard** checks every PDF: any text pdfmake did not place is
|
|
47
|
+
counted and announced (`content-lost`).
|
|
48
|
+
- **PDF tables:** content-aware column widths (min/max content, like a
|
|
49
|
+
browser's automatic table layout) — a 10-column landscape table fits in 3
|
|
50
|
+
pages instead of 13.
|
|
51
|
+
- **Fixed (EPUB):** footnote back-links point into the chapter holding the
|
|
52
|
+
reference; epubcheck clean (the tests run epubcheck when it is installed).
|
|
53
|
+
- **Fixed:** an author's own heading above `<!-- bibliography -->` is used —
|
|
54
|
+
no second "References" heading.
|
|
55
|
+
- **Breaking:** `formatCitation` / `formatBibliography` are removed (use the
|
|
56
|
+
CSL engine: `CitationEngine`, `prepareDocument`); `DocumentSettings.citationStyle`
|
|
57
|
+
is now a CSL style id string.
|
|
58
|
+
- Consumer action: pass `resolveReferences` where your app has source records;
|
|
59
|
+
nothing else.
|
|
60
|
+
|
|
3
61
|
## 0.7.1
|
|
4
62
|
|
|
5
63
|
- **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]]`, `{#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
|
|