Skip to content

v0.9.0

Latest

Choose a tag to compare

@bbatsov bbatsov released this 02 Jun 10:21
· 26 commits to master since this release

New features

  • Recognise the modern curved-quote syntax "text" (double) and 'text' (single). The delimiters are de-emphasised and the enclosed text is shown as normal text; previously the inner backticks were mis-highlighted as inline monospace.
  • Recognise the icon:target[attrlist] inline macro (e.g. icon:heart[2x]), highlighting the macro name, the icon name/path, and its attribute list like the other inline macros.
  • Recognise the modern block ID shorthand [#id]. The id in a [#id] / [#id.role%opt] block-attribute line is now highlighted like an anchor (adoc-anchor-face), and cross-reference following (adoc-goto-ref-label, M-.) jumps to [#id] block IDs - including the [style#id] form, e.g. [source#id] - not just [[id]] anchors.
  • Highlight checklist items. An unordered list item whose text begins with [ ] (unchecked), [x]/[X], or [*] (checked) now fontifies the checkbox with the new adoc-checkbox-face (inherits font-lock-constant-face).
  • Honour backslash escapes in inline formatting: a backslash before a formatting delimiter (e.g. \*not bold*, \**nor this**, \`nor code`) now de-emphasises the backslash and leaves the escaped span as literal text instead of fontifying it as markup. Previously the unconstrained forms still leaked an inner constrained match (\**x** highlighted x).
  • fill-paragraph (and auto-fill) now preserve AsciiDoc hard line breaks: a line ending in a space and a + is no longer merged with the following line. Filling still joins ordinary soft-wrapped lines and indents list-item continuations.
  • Add region-aware text-styling commands under the C-c C-s prefix, modelled on markdown-mode: adoc-insert-bold (C-c C-s b, *text*), adoc-insert-italic (i, _text_), adoc-insert-monospace (m, `text`), adoc-insert-highlight (h, #text#), adoc-insert-superscript (^, ^text^), adoc-insert-subscript (~, ~text~), and adoc-insert-link (l). Each wraps the active region or the word at point, removes the markup again when it is already wrapped, and inserts an empty pair when there is nothing to wrap.
  • Add outline cycling commands modelled on org-mode and markdown-mode: adoc-cycle (TAB) rotates the visibility of the section subtree at point (folded / child titles / fully shown) when point is on a one-line title, and otherwise indents as usual; adoc-cycle-buffer (S-TAB) rotates the whole buffer between overview, contents, and show-all. Both build on the outline-cycle / outline-cycle-buffer primitives.
  • Add list editing: adoc-promote (M-left) and adoc-demote (M-right) now nest the list item at point one level deeper or shallower (for unordered */- and implicitly-numbered . lists) in addition to acting on section titles, and the new adoc-insert-list-item (M-RET) inserts a sibling item below the current one, keeping its indentation and marker and incrementing the number/letter of explicitly-numbered items.
  • Add adoc-move-list-item-up (M-up) and adoc-move-list-item-down (M-down), which move the list item at point (together with its nested sub-items) past its previous/next sibling, and adoc-renumber-list, which renumbers a contiguous arabic (1.) or alphabetic (a./A.) explicitly-numbered list starting from its first item's value.
  • Add heading navigation commands modelled on markdown-mode and org-mode: adoc-next-visible-heading (C-c C-n), adoc-previous-visible-heading (C-c C-p), adoc-forward-same-level (C-c C-f), adoc-backward-same-level (C-c C-b), and adoc-up-heading (C-c C-u). They understand both one-line (== Title) and two-line (underlined) titles and skip headings hidden by folding. outline-minor-mode is now enabled by default so the folding commands are available out of the box.
  • New adoc-title-scaling defcustom (default t) and adoc-title-scaling-values list let users disable the variable-height title faces or pick their own scale factors. Set the boolean to nil for uniformly-sized headings, or customise the list to control the level-0..5 heights. Mirrors markdown-header-scaling.
  • New adoc-blockquote-face for the body of [quote] and [verse] delimited blocks (inherits font-lock-doc-face); previously the body was left unfontified.
  • New adoc-highlight-face for #text# / ##text## highlighted spans (inherits the standard highlight face); previously these reused adoc-gen-face.
  • New adoc-url-face (inherits font-lock-string-face) for URL targets and standalone URLs / email addresses. Link text inside […] still uses adoc-reference-face. URL targets previously reused adoc-internal-reference-face (for http://…[label] form) or adoc-reference-face (for bare URLs), conflating link text and link target.
  • New adoc-metadata-key-face (inherits font-lock-variable-name-face) and adoc-metadata-value-face (inherits font-lock-string-face) for document attribute entries like :author: Bozhidar Batsov. Previously the key used adoc-meta-face (the generic markup face) and the value reused adoc-secondary-text-face; both now have dedicated semantic faces.
  • New adoc-footnote-marker-face (inherits adoc-command-face) and adoc-footnote-text-face (inherits font-lock-comment-face) for footnote:[…] and footnoteref:[…] macros. The marker name (footnote, footnoteref) previously reused the generic adoc-command-face and the body text reused adoc-secondary-text-face.
  • New adoc-strike-through-face, adoc-underline-face, adoc-overline-face, and an adoc-role-face-alist defcustom. [.line-through]#text#, [.underline]#text#, and [.overline]#text# (plus the legacy [role]#text# and [role#id]#text# shapes, and combinations like [.line-through]*bold*) now fontify the span with the matching role face layered on top of the surrounding quote's default face. Add entries to adoc-role-face-alist to fontify custom roles defined in your stylesheet.

Changes

  • Bring the AsciiDoc menu and tempo templates in line with modern AsciiDoc. The deprecated AsciiDoc.py curved-quote templates `text' and text'' are replaced by the modern "text" and 'text' ones (`adoc-double-curved-quote` / `adoc-single-curved-quote`); text `` is labelled simply "Monospaced"; and the +text+ / `++text++` templates are relabelled as passthroughs rather than monospace. This also fixes three menu entries that referenced non-existent templates (`tempo-template-adoc-monospace`, `tempo-template-monospace-literal`, and `tempo-template-pass-$$`), which previously errored when invoked.
  • Title promotion and demotion move to M-left and M-right (org-style), freeing up C-c C-p and C-c C-d for the new heading-navigation commands. Previously adoc-promote lived on C-c C-p and adoc-demote on C-c C-d.
  • adoc-gen-face, adoc-verbatim-face, adoc-secondary-text-face, and adoc-replacement-face now inherit from font-lock-* faces instead of hardcoding literal colours. Themes that style the font-lock palette will now style AsciiDoc buffers consistently. Users who relied on the old defaults can restore them via M-x customize-face.
  • Simplify adoc-meta-face to (:inherit shadow :slant normal :weight normal) instead of overriding eleven attributes including :family "Monospace". AsciiDoc markup characters now respect the user's font choices and theme shadow colour rather than being forced into a monospace family with hardcoded grays.
  • Drop the dated 3D button decoration (:box (:style released-button)) and hardcoded hex colours from adoc-command-face and adoc-complex-replacement-face; inherit from font-lock-builtin-face instead.
  • adoc-meta-hide-face no longer hardcodes gray75/gray25 foregrounds; it simply inherits from adoc-meta-face so the colour tracks the theme. Customise the face if you want hidden markup to fade further into the background.
  • Drop the self-referencing (defvar adoc-X-face 'adoc-X-face) boilerplate and the adoc-delimiter / adoc-hide-delimiter aliases. Font-lock keyword specs now quote face symbols directly. No user-visible change; this is purely an internal cleanup.
  • adoc-show-version is now a deprecated alias for adoc-mode-version, which is itself the interactive command (still also a defconst carrying the version string). The previous defalias 'adoc-mode-version → adoc-show-version indirection is gone.
  • adoc-default-title-type and adoc-default-title-sub-type now use a choice widget restricted to 1 or 2, replacing the open-ended integer type that allowed nonsensical values.
  • Internal cleanup: (adoc-calc) runs from the mode initialization function rather than at file load. (require 'adoc-mode-tempo) and (require 'compile) moved to the top of the file. Dead (boundp …) guards around the compilation-error-regexp-alist integration removed. Stale ;; TODO comments cleaned up. No user-visible change.

Bugs fixed

  • #65: Image previews now resolve attribute references in the image path (e.g. image:{my-badge}[]) against the document's :name: value attribute entries before displaying the image.
  • +text+ and ++text++ are no longer highlighted as monospace. In modern AsciiDoc the backtick is the only monospace delimiter; the single and double plus are inline passthroughs (constrained and unconstrained), rendered as normal text with inline formatting suppressed. They are now fontified as passthroughs - the delimiters are de-emphasised and the enclosed text keeps the default face with formatting suppressed - rather than reusing the monospace face left over from the old AsciiDoc.py "compat-mode" syntax.
  • Recognize level-5 section titles (====== Title). Previously adoc-title-max-level was off by one, so the deepest heading level supported by AsciiDoc was treated as ordinary text. Title promotion/demotion now cycles through all six one-line levels and the five two-line levels independently.