1.0.2: converter searches no subfolders, safer filters, forms, links and watermark
A document at the root of a checkout of 68377 folders needed 56 minutes, because the converter named the suite, the document folder and the build folder with `//` in TEXINPUTS; it now names them without recursion and the same document converts in 11.5 seconds. A file below the document no longer replaces a package of TeX Live. The security review of the pending changes found four defects, each fixed with a test proven red against the old files and green against the new ones twice: an HTML table read in an empty sandbox, so an iframe opens no address; form labels written through the LaTeX writer, so they are set as text; the form pattern scans a line once instead of quadratically; a kept build folder no longer lays the links of an earlier drawing over a new one. The form tests remove the PDF of an earlier run before each conversion. Also carried: forms out of Markdown, link colours from the company, clickable links in prose, HTML tables and SVG drawings, the watermark, and the further changes of 1.0.1 and 1.0.2 in the CHANGELOG. npm test: 1232 of 1232 checks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
adc58e19d7
commit
d7aac52ac7
28 files changed
+3918
-137
No files matched your search
+39
-5
@@ -14,6 +14,7 @@ The writer wants his document to look like his company without setting anything.
|
||||
- **F1.4** `success` and `fail` are roles outside the palette, with defaults of their own.
|
||||
- **F1.5** The company calls fontspec itself and declares the default family, the emphasis face, the symbol family and whether its face has small capitals; the encoding travels with the family.
|
||||
- **F1.6** A document may override the name, the address, the URL and the logo of its company as a package option.
|
||||
- **F1.9** `\businesslinks` says what a link looks like: `colour` and `external` name the roles a link and an outgoing address stand in, `underline` draws the line a browser draws by default. A company takes both from the stylesheet of its own website; one that sets nothing keeps a link in the colour of the text and without a frame.
|
||||
|
||||
## F2 The logo
|
||||
|
||||
@@ -22,6 +23,7 @@ The writer wants the logo of his company wherever he needs it, in the form that
|
||||
- **F2.1** `\logo` sets the logo; `\businesslogo` is the same command where another package owns the short name.
|
||||
- **F2.2** Forms: the lockup, the icon alone, the name alone, and each of them with the address line under it and with or without the link.
|
||||
- **F2.3** Formats: PDF, EPS, PNG and JPEG are resolved from a name without an extension.
|
||||
- **F2.16** A logo the company has as an SVG: `bin/logo.py` converts every SVG of a directory into a PDF of the same name beside it, and `--check` names every PDF that is missing or older than its SVG. A build that finds a logo as an SVG alone stops with the command that converts it.
|
||||
- **F2.4** A company that draws its logo hands over a command instead of a file; the colour the caller asked for reaches the drawing.
|
||||
- **F2.5** Without a height the lockup stands at 1.25em, the height at which the name beside the icon is the size of the running text it stands in.
|
||||
- **F2.6** The address line is as wide as the logo above it, at every height and for every address.
|
||||
@@ -52,6 +54,9 @@ The writer wants a reader to know where he is, on every page.
|
||||
- **F3.11** Between the lower edge of the head and the upper edge of the text stands exactly one line of the body text, and the same line between the lower edge of the text and the upper edge of the foot, whatever the head and the foot carry.
|
||||
- **F3.13** The page reserves the room for the head again whenever the company changes what stands in it, so an identity declared after the template was loaded still fits.
|
||||
- **F3.12** The first line of a page begins at the upper edge of the text block, so the distance under the head is the line it is defined as and not a line and a bit.
|
||||
- **F3.14** The body text of a document stands in the text role of the company, never in the pure black LaTeX starts with.
|
||||
- **F3.15** The rules of a table stand in the text role of the company, and the line between two rows in the row-rule role.
|
||||
- **F3.16** The logo takes as much of the head as its block measures and the running head takes the rest, at any length of name, tagline and address. A block that would take more than three quarters of the line is set at the height at which it fits and keeps its proportions.
|
||||
|
||||
## F4 The title block
|
||||
|
||||
@@ -67,7 +72,7 @@ The writer wants a reader to know where he is, on every page.
|
||||
- **F5.10** A heading directly under a heading reserves nothing of its own and takes over the room of the one above it, so the page never breaks between two headings.
|
||||
- **F5.4** A heading followed by a table reserves what that table measures at itself, written into the aux file and read back on the next run.
|
||||
- **F5.5** A sentence that announces a table or a list is held to it with `\businessleadin` and `\businesstogether`.
|
||||
- **F5.6** Every level a converter can produce takes the reservation, the fourth and the fifth included.
|
||||
- **F5.6** Every level a converter can produce takes the reservation, the fourth and the fifth included. Those two keep the run-in shape their class gives them, so a `####` out of Markdown opens its paragraph as it does in every document these companies have written.
|
||||
- **F5.7** A single line of a paragraph never stands alone at a page break.
|
||||
- **F5.8** A paragraph whose line fits nowhere may stretch its spaces by one em rather than let a word stand outside the page.
|
||||
- **F5.9** The right edge of a paragraph stands on the margin; punctuation hangs into it only where a company asks for that.
|
||||
@@ -78,10 +83,10 @@ The writer wants a reader to know where he is, on every page.
|
||||
- **F6.1** `\businesstablehead` marks a head cell, `\businessrowrule` draws the line between two rows.
|
||||
- **F6.2** A table that runs over a page break leaves no error in the build log.
|
||||
- **F6.9** The room over and under a rule of a table follows the face the company set, not the one LaTeX starts with.
|
||||
- **F6.3** A picture goes where it fits and carries its caption under it without a number.
|
||||
- **F6.3** A picture goes where it fits and carries its caption under it without a number, centred under the picture over one line and over several.
|
||||
- **F6.5** `\businessgraphic` sets a picture at the size of the family: upright the full width of the line and at most half the text height, lying the full free height of the page and at most the full width, both centred and in proportion. A picture given a size of its own keeps it.
|
||||
- **F6.6** A raster picture is enlarged at most twice over; a drawing as far as the rules allow.
|
||||
- **F6.7** A picture that would leave more than a quarter of the page empty is made small enough to stand on it.
|
||||
- **F6.7** A picture that would leave more than a quarter of the page empty is made small enough to stand on it, together with its caption. Where less than a quarter is left, the picture moves to the next page at its full size, a lying one too, and the room it leaves stays empty at the foot of the page instead of being spread over its spaces.
|
||||
- **F6.8** The six shares of a picture are options of the template.
|
||||
- **F6.4** A picture directly under a heading does not float away from it.
|
||||
|
||||
@@ -115,6 +120,7 @@ The writer wants a reader to know where he is, on every page.
|
||||
- **F10.3** The colours are the same roles the document and the letter read.
|
||||
- **F10.4** The title slide carries the logo unless the deck puts a picture of its own there.
|
||||
- **F10.5** `titleprefix`, `canvas` and `nosectionframe` are the options a company sets.
|
||||
- **F10.6** The ground of a slide runs from one colour at the top to another at the bottom, with the text in a colour of its own, and the sidebar the same, each where the company names the roles; a deck may name them in its own preamble. A company that names none keeps a white slide and the sidebar in its brand colour.
|
||||
|
||||
## F11 Markdown to PDF
|
||||
|
||||
@@ -122,16 +128,44 @@ The writer wants a reader to know where he is, on every page.
|
||||
- **F11.2** The design is the template: pandoc gets two lines of preamble and nothing else.
|
||||
- **F11.3** The column widths of a table are computed from a line width and a character width measured in a probe document with the identity of the company.
|
||||
- **F11.4** A table wider than the line gets relative column widths and, where the words do not fit side by side, one step of a smaller face.
|
||||
- **F11.5** A path or an identifier in the running text breaks where a reader reads a boundary, without a hyphen.
|
||||
- **F11.6** A picture alone in its paragraph gets its caption under it; an SVG is converted before the LaTeX run.
|
||||
- **F11.5** A path or an identifier in the running text breaks where a reader reads a boundary, without a hyphen, whatever its length; the characters it begins with stay with it.
|
||||
- **F11.17** A link drawn inside an SVG keeps its destination in the PDF: the places its links cover are laid over the converted picture as annotations of the page.
|
||||
- **F11.6** A picture alone in its paragraph gets its caption under it, a photograph as well as a drawing; an SVG is converted before the LaTeX run.
|
||||
- **F11.7** A `<details>` block is left out, its summary line included.
|
||||
- **F11.8** A link to a Markdown file of the same set points at the PDF of that file.
|
||||
- **F11.9** The language is read off the text where the document names none.
|
||||
- **F11.10** A sentence that announces a table gets its reservation from the converter.
|
||||
- **F11.11** The PDF is written beside its source; what the build produced is thrown away unless `--keep-tex` says otherwise.
|
||||
- **F11.13** A document out of Markdown is the document out of LaTeX: the same content stands in the same places on the page.
|
||||
- **F11.14** A document cannot run code on the machine that converts it: a `latexmkrc` in its directory is not read, and neither the probe nor the build lets LaTeX start a program. An HTML table in it opens no address while it is read.
|
||||
- **F11.15** Two drawings of the same file name in two folders stay two drawings, and a drawing shown twice is converted once.
|
||||
- **F11.16** A company whose identity lies outside the TeX tree names its directory in `TEXINPUTS`, and the converter searches it after the suite and before the document directory, so a file beside a document cannot replace the identity. The converter searches no folder below the document or the suite, so a document converts in the same time wherever it lies, and no file below it replaces a package of the TeX tree.
|
||||
- **F11.17** Links in prose, HTML tables and SVG drawings remain clickable in the finished PDF and reach the named definition in that document; merged cells of an HTML table remain merged.
|
||||
- **F11.12** A formula arrives as a formula, in a sentence and on a line of its own, also written over several lines: such a block is joined into one line before the reader sees it, and the converter reports how many it joined. Inside a fenced code block nothing is touched.
|
||||
|
||||
## F14 Watermark
|
||||
|
||||
The writer hands out a page that is not the final one.
|
||||
|
||||
- **F14.1** `\businesswatermark{DRAFT}` in the preamble lays one word across every page, and the options `draft` and `watermark=<word>` do the same from the `\usepackage` line.
|
||||
- **F14.2** The word is set in the `watermark` colour role, light enough to read the page through it; a company that wants it louder or quieter sets that role.
|
||||
- **F14.3** It lies along the diagonal of the paper in use and is made as large as that sheet carries, so a long word and a short one both stay on the page, at every paper size and in both orientations.
|
||||
- **F14.4** The identity carries it, not the page, so a letter and a deck take it as a document does.
|
||||
|
||||
## F13 Forms
|
||||
|
||||
The writer wants an answer back from somebody who has only a reader.
|
||||
|
||||
- **F13.1** A checklist becomes a form of the PDF: the reader ticks the boxes, types the entries and saves the file, in Acrobat, Preview, Firefox and Chrome.
|
||||
- **F13.2** `\businesscheckbox`, `\businessremark` and `\businessline` set a box, a field of several lines and a field beside its label, in the colours and the sizes of the company; `\businessform` in the preamble opens the form around the body.
|
||||
- **F13.3** Every text field takes several lines and carries no length limit, so an entry longer than the box scrolls instead of ending at the frame.
|
||||
- **F13.4** Out of Markdown the two shapes the platforms already render make the form: a task list item becomes a box, named after the identifier in its bold lead-in, and a paragraph of a label, a colon and underscores becomes a field, named after the item it stands in. The label stands on the page as it is written, whatever characters it carries.
|
||||
- **F13.5** A document that carries neither shape carries no form dictionary and comes out as it did before.
|
||||
- **F13.9** A box, the text beside it and the field under it stand on one page: the room for the whole item is reserved in front of it, and an item that does not fit moves as one thing.
|
||||
- **F13.6** Every field name is unique in the document, and a name is derived from what the writer wrote, so it survives a rewrite of the text around it.
|
||||
- **F13.7** A field that stands alone in its section is the large one at the end of a form: fourteen lines, the free half of a page.
|
||||
- **F13.8** The lines of a signature block begin on one edge, the widest of their labels measured in the type, and each label sits on the middle of its frame.
|
||||
|
||||
## F12 Blocks
|
||||
|
||||
- **F12.1** `businesscolumns` sets cells of equal width side by side, the width measured from the line and the number of columns, the gap one line of the body text.
|
||||
|
||||
Reference in new issue
Block a user