head2

use experimental :rakuast;

my $ast = q:to/QAT/.AST; =begin rakudoc

The $/ variable

The $! variable

the block to the caught exception.

=end rakudoc QAT $ast = $ast.rakudoc.head; my Bool $started = False; my $snippet = RakuAST::Doc::Block.new( :type<section>, :paragraphs() ); my $level; for $ast.paragraphs.list -> $node { my $is-head = $node ~~ RakuAST::Doc::Block && $node.type eq 'head'; if $started { if $is-head { if $node.level > $level { $snippet.add-paragraph($node); next } else { last } } else { $snippet.add-paragraph($node) } } else { if $is-head { $node.add-config('xtrg',RakuAST::QuotedString.new( processors => <words val>, segments => ( RakuAST::StrLiteral.new("223"), ) )); $snippet.set-paragraphs($node); $started = True; $level = $node.level; } } } my $head = $snippet.paragraphs.head; my %h =$head.config.pairs.map({ .key => .value.DEPARSE }).hash; say %h

Elucid8::Build v0.12.10

Renders RakuDoc sources in multiple languages to web site

Authors

  • Richard Hainsworth

License

Artistic-2.0

Dependencies

Rakuast::RakuDoc::RenderRakuConfigPrettyDumpGit::Blame::File

Test Dependencies

Provides

  • Elucid8-Add-ui-lang
  • Elucid8-Build
  • Elucid8-Gather
  • Elucid8::Plugin::HTML::AutoIndex
  • Elucid8::Plugin::HTML::Favicon
  • Elucid8::Plugin::HTML::SiteMap
  • Elucid8::Plugin::HTML::UISwitcher

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.