The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

App::Followme::TextData - Convert text files to html

SYNOPSIS

use FIO;
my $data = App::Followme::TextData->new();
my $page = fio_read_page('new_file.md');
my $html = $data_fetch_as_html($page);

DESCRIPTION

This module contains the methods that build metadata values from a text file. The text file is optionally preceded by a section containing Yaml formatted data.

METHODS

All data are accessed through the build method.

my %data = $obj->build($name, $filename);

Build a variable's value. The first argument is the name of the variable. The second argument is the name of the file the metadata is being computed for. If it is undefined, the filename stored in the object is used.

VARIABLES

The text metadata class can evaluate the following variables. When passing a name to the build method, the sigil should not be used.

$body

All the contents of the file, minus the title if there is one. Text is called on the file's content to generate html before being stored in the body variable.

$description

A one line sentence description of the content.

$title

The title of the page is derived from contents of the top header tag, if one is at the front of the file content, or the filename, if it is not.

CONFIGURATION

The following parameters are used from the configuration:

extension

The extension of files that are converted to web pages. The default value is md.

text_pkg

The name of the package which converts text to html. The default value is 'Text::Markdown'.

text_method

The name of the method that does the conversion. The default value is 'markdown'.

LICENSE

Copyright (C) Bernie Simon.

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

AUTHOR

Bernie Simon <bernie.simon@gmail.com>