Text::...idoctor(3pm)

πŸ“¦
version 0.41 Β· 2 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

Text::Markup::Asciidoc β€” it's the Asciidoc parser for Text::Markup, bestie πŸ’… (and yes the page itself is titled Text::...idoctor(3pm), she's just a little truncated, iconic behavior honestly πŸŽ€)


✨ SYNOPSIS ✨

use Text::Markup::Asciidoctor;
my $html = Text::Markup->new->parse(file => 'hello.adoc');
my $raw = Text::Markup->new->parse(
    file    => 'hello.adoc',
    options => [raw => 1],
);

🌸 DESCRIPTION 🌸

okay so listen 🫢 this is the Asciidoc (https://asciidoc.org/) parser for Text::Markup. It's lowkey dependent on the asciidoctor command-line application, so if you don't have that yet, go peek at the installation docs (https://asciidoctor.org/#installation) for the details, or honestly just run the command gem install asciidoctor and call it a day ✨

important vibe check: Text::Markup does not load this module by default, no cap. But the second you load it manually, it replaces Text::Markup::Asciidoc as the preferred Asciidoc parser. periodt.

So what does it actually do? Text::Markup::Asciidoctor reads in the file (relying on a BOM (https://www.unicode.org/unicode/faq/utf_bom.html#BOM) to figure out the encoding, so cute of it), hands it off to asciidoctor (https://asciidoctor.org) for the actual parsing, and then returns the generated HTML as an encoded UTF-8 string β€” and it wraps that up with an http-equiv="Content-Type" element that says the encoding is UTF-8. it's giving thorough πŸ’…

Text::Markup::Asciidoctor recognizes files with the following extensions as Asciidoc:

  • .asciidoc
  • .asc
  • .adoc

want to change which files it recognizes? easy bestie, load this module directly and pass it a regular expression matching whatever extension(s) you want, like this πŸ¦‹:

use Text::Markup::AsciiDoctor qr{ski?doc};

normally this parser hands you the output of asciidoctor all wrapped in a minimal HTML page skeleton 🌈 but if you'd rather get the exact output that asciidoctor returned, no wrapping, no extra anything, just pass in a true value for the raw option and she'll give it to you straight πŸ“


πŸ‘‘ AUTHOR πŸ‘‘

David E. Wheeler <david@justatheory.com>


Copyright (c) 2012-2025 David E. Wheeler. Some Rights Reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


and that's the whole page, bestie, hope it slayed for you 🌟 this lil doc came from perl v5.40.1, dated 2025-12-18, and it's filed under Text::...idoctor(3pm) β€” mwah πŸ’‹

πŸ“¦ where this page comes from