Skip to content
CAI
Software that uses CAICheck a score

asciidoctor/asciidoctor-pdf

62.3

Adequate · 6 November 2026

10.5k

lines of production code

Ruby

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Features

Add default Rouge syntax highlighting theme for Asciidoctor PDF

A new default syntax highlighting theme, AsciidoctorPDFDefault, has been introduced for code blocks rendered by Asciidoctor PDF. Based on the Pygments pastie style, this theme customizes token colors and styles (such as comments, keywords, and strings) to ensure readability within the PDF output, including a specific guard to handle the Comment::PreprocFile token only when defined by the Rouge library.

lib/asciidoctor/pdf/ext/rouge/themes · high confidence

Automate releases and configure code coverage

The project now includes a \release.sh\ script and supporting Rake tasks to automate the release process, including version bumping, gem building, pushing to RubyGems, and creating GitHub releases. Additionally, code coverage is now configured using DeepCover (with SimpleCov as a fallback), excluding the generated parser from reports, and the WORKLOG has been removed in favor of issue tracking.

(repo-wide) · high confidence

New RuboCop cop to prevent debug flags in to\_pdf calls

A new custom RuboCop cop (RSpec::ToPDFNoDebug) has been added to automatically detect and flag calls to the \to\_pdf\ function that include a \debug: true\ option. This change helps ensure that debug flags are not accidentally left in the codebase, enforcing cleaner output generation during testing or production runs.

cops · high confidence

New utility and build scripts for font processing and dependency management

This change introduces several new scripts to the project. The \scripts/subset-fonts.sh\ and \scripts/subset-fonts.pe\ files provide a new workflow for generating subsetted fonts using FontForge, with support for running the process in a container via Podman or Docker (defined in \scripts/Dockerfile.fontforge\). Additionally, \scripts/switch-to-asciidoctor-head.rb\ and \scripts/switch-to-prawn-head.rb\ are added to allow developers to easily switch the installed versions of the Asciidoctor and Prawn gems to their upstream development branches for testing. A helper script \scripts/decode-pdf-string\ is also included for debugging PDF string encoding, and \scripts/generate-arrange-block-reference-files.sh\ automates the generation of reference files for arrange block tests.

scripts · high confidence

Removals

Removal of legacy Prawn-based PDF converter and syntax highlighting

The \lib/asciidoctor/prawn\ directory has been removed, eliminating the legacy Prawn-based PDF converter and its associated components. This includes the deletion of the \CodeRayEncoder\ (removing CodeRay-based syntax highlighting), the \Extensions\ module (removing custom Prawn page, font, and layout helpers), and the \FormattedText\ parser and transformer (removing the custom HTML-to-Prawn text formatting logic). Users relying on this specific converter implementation will no longer have access to these features.

lib/asciidoctor/prawn · high confidence

Architecture

Modularized build and release tasks into dedicated Rake files

The monolithic build configuration has been split into individual Rake task files (bundler, clean, console, rspec, rubocop, yard) and specialized Ruby scripts for release management (postversion, release-line, release-notes, version). This change improves maintainability by isolating concerns: linting, testing, documentation generation, and the complex logic for updating version numbers, changelogs, and Antora metadata are now handled by specific, reusable components rather than a single large file.

tasks · high confidence

Refactor PDF rendering engine and introduce theme data abstraction

The PDF generation logic has been restructured: the main renderer class has been moved and renamed to lib/asciidoctor/pdf/ext/prawn/extensions.rb, where it now functions as a Prawn extension module rather than a standalone document class. A new ThemeData class has been added to manage theme properties via a symbol-keyed table, and a QuantifiableStdout wrapper has been introduced to accurately measure the byte size of content written to standard output. Additionally, a FragmentPositionRenderer class has been added to track the bounding box and page location of formatted text fragments.

asciidoctor-pdf · high confidence

Behavioural changes

Asciidoctor PDF 3.0.0 alpha release with major refactoring

This release introduces Asciidoctor PDF version 3.0.0.alpha.0, marking a significant architectural shift. The codebase has been reorganized under the \lib/asciidoctor/pdf\ directory, with core components like the converter, index catalog, and theme loader now properly namespaced within the \Asciidoctor::PDF\ module. The \RomanNumeral\ class has been moved into this namespace and refactored to require explicit letter case arguments. Additionally, the gem now includes dedicated scripts (\nogmagick.rb\, \nopngmagick.rb\) to manage image handler conflicts, and the \Optimizer\ module has been updated to support PDF compliance flags (PDF/A and PDF/X) via the built-in optimizer.

lib/asciidoctor/pdf · high confidence

Asciidoctor PDF restructured with new entry point and removed legacy theme loader

The Asciidoctor PDF library has been reorganized to improve modularity and compatibility. A new main entry point at lib/asciidoctor/pdf.rb now handles core dependencies (including Prawn and Asciidoctor) and autoloads standard libraries, replacing the previous structure. The legacy lib/asciidoctor/prawn.rb file and the custom lib/asciidoctor/theme\_loader.rb (which previously handled YAML-based theme loading with variable expansion) have been removed, indicating a shift in how themes and PDF generation extensions are managed within the converter architecture.

lib/asciidoctor · high confidence

Custom AsciiDoc and Text table cell implementations for improved layout control

The PDF renderer now uses custom Prawn table cell classes to handle AsciiDoc content and plain text with greater precision. The new AsciiDoc cell supports inheriting font properties from the table, handles horizontal alignment for paragraph-only cells, and correctly manages footnotes and image sizing within cells. The text cell override improves width calculations by accounting for inline images and hard line breaks, ensuring that table cells fit within their allocated space and preventing content overflow or unwanted page breaks.

lib/asciidoctor/pdf/ext/prawn-table/cell · high confidence

Enhanced SVG handling and image caching in PDF generation

The PDF generator now provides better support for SVG images by passing through warnings to the logger and enabling web requests for URI-based images when configured. It also implements a shared image info cache between primary and scratch documents to avoid decoding the same image multiple times, improving performance. Additionally, a workaround for Prawn's FontMetricCache is included to ensure compatibility with specific Ruby versions, and a new CodeRay encoder is added to support syntax highlighting in code blocks.

lib/asciidoctor/pdf/ext/prawn · high confidence

Enhanced SVG image loading with JPEG support and jail path validation

The Prawn::SVG loaders have been extended to support image/jpg MIME types in data URIs, allowing SVGs to reference base64-encoded JPEG images alongside existing PNG and SVG formats. Additionally, the file loader now validates that referenced image paths remain within the configured jail directory, preventing access to files outside the allowed scope, while the web loader has been refactored to support custom URI openers for remote image fetching.

lib/asciidoctor/pdf/ext/prawn-svg/loaders · high confidence

Enhanced document structure handling and data URI image support

The PDF converter now supports embedding images via data URIs, allowing inline SVG and raster images without external file references. It also improves document structure by promoting preface blocks to proper sections in books and correctly handling unset attributes for part and chapter signifiers. Additionally, new helper methods for navigating block siblings and list nesting levels simplify internal logic, while the \attr\_unspecified?\ method now accurately reflects attributes set or unset via the API or CLI.

lib/asciidoctor/pdf/ext/asciidoctor · high confidence

Enhanced table cell border rendering and CMYK color support

The Prawn table cell extension now supports transparent borders by rendering them with zero opacity, ensuring they do not visually obscure underlying content. It also fixes a crash when table border colors are specified using CMYK values by automatically duplicating the single CMYK color component to all four channels. Additionally, the module prepends a source location attribute to cells, enabling more precise debugging and warning messages for truncated content when the source map is enabled.

lib/asciidoctor/pdf/ext/prawn-table · high confidence

Enhanced text layout, font fallback, and styling in PDF rendering

The PDF text engine now supports more granular control over typography and layout. Users can apply a base color to formatted text blocks via the :color option, and text decoration colors and widths can be customized through themes. Subscript and superscript font sizes are now computed correctly when parent elements use em or percentage units, and relative sizes can be set independently. Line wrapping improvements include preserving soft hyphens when lines advance to the next page, supporting nowrap/nobreak roles, and allowing vertical alignment offsets for headers and footers. The font fallback mechanism is more robust, honoring font styles (bold/italic) when searching for glyphs and suppressing warnings for missing characters in inline images or line feeds. Additionally, the engine now supports indent\_paragraphs for formatted text boxes and protects bottom gutters in decorated blocks.

_lib/asciidoctor/pdf/ext/prawn/formatted\text · high confidence

Implement line highlighting and indentation preservation in Rouge source blocks

The Prawn formatter for Rouge syntax highlighting now supports line highlighting via the \highlight\_lines\ option, applying a background color to specified lines in source blocks. Additionally, indentation is preserved in source blocks even when line numbers are not enabled, and wrapped lines are indented beyond the line number gutter when line numbers are active. The formatter also handles missing glyphs by using a placeholder character to prevent layout issues and supports underline styles in Rouge themes.

lib/asciidoctor/pdf/ext/rouge/formatters · high confidence

Improved AFM font encoding handling and NULL character width enforcement

When rendering text with AFM fonts, characters that cannot be converted to the Windows-1252 encoding are now replaced with specific fallback symbols (such as replacing non-breaking spaces with regular spaces) and a warning is logged if the conversion fails, rather than raising an error. Additionally, the NULL character (code 0) is now explicitly forced to have a width of 0, even if it is missing from the font metrics, ensuring consistent layout behavior.

lib/asciidoctor/pdf/ext/prawn/font · high confidence

Improved column layout handling during page breaks and margin reflows

The PDF generator now better preserves multi-column layouts and indentation when content flows across pages, particularly in index sections or when using the :reflow\_margins option. This change ensures that column structures are correctly restored after page breaks, prevents crashes when margin reflow settings are absent, and maintains proper cursor positioning and padding consistency during document transitions.

lib/asciidoctor/pdf/ext/prawn/document · high confidence

JRuby path resolution fix and PDF serialization helpers

This change introduces a patch for JRuby to correctly handle absolute path detection and resolution, ensuring that relative paths are resolved against a base directory and that absolute paths are identified robustly (excluding URLs). It also adds helper methods to core Ruby classes for PDF generation: Object\#to\_pdf\_object and String\#to\_pdf\_object (which converts ASCII strings to PDF LiteralString objects), and String\#pred for consistent predecessor character/integer generation.

lib/asciidoctor/pdf/ext/core · high confidence

PDF optimizer now supports color mode conversion and respects environment variables

The RGhost PDF optimizer now allows users to specify a color mode (such as grayscale or black-and-white) alongside the quality setting, enabling output conversion to gray or black-and-white PDFs. Additionally, the optimizer honors the GS\_OPTIONS environment variable to pass custom Ghostscript parameters and respects the GS environment variable to specify the Ghostscript executable path, while also patching Ruby 3.2 compatibility by aliasing File.exists?.

lib/asciidoctor/pdf/optimizer · high confidence

Refactor CLI entry points and introduce pluggable PDF optimizer

The \asciidoctor-pdf\ command now delegates to Asciidoctor's standard CLI infrastructure, enabling features like the \--theme\ shorthand and version printing, while the legacy \optimize-pdf\ shell script is replaced by a new Ruby-based \asciidoctor-pdf-optimize\ tool that uses a pluggable optimizer interface (defaulting to RGhost) for PDF optimization.

bin · high confidence

Removal of HTML-specific inline templates

The HTML-specific inline templates for anchors, footnotes, and quoted text have been removed from the data/templates directory. This change aligns with the project's shift to using Asciidoctor PDF as the primary converter, indicating that these HTML rendering rules are no longer maintained or required for the current output format.

data/templates · high confidence

Reorganized PDF extension library into modular require paths

The PDF generation extension library has been restructured to improve modularity and maintainability. The previous flat structure under lib/asciidoctor/pdf/ext has been replaced with a hierarchical organization where specific extensions (such as prawn-svg, prawn-table, prawn-icon, and syntax highlighters like pygments and rouge) are now loaded via dedicated entry-point files (e.g., lib/asciidoctor/pdf/ext/prawn-svg.rb) that in turn require their respective sub-modules (e.g., calculators, loaders, elements). This change simplifies the loading process for users and developers by providing clear entry points for each extension component, while also allowing for more granular control over which parts of the PDF generation engine are loaded. The core functionality remains the same, but the codebase is now better organized for future enhancements and easier to navigate.

lib/asciidoctor/pdf/ext · high confidence

Reorganized formatted text processing into modular components

The formatted text rendering pipeline has been restructured into distinct, single-responsibility modules: a new Formatter orchestrates parsing and transformation, while specialized handlers manage inline image arrangement and rendering, text alignment, background/border drawing, and source block line wrapping. The underlying parser has been upgraded to support a broader set of HTML tags (including button, kbd, mark, and menu), handle void elements generically, and support decimal and hexadecimal character references, providing a more robust foundation for inline text styling and layout.

_lib/asciidoctor/pdf/formatted\text · high confidence

Reorganized source files under asciidoctor/pdf

The library's source files have been reorganized under the asciidoctor/pdf directory structure, with the main entry point lib/asciidoctor-pdf.rb updated to require the new location. This change also enables frozen string literals in the source code.

lib · high confidence

Support for raster images in SVG via prawn-gmagick

The SVG image rendering logic has been updated to delegate raster image handling to the prawn-gmagick library when it is available. This allows Asciidoctor PDF to correctly process SVGs containing raster image references that were previously unsupported, resolving issue \#2223.

lib/asciidoctor/pdf/ext/prawn-svg/elements · high confidence

Updated bundled fonts and added documentation

The bundled M+ monospace fonts have been upgraded to the TESTFLIGHT 63a release, and the Noto Serif and Noto Sans fonts have been regenerated from the 2016-10-22 Fedora RPM package. These font subsets now include expanded character coverage, such as Cyrillic, Greek, Vietnamese, and various mathematical and geometric symbols, along with specific glyphs like the non-breaking hyphen and ballot boxes. To ensure transparency, new ABOUT files have been added to document the source versions and specific processing steps (such as kerning table generation and instruction removal) applied to each font subset, and legacy FontAwesome icon mappings have been consolidated into a new YAML configuration file.

data/fonts · high confidence

Fixes

Add page state tracking and reset capabilities to PDF::Core::Page

The PDF::Core::Page class now includes methods to manage page content state, specifically \tare\_content\_stream\, \empty?\, \imported\, and \reset\_content\. These additions allow the PDF generator to detect when a page is empty, mark pages as imported to suppress running content, and reset page content streams, which helps prevent crashes when handling documents with cover pages and SVG backgrounds.

lib/asciidoctor/pdf/ext/pdf-core · high confidence

Test coverage

Added test fixtures for block arrangement and admonition theming; Expanded test coverage for PDF converter features and edge cases; Organize custom RSpec matchers into separate files; Test suite infrastructure reorganized into modular spec\_helper components.

Dependencies

204 commits updating dependencies (2 manifests)

A dependency / build maintenance change in (dependencies) — 204 commits (22 fixs), 2 files.

(dependencies) · medium confidence · unverified

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 61 → 62 (+1.0)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.

Lenses

  • Code Health 58 → 58 (+0.0)
  • Architecture 89 → 88 (-1.7)
  • Maturity 57 → 60 (+3.2)
  • Readiness 64 → 64 (+0.1)
  • Security 80 → 80 (+0.0)

Resolved (6)

  • Documentation: no installation or build instructions (README.adoc)
  • Documentation: no installation or build instructions (docs/modules/ROOT/pages/install.adoc)
  • Inconsistent method naming for retrieving the tag identifier. StartTag0 and EndTag0 use tag_name(), while StartTag1 and EndTag1 use name(). This suggests a duplication of intent or a refactoring oversight where two versions of the same interface exist with different method names.
  • Inconsistent parameter naming for identical operations. The wrap method in InlineImageArranger and IndentedParagraphWrap accepts an argument named array, while InlineImageArranger uses fragments. Given the context of formatted text processing, fragments is the semantically correct term, making array confusing and inconsistent.
  • Outdated: bigdecimal
  • Outdated: rouge

New (1)

  • High CVE: [GHSA redacted] (Gemfile)

Changes since last survey

  • 1 commits — 1 feature/other, 0 fixes

By area

  • lib/asciidoctor — 1 commit

Notable commits

  • change: minor tweaks to index catalog

Architecture

  • Unchanged — 0 containers · 1 contexts · 0 edges

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

asciidoctor/asciidoctor-pdf was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 6 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 1973bab619069bd684215d5a049a470fc5727550 — the exact code this score is about.
  • Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.2+preprod-5c4e66d9318b.