NAME
HiD::Role::IsConverted - Role for objects that are converted during the publishing process
SYNOPSIS
package HiD::ThingThatIsConverted
use Moose;
with 'HiD::Role::IsConverted';
...
1;
DESCRIPTION
This role is consumed by objects that are converted during the publication process -- e.g., from Markdown or Textile to HTML, or rendered through a layout object. This role provides required attributes and methods used during that process.
ATTRIBUTES
content ( ro / Str / required )
Page content (stuff after the YAML front matter)
converted_content ( ro / Str / lazily built from content )
Content after it has gone through the conversion process.
Post objects will be rendered via the processor prior to conversion.
converted_excerpt ( ro / Str / lazily built from content )
Excerpt after it has gone through the conversion process
hid
The HiD object for the current site. Here primarily to provide access to site metadata.
layouts ( ro / HashRef[HiD::Layout] / required )
Hashref of layout objects keyed by name.
metadata ( ro / HashRef )
Hashref of info from YAML front matter
readmore_link
Placed at the bottom of rendered excerpts. Intended to link to the full version of the content.
A string matching __URL__
will be replaced with the URL of the object (i.e., the output of $self-
url>) being converted.
rendered_content
Content after any layouts have been applied
template_data
Data for passing to template processing function.
template_data_without_content
Data for passing to template processing function when processing things that will _be_ content (e.g., blog posts).
extension_processors
An hash mapping file extensions to the module/method pair to use to convert the entry into HTML. Can be set via the extension_processors
key in the configuration file. If not provided, the default is:
{
markdown => [ 'Text::Markdown' , 'markdown' ] ,
mkdn => [ 'Text::Markdown' , 'markdown' ] ,
mk => [ 'Text::Markdown' , 'markdown' ] ,
md => [ 'Text::Markdown' , 'markdown' ] ,
mmd => [ 'Text::MultiMarkdown' , 'markdown' ] ,
textile => [ 'Text::Textile' , 'process' ] ,
}
METHODS
convert_by_extension
$self->convert_by_extension( $content );
Converts the provided content according to `$self->extension`, using the mappings in the `extension_processors` attribute.
VERSION
version 1.992
AUTHOR
John SJ Anderson <genehack@genehack.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2015 by John SJ Anderson.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.