NAME

File::Sticker::Reader::YamlPrefix - read and standardize meta-data from YAML-prefixed text file

VERSION

version 3.0101

SYNOPSIS

use File::Sticker::Reader::YamlPrefix;

my $obj = File::Sticker::Reader::YamlPrefix->new(%args);

my %meta = $obj->read_meta($filename);

DESCRIPTION

This will read meta-data from plain text files where the first part of the file contains YAML data, set up as if it is a YAML stream. That is, the file starts with '---' on one line, then there is YAML data, then there is another '---' line, and all content after that is ignored. Then it will standardize it to a common nomenclature, such as "tags" for things called tags, or Keywords or Subject etc.

This format can be useful as a way of storing meta-data in documents or in wiki pages.

DEBUGGING

whoami

Used for debugging info

METHODS

priority

The priority of this reader. Readers with higher priority get tried first.

allowed_file

If this reader can be used for the given file, then this returns true. File must be plain text and NOT end with '.yml'

known_fields

Returns the fields which this reader knows about. This reader has no limitations.

my $known_fields = $reader->known_fields();

read_meta

Read the meta-data from the given file.

my $meta = $obj->read_meta($filename);

Private Helper Functions

Private interface, just this file

_has_yaml

The file has YAML if the FIRST line is '---'

_yaml_and_more

Get the YAML part of the file (if any) by reading the stuff between the first set of --- lines and also the rest of the file as a separate part.

BUGS

Please report any bugs or feature requests to the author.