Grouping files in an index

The plugin takes data collected from other Rakudoc files, selects them according to criteria, and outputs the filename and descriptions.

=begin rakudoc :type<plugin>

AUTHOR

Richard Hainsworth, aka finanalyst

VERSION

v0.1.0

Overview

When a group of Rakudoc files are rendered using a RakuDoc::Processor object (RPO), the data from the processing can be collected before the final output is stored.

If this processed file meta data is injected back into the RPO before a RakuDoc source with a =ListFiles block, then the block will output the files in the meta data cache according to selector criteria.

Selectors

At the start of a RakuDoc source is a =begin rakudoc instruction. It can be given metadata options, which describe the file.

For example, the documentation files for the RakuAST::RakuDoc::Render distribution all contain the option :type, eg.

    =begin rakudoc :type<plugin>

In the distribution, the type option is given the values: plugin, renderer, fundamental, and minor.

Using the ListFiles block, an index source can be written so that the files are sorted according to the type values, eg.

The documentation can be split as follows:
=for ListFiles :select<type=fundamental> :caption<Fundamental>
Sources containing key concepts and information

=for ListFiles :select<type=renderer> :caption<Renderers in distribution>
Descriptions of the Renderer classes

...

=for ListFiles :select<type=!> :caption<Files without type options>
File from other sources or automatically generated

The last example shows how to capture files that do not have a type option. A file not matching any of the select criteria are not listed, so having a catchall syntax ensures all the RakuDoc source files in a collection are listed.

When more meta options are available, for example the Raku documentation suite, with about 700 source files, has three metadata options for each file.

=place semantic:AUTHOR :caption<Credits> =place semantic:VERSION :!toc =end rakudoc

Rakuast::RakuDoc::Render v1.0.14

Renders RakuDoc v2 to text, HTML, HTML-Extra, Markdown

Authors

  • Richard Hainsworth

License

Artistic-2.0

Dependencies

Test::Deeply::RelaxedPrettyDumpTest::OutputLibCurlURIDigest::SHA1::NativeText::MiscUtilsMethod::ProtectedTest::RunRakuAST::Deparse::HighlightRainbow:ver<0.3.0+>File::Directory::TreeJSON::FastYAMLishXML

Test Dependencies

Provides

  • RakuDoc::Citations
  • RakuDoc::MarkupMeta
  • RakuDoc::Numeration
  • RakuDoc::Plugin::HTML::Bulma
  • RakuDoc::Plugin::HTML::FontAwesome
  • RakuDoc::Plugin::HTML::Graphviz
  • RakuDoc::Plugin::HTML::Hilite
  • RakuDoc::Plugin::HTML::Latex
  • RakuDoc::Plugin::HTML::LeafletMaps
  • RakuDoc::Plugin::HTML::ListFiles
  • RakuDoc::Plugin::HTML::SCSS
  • RakuDoc::Plugin::Markdown::Graphviz
  • RakuDoc::Processed
  • RakuDoc::PromiseStrings
  • RakuDoc::Render
  • RakuDoc::ScopedData
  • RakuDoc::Templates
  • RakuDoc::To::Generic
  • RakuDoc::To::HTML
  • RakuDoc::To::HTML-Extra
  • RakuDoc::To::Markdown
  • RenderDocs

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