@iksnerd/blazon 0.1.0 → 0.1.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.
@@ -5,8 +5,8 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>Brand Book</title>
7
7
  <link rel="icon" href="data:," />
8
- <script type="module" crossorigin src="./assets/index-BdbihVvH.js"></script>
9
- <link rel="stylesheet" crossorigin href="./assets/index-DluSqfla.css">
8
+ <script type="module" crossorigin src="./assets/index-DhSc0Zxv.js"></script>
9
+ <link rel="stylesheet" crossorigin href="./assets/index-D0WCUmtA.css">
10
10
  </head>
11
11
  <body>
12
12
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iksnerd/blazon",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Brand book and design token compiler: DTCG tokens, brand rules checked by blazon check, a static brand book that wears the brand",
5
5
  "type": "module",
6
6
  "bin": {
@@ -17,7 +17,9 @@ A slide whose content is taller than a slide even drawn at half size is cut off
17
17
  | `{ "preset": "reference" }` | `index.html#print/reference` | `brand-book-reference.pdf`, `.pptx` |
18
18
  | `{ "pages": ["doc/logo", "tokens/colors"] }` | `index.html#print/pages=doc/logo,tokens/colors` | `brand-book-pages.pdf`, `.pptx` |
19
19
 
20
- Two optional strings go with any of these: `title` (at most 120 characters) replaces the brand title in the cover heading and in the footers, and `subtitle` (at most 200) replaces the line under the cover heading. They reach the page as `?title=...&subtitle=...` after the hash, percent-encoded. Other options are refused.
20
+ Two optional strings go with any of these: `title` (at most 120 characters) replaces the brand title in the cover heading and in the footers, and `subtitle` (at most 200) replaces the line under the cover heading. They reach the page as `?title=...&subtitle=...` after the hash, percent-encoded.
21
+
22
+ One more option, `layout`, is `"compact"` (the default) or `"roomy"`. `compact` lets a figure share a slide by drawing its pictures down to 60% of their height, and sets the prose and sections tighter, so the book runs on fewer slides. `roomy` draws every picture whole and sets the text looser. Only `roomy` is put in the hash, as `layout=roomy`, and the page says which layout it used in `window.__blazonPrint.layout`. Any other value, and any other option, is refused.
21
23
 
22
24
  It exits `2` with the reason and writes nothing when the request or its options are wrong, when `site_dir` has no `index.html`, when it finds no browser, and when the page does not say it is ready in time.
23
25
 
@@ -9007,8 +9007,11 @@ var OPTIONS = [
9007
9007
  "preset",
9008
9008
  "pages",
9009
9009
  "title",
9010
- "subtitle"
9010
+ "subtitle",
9011
+ "layout"
9011
9012
  ];
9013
+ /** The layouts the viewer's print page spaces a book in; the first is the default and is not put in the hash */
9014
+ var LAYOUTS = ["compact", "roomy"];
9012
9015
  /** The longest title and subtitle: the cover sets the title at 96 px and the footer has one line */
9013
9016
  var LIMITS = {
9014
9017
  title: 120,
@@ -9033,6 +9036,9 @@ function page(options) {
9033
9036
  const value = text(options, key);
9034
9037
  return value === void 0 ? [] : [`${key}=${encodeURIComponent(value)}`];
9035
9038
  });
9039
+ const layout = options.layout;
9040
+ if (layout !== void 0 && (typeof layout !== "string" || !LAYOUTS.includes(layout))) throw new OptionError(`layout must be ${LAYOUTS.join(" or ")}`);
9041
+ if (layout !== void 0 && layout !== LAYOUTS[0]) query.push(`layout=${layout}`);
9036
9042
  return query.length === 0 ? chosen : {
9037
9043
  ...chosen,
9038
9044
  hash: `${chosen.hash}?${query.join("&")}`
@@ -61,7 +61,7 @@
61
61
  "kind": "tree",
62
62
  "path": "blazon.print-book",
63
63
  "entry": "bin/blazon-blazon.print-book.🔌",
64
- "digest": "t1:c14c7208420d47e8f4875a727b59c687120f8453ad7a96e5a6ac9059e2f0ade7",
64
+ "digest": "t1:61ab8d3a0bd5dadd04b6557271bb96d3e9578cc79938b09de777c0e498d89b08",
65
65
  "source": "computed"
66
66
  },
67
67
  "blazon.social-cards": {
@@ -28,7 +28,7 @@ The brand and the build come from the same files. A build that breaks the brand'
28
28
  | Readable from any language | `blazon build` also writes `brand.json`: the tokens with their rules, the pages, the assets and the findings, with a JSON Schema. |
29
29
  | Open to plugins | A plugin is a program in any language. blazon ships ten, and a config names one to turn it on. |
30
30
 
31
- blazon is pre-release (0.1.0) and not on npm yet. The attributes above describe what is built today.
31
+ blazon is at version 0.1.0 and on npm as `@iksnerd/blazon`. The attributes above describe what is built today.
32
32
 
33
33
  ## Exposed structure
34
34