Skip to content

Add PDF syntax to Rouge#2058

Merged
jneen merged 16 commits intorouge-ruby:mainfrom
petervwyatt:feature.pdf
Mar 17, 2026
Merged

Add PDF syntax to Rouge#2058
jneen merged 16 commits intorouge-ruby:mainfrom
petervwyatt:feature.pdf

Conversation

@petervwyatt
Copy link
Contributor

Please accept this lexer for PDF syntax (a.k.a. "COS syntax").

PDF (Portable Document Format) is an object-based declarative page description language that, in reality, is a random access, binary (non-text) format. It is formally defined by ISO 32000-2:2020 and corrected by errata (please do not refer to outdated legacy Adobe documentation!). However, with care text-centric PDFs (full or portions) can be created such as might be used in documentation. This token-based, forward lexing lexer is not intended to be used with binary real-world PDFs as that is not how real PDFs need to be lexed (this will also likely generate Ruby UTF-8 errors anyway!).

We wish to leverage this Rouge PDF parser upstream in current and future PDF ISO standards and specifications based on AsciiDoc via Metanorma for use with the many code fragment examples in the documentation.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants