Skip to content

2.4.0

Latest

Choose a tag to compare

@odrobnik odrobnik released this 09 Oct 08:55
15e176a

Alert boxes (> [!NOTE], > [!WARNING], Obsidian and DocC asides) now render the same in HTML, EPUB, PDF, Pages and DOCX, take their colours from your CSS everywhere, and round-trip back to Markdown. Zip containers get readable file permissions.

Alerts in every format

  • One alert model for every writer (#114). MarkdownAlertBlock detects GitHub [!KIND], Obsidian custom titles and kinds, and DocC Kind: asides. Text after [!KIND] is now the box's title, as in Obsidian. MarkdownAlertPalette and MarkdownAlertLayout generate the HTML, PDF and EPUB styles. The EPUB stylesheet now styles the boxes.
  • Pages: native Borders & Rules boxes with one style variation per kind, spaced like the CSS (#114). A box that opens a page keeps its top padding (#117). Block quotes read back as > and rules are real bottom-border paragraphs that read back as --- (#114).
  • DOCX: boxes are paragraph borders and shading on a "Callout KIND" style pair rather than text boxes, so they split across pages and stay editable text (#114).
  • Colours from CSS (#116). MarkdownAlertColors reads .markdown-alert / .markdown-alert-KIND rules with browser-style precedence. MarkdownToPages.convert and MarkdownToDocx.convert take alertColors:, and swifttext render --css passes them through, so one stylesheet colours the boxes in every format.

Fixes

  • Zip entries are rw-r--r-- (#115). Every entry of a .docx or .epub SwiftText wrote had mode 0100000, so unzip extracted unreadable files.

API

  • MarkdownAlertBlock, MarkdownAlertPalette, MarkdownAlertLayout, MarkdownAlertColors, PagesBoxLayout. alertColors: on MarkdownToPages.convert and MarkdownToDocx.convert. DocxWriter.alertColors.