Skip to content

Releases

docrs 1.0.1

Choose a tag to compare

@github-actions github-actions released this 23 Nov 04:30
9882b0a

Library

  • Ballot boxes (☐ U+2610, ☑ U+2611, ☒ U+2612) in converted text, task list boxes included, are set in MS Gothic, the font Word gives its own checkbox content controls. Each run of boxes is a run of its own with the surrounding text's bold, colour, size and other properties, and <w:rFonts w:ascii="MS Gothic" w:eastAsia="MS Gothic" w:hAnsi="MS Gothic" w:cs="MS Gothic" w:hint="eastAsia"/> in place of any font the editor set; the text around the boxes, the space after one included, keeps its own runs. A template whose theme fonts were Arial with no East Asian or complex script font and whose complex script language was Arabic left Word to find a box Arial lacks: Word for Windows drew some of them as an Arabic glyph and a wide gap, varying between lines with identical XML. Contents page estimates measure the boxes in MS Gothic instead of substituting Calibri and warning font_metrics_missing, and a template that names MS Gothic for its text is measured rather than substituted.

docrs 1.0.0

Choose a tag to compare

@github-actions github-actions released this 16 Nov 11:40
1436681

The first stable release. The library, the command line and the Node.js package follow semantic versioning from here on. Nothing is removed: fromTiptap and from-markdown --from still work.

Library

  • A header or footer left behind by set_linked_to_previous(true) is no longer searched or edited. find_text and replace_all went on finding text in it until the document was saved and reopened. Which parts the document reaches is now worked out again whenever an edit adds or removes a part or changes a relationship.
  • Page estimates no longer count a nested field's result as visible text while the field around it is still in its code. { IF { MERGEFIELD … } … } measured the inner result, which moved the page numbers a table of contents estimates.
  • A role that fails no longer hides another role whose name starts the same way. A failed table_caption made markdown-styles report table missing with Table Grid present, and a failed definition_term did the same to definition.
  • Every table of contents in one document gets page numbers and the front matter's toc-depth. With front-matter toc and a [TOC] both present, the first contents kept "1" for every page, and the [TOC] one ignored toc-depth and did not ask Word to update fields.
  • TOML front matter reads top-level keys only up to the first table header, so a title under [params] no longer replaces the document's title. A multi-line array or """ string is read whole, so a [ inside one does not start a table. Arrays skip comments and escaped quotes, and multi-line basic strings decode their escapes.
  • HTML elements whose end tag is left out close the way the HTML standard says, each tag closing only up to the scope it belongs to. Before, <tr><td>a<tr><td>b lost a row, a second <td> nested inside the first, <li><p>one<li> made a sub-item, and <p>x<blockquote>… left the quote empty. Well-formed HTML converts as before.
  • A > inside a quoted HTML attribute value, as in title="x > y", no longer ends the tag.
  • When a span sets background-color more than once, the last value is its highlight, as CSS has it. Before, the first one won. TipTap output is unchanged.
  • The refusal to edit a protected document says how to acknowledge the protection: --acknowledge-protection on the command line, Document::acknowledge_protection in the library.

Command line

  • replace --nth N --all is refused with argument_conflict (exit 2) and leaves the file untouched, as --placeholder with --append already is. Before, --nth was ignored and every match was replaced.

docrs 0.3.15

Choose a tag to compare

@github-actions github-actions released this 05 Nov 07:48
3638fe8

Library

  • Table cells keep the vertical alignment the template's sample cells set. A template whose header cells were vertically centred lost it, so when one header label wrapped, the others sat at the top of the row. The header cells' w:vAlign now goes into the lifted table style's header row with the fill and borders, and one the body cells share into the whole table.
  • A Table Heading (or Table Header) that none of the template's sample header cells use is passed over, as an unused Body Text or First Paragraph already is. A template that kept a centred Table Heading while its tables' left-aligned header cells wrote in Compact exported centred headers. The header now gets a style created on the style its cells use, with their shared hand look, named "Template Table Heading" when the template already has a "Table Heading".
  • Table cell text looks are read one property at a time. Header text bold and white at two sizes, with some plain, had no look: no single whole look carried the most characters. Bold and white are now lifted, and the size, which no value carries the most text in, is left as it is.

docrs 0.3.14

Choose a tag to compare

@github-actions github-actions released this 04 Nov 06:45
3abf86e

Library

  • Spacing nobody set on the template's sample prose no longer overrides the body style's own. A template whose Body Text sets 3 pt before and 12 pt after, with most of its sample prose in an unstyled Normal that sets no spacing, exported Body Text at 0 pt before and after, so body text looked like Normal. Each spacing attribute (before, after, and the line with its rule) now counts only where the document defaults, the style chain or the paragraph's own formatting sets it; where nobody does, the body style's own value stands, and the template above keeps its 3 pt and 12 pt with nothing lifted. Spacing Normal or hand formatting does set is lifted as before. Word's automatic spacing (beforeAutospacing, afterAutospacing, common in styles from pasted web content) does not count as set: a body style spaced automatically over tight unstyled prose still takes the prose's 0 pt.

docrs 0.3.13

Choose a tag to compare

@github-actions github-actions released this 30 Oct 01:11
e8a1e1e

Node.js

  • fromMarkdown, fromHtml and fromJson take a fields option that fills {{Name}} merge fields once converted, in the body, headers, footers and text boxes: fields: { "Client Name": "Jo Smith", Adviser: "" }. A field Word has split across runs still fills, spaces inside the braces are allowed ({{ Ref }}), {{{Name}}} fills like {{Name}}, a field not named is left as it is, and "" blanks one. A value is text within one paragraph: one with a line break, tab or other control character, {{ or }} is refused (invalid_options, naming the field) whether or not the document holds the field. Under limits: "serverless" the text the fields add, every occurrence counted, is budgeted at 384 KiB (max_field_bytes). The report's new fields gives the replacements made, the names of fields left in the document and any replacement refused; it is null without the option. Contributed by Alex Swan (#30).

docrs 0.3.11

Choose a tag to compare

@github-actions github-actions released this 27 Oct 05:30
b0d9780

Library

  • Table cell text takes the look the template's own sample tables show, header and body rows apart. Body cells go in the paragraph style the template's table body cells write most of their text in, with the hand formatting those cells share lifted onto it, as the body text's is; header cells the same from the header rows, through a new role table_header (candidates "Table Heading" and "Table Header", in markdownStyles, the style map and the CLI like the others). A template whose sample tables put header cells in "Table Header" (bold 10 pt) and body cells in "Table Normal Body" (8 pt) exported every cell in a Table Contents on the body at 10 pt; it now uses the two styles. One with the same look applied by hand in Normal got the bold header through a lifted table style's first row but kept the body cells at 10 pt; it now gets a Table Contents at 8 pt and a Table Heading in bold, both on Normal. The lifted table style now carries only the cells' borders, fill and margins: their text look belongs to the paragraph styles, where every reader applies it and a header size is not overridden by the body's. Header cells whose text shows no look of their own share the body cells' style, so a template whose tables carry no text look of their own gets today's Table Contents alone. inspectReference reports the cell styles and text looks under lifted.table.cell_styles and cell_text.

docrs 0.3.10

Choose a tag to compare

@github-actions github-actions released this 27 Oct 04:04
9dce352

Library

  • Page 1 of the output shows the header and footer the template's page 1 shows. A template with a first section for a cover or letter and a last section for the body pages (19 of 272 production templates in a Word-render review, 13 of them one licensee's) lost its page 1 logo or letterhead: the output took its headers from the last section alone. The output's single section now shows, on page 1, the first section's first-page header and footer when that section has a distinct first page and its default ones otherwise, and on the other pages the last section's default ones, inherited from earlier sections where the last lacks them, as Word resolves them. When page 1 differs from the other pages the section gets a distinct first page (w:titlePg) carrying page 1's header and footer; when they are the same it has none, and a first-page reference the last section defined is dropped. Page size, margins and orientation still come from the last section. inspectReference reports the resulting section.title_page and headers_footers (a story the last section does not define itself is inherited), and its multiple_sections problem says so.

  • A Body Text style counts as used by the template only when it holds prose, as a First Paragraph does (below): short lines and list items in it do not keep it the body. A template whose Body Text held two short lines and four numbered steps of a closing section while sixteen paragraphs of prose were Normal (Arial 11 pt) exported the body in Body Text at 10 pt; the body now follows the prose to Normal, and inspectReference reports it under roles.body.

  • A List Bullet or List Number style the template never writes in takes the font and size of the template's own bulleted or numbered sample paragraphs, which sit in another style (List Paragraph, or whatever Word's list buttons used), as Word resolves them through the style chain and the defaults: a theme font stays a theme font. A template whose List Bullet was bound to the bullet numbering in the theme's minor font while its bullets were List Paragraph in Arial exported the bullets in the theme font; they are Arial 11 pt now. A list style the template writes in keeps its own font.

  • A heading level the template never uses, whose font still comes from the theme, takes the font the template named on the nearest higher level it does use: a Heading 4 in the theme's major font under Headings 1 to 3 set to Arial follows them (its italic and colour stay). A heading level the template uses, or one with a named font anywhere in its style chain, is left as it is.

  • A First Paragraph style counts as used by the template only when it holds prose, a paragraph of 40 characters or more, as the body look does since 0.3.9; a short sample line such as "First Paragraph.", which templates built from Pandoc's sample reference carry for every style, no longer keeps the style in use. Such a template, whose prose is Body Text, gave the paragraph after each heading the First Paragraph style and so Normal's look; it now takes the body's style, as a template with no First Paragraph text does, and inspectReference reports the body's style under roles.first_paragraph. A First Paragraph holding prose, and a template with no prose at all, are unchanged.

docrs 0.3.9

Choose a tag to compare

@github-actions github-actions released this 27 Oct 02:24
3009ed1

Library

  • A colour lifted from the template's sample text onto an existing style keeps its value beside its theme colour. A heading coloured by hand with <w:color w:val="000000" w:themeColor="text1"/> was lifted onto Heading 1 as <w:color w:themeColor="text1"/>, without the w:val the schema requires, and the Open XML SDK validator rejected the styles part. The sample's attributes still replace the style's one by one, and a font or colour set by name alone still drops the theme attribute Word would otherwise prefer (and a theme font the named font), but an attribute the sample sets itself is never dropped, and w:color always keeps a w:val.

  • Every properties element a conversion copies from a template part is written in schema order, whatever order the template used: the paragraph and run properties lifted from a hand-made heading or from body text, a sample table's cell properties (tcBorders, then shd, then tcMar) and table properties, and the sides of borders and cell margins. A table whose header cells listed w:shd before w:tcBorders, as some editors save it, gave a table style the validator rejected; Word opens either.

  • A First Paragraph style the template defines but never writes text in is passed over: the paragraph after each heading takes the same style as the rest of the body (Body Text, or the default style when that carries the prose), and the template's First Paragraph is left as it is. A template whose prose is Body Text (Arial 10 pt) beside an unused First Paragraph based on Normal exported the first paragraph of every section in the theme font at 12 pt. A First Paragraph the template does use is kept as the template defines it, following the body's look and spacing when it has none of its own (0.3.6, 0.3.7). inspectReference and markdown-inspect report the body's style under roles.first_paragraph for such a template.

  • A body look or spacing is lifted from the template's sample text, and a Body Text or First Paragraph the template writes no text in is passed over, only when the template has prose to go by: paragraphs of 40 characters or more, not letterhead or label lines. A template whose Body Text is defined at 15 pt and whose only text is two short Normal lines in Times 12 pt exported the body in a "Template Body Text" at 12 pt; it now keeps Body Text as the body style, creates nothing, and inspectReference reports lifted.body as null. A letterhead-only template with three short lines in brown Trebuchet over an Arial 10 pt Body Text keeps the Body Text the same way. Prose formatted by hand still lifts its look and spacing (0.3.5 to 0.3.7), and a 6 pt spacer Body Text beside real prose in Normal is still passed over for Normal (0.3.6).

docrs 0.3.8

Choose a tag to compare

@github-actions github-actions released this 27 Oct 00:07
9c146ad

Library

  • inspectReference and markdown-inspect report, and a conversion warns (picture_larger_than_page), when a header or footer the output keeps holds a picture it cannot show whole: an inline picture wider than the page or taller than half of it, an anchored picture wider or taller than the page. The message names the header or footer (the one every page shows, the first-page one or the even-page one) and gives the picture's size and the page's in centimetres, in plain language a practice can act on: resize or remove it in the template. A first-page header holds the cover of templates that have one, so its inline picture is reported only when it does not fit on the page; a page-sized background anchored behind the text, and Word's own watermarks (VML shapes, not measured), are not reported. The output is unchanged: headers and footers are kept as they are. A footer holding a 37.3 by 16.7 cm picture on an A4 page, which Word clips at the page edge while other renderers lay out in full, left both reports silent.

docrs 0.3.7

Choose a tag to compare

@github-actions github-actions released this 26 Oct 09:57
b11f800

Library

  • The body style takes the paragraph spacing the template's prose shows, as it takes the run look: the spacing (before, after, line and its rule, as Word resolves them through the style chain and the document defaults) carrying the most characters of the unstyled paragraphs and of the body style's own paragraphs, when it differs from what the style gives. A Body Text defined as 6 pt after at 1.5 lines whose every paragraph is set by hand to none at single lines now exports at none and single; a template whose prose is Normal at 10 pt after and 1.15 lines while Body Text holds one sample line now spaces the body like the prose. The spacing is written on the style in full (w:spacing before, after, line, lineRule), so nothing inherited shows through. A First Paragraph or Compact style with no spacing of its own follows the body, as it follows the body's look. When the unstyled paragraphs alone show a spacing other than the default style's, the Body Text added for them carries it. The gap a conversion puts above a paragraph after a table or list is unchanged. inspectReference and markdown-inspect report the spacing in lifted.spacing (points before and after; line a multiple of single spacing under the auto rule, else points).