@neo4j-antora/pdf-generator 0.1.1 → 0.1.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neo4j-antora/pdf-generator",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Generates a PDF export from an Antora docset, styled to match the real Neo4j docs site, via @antora/assembler + @antora/pdf-extension and asciidoctor-web-pdf",
5
5
  "main": "extension.js",
6
6
  "files": [
@@ -232,13 +232,28 @@ tr { break-inside: avoid; }
232
232
  /* admonitions */
233
233
  .admonitionblock { break-inside: avoid-page; margin: 1em 0; }
234
234
  .admonitionblock table { width: 100%; border: none; }
235
+ /* Asciidoctor renders an admonition as a table (icon cell + content cell). Laid out as a
236
+ real table, a content table (or anything else with a footnote) inside it is a table
237
+ nested in a table, and Vivliostyle then never finishes paginating a floated footnote in
238
+ there - the build waits out the 180 s rendering timeout and produces no PDF at all.
239
+ Only the content cell is shown (the icon cell is hidden below), so lay the admonition
240
+ out as plain blocks instead. */
241
+ .admonitionblock > table,
242
+ .admonitionblock > table > tbody,
243
+ .admonitionblock > table > tbody > tr,
244
+ .admonitionblock td.content { display: block; }
235
245
  .admonitionblock td.icon { display: none; }
236
246
  .admonitionblock td.content {
237
247
  border-left: 3pt solid var(--brand-border-strong);
238
248
  padding: 6pt 10pt;
239
249
  background: var(--brand-bg-strong);
240
250
  }
241
- .admonitionblock .title {
251
+ /* Style only the admonition's own title (a direct child of its content cell), not every
252
+ `.title` inside it. A table in an admonition has its caption as `caption.title`; with
253
+ these rules applied to it, the caption was made `display: block` (so it was laid out
254
+ after the header row instead of above it) and shown in capitals and the admonition
255
+ colour. */
256
+ .admonitionblock td.content > .title {
242
257
  font-weight: 700;
243
258
  text-transform: uppercase;
244
259
  font-size: 8.5pt;
@@ -252,20 +267,20 @@ tr { break-inside: avoid; }
252
267
  border-left-color: var(--brand-warning);
253
268
  background: var(--brand-warning-bg);
254
269
  }
255
- .admonitionblock.warning .title,
256
- .admonitionblock.caution .title { color: var(--brand-warning); }
270
+ .admonitionblock.warning td.content > .title,
271
+ .admonitionblock.caution td.content > .title { color: var(--brand-warning); }
257
272
  .admonitionblock.important td.content {
258
273
  border-left-color: var(--brand-danger);
259
274
  background: var(--brand-danger-bg);
260
275
  }
261
- .admonitionblock.important .title { color: var(--brand-danger); }
276
+ .admonitionblock.important td.content > .title { color: var(--brand-danger); }
262
277
  .admonitionblock.note td.content,
263
278
  .admonitionblock.tip td.content {
264
279
  border-left-color: var(--brand-primary);
265
280
  background: var(--brand-primary-weak);
266
281
  }
267
- .admonitionblock.note .title,
268
- .admonitionblock.tip .title { color: var(--brand-primary-strong); }
282
+ .admonitionblock.note td.content > .title,
283
+ .admonitionblock.tip td.content > .title { color: var(--brand-primary-strong); }
269
284
 
270
285
  /* lists */
271
286
  .ulist, .olist, .dlist { margin: 0.5em 0; }
@@ -284,6 +299,16 @@ span.footnote {
284
299
  float: footnote;
285
300
  }
286
301
 
302
+ /* A footnote inside a table that is itself inside a table cell (an `a|` cell holding a
303
+ table) cannot be floated either: Vivliostyle never finishes paginating it, and the build
304
+ times out with no PDF. Leave such a footnote in place instead - its text then appears
305
+ in the cell rather than as a numbered note at the foot of the page, which is a poorer
306
+ result but a PDF. Admonition tables are not affected (they are laid out as blocks
307
+ above and their footnotes float normally). */
308
+ table.tableblock table span.footnote {
309
+ float: none;
310
+ }
311
+
287
312
  [data-footnote-call]::after {
288
313
  content: "[" counter(footnote) "]";
289
314
  }