logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Text::Markup::Asciidoc - Asciidoc parser for Text::Markup

Author

       David E. Wheeler <david@justatheory.com>

Description

       This is the Asciidoc <https://asciidoc.org/> parser for Text::Markup. It depends on the "asciidoctor"
       command-line application; see the installation docs <https://asciidoctor.org/#installation> for details,
       or use the command "gem install asciidoctor". Note that Text::Markup does not load this module by
       default, but when loaded manually will replace Text::Markup::Asciidoc as preferred Asciidoc parser.

       Text::Markup::Asciidoctor reads in the file (relying on a BOM
       <https://www.unicode.org/unicode/faq/utf_bom.html#BOM>), hands it off to "asciidoctor"
       <https://asciidoctor.org> for parsing, and then returns the generated HTML as an encoded UTF-8 string
       with an "http-equiv="Content-Type"" element identifying the encoding as UTF-8.

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

       .asciidoc.asc.adoc

       To  change  it  the files it recognizes, load this module directly and pass a regular expression matching
       the desired extension(s), like so:

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

       Normally this parser returns the output of "asciidoctor" wrapped in a minimal HTML page skeleton. If  you
       would prefer to just get the exact output returned by "asciidoctor", you can pass in a true value for the
       "raw" option.

Name

       Text::Markup::Asciidoc - Asciidoc parser for Text::Markup

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],
         );

See Also