Zane C. Bowers-Hadley > Toader > Documentation/Page.pod

Download:
Toader-1.1.2.tar.gz

Annotate this POD

CPAN RT

New  3
Open  1
View/Report Bugs
Source  

Toader Page Documentation ^

Page Storage ^

Each page is stored under the $toaderDir.'.toader/pages/' directory.

The page name can be any thing as long as it does not match anything below.

    /\n/
    /\t/
    /\//
    /^ /
    / $/
    /^\./

The storage used is MIME.

The following headers are should be used.

    renderer
    name
    Date
    From
    publish

'renderer' is the name of the renderer to use.

'name' is the name for the page.

'Date' is a RFC 2822 date.

'From' is a RFC 5322 email address. This is for the author.

'publish' is a boolean value specifies if a entry should be published or not. The values used are '0' and '1'. If not specified, it defaults to '1'.

Rendering ^

Content

The entry content, the 'renderContent' method, is rendered in three passes.

Pass One

First the body is ran through Text::Template.

No template is used for this pass.

The variables below are passed to Text::Template.

    name - This is the page name.
    from - This is the author or authors, from the From header.
    date - This is the entry name/date stap.
    g - This is a L<Toader::Render::General> object.
    toader - This is a L<Toader> object.
    sec - Seconds value take from the Date header.
    min - Minutes value take from the Date header.
    hour - Hours value take from the Date header.
    day - Day value take from the Date header.
    month - Month value take from the Date header.
    year - Year value take from the Date header.
    zone - Time zone value take from the Date header.
    self - The L<Toader::Render::Entry> object.
    obj - The L<Toader::Entry> object.
    c - The L<Config::Tiny> object containing the L<Toader> config.

Pass Two

Second the return results are of the first pass is ran through specified backend.

No template is used for this.

Pass Three

The third pass generates what can be included into something.

The template used is 'pageContent'. The default one is below.

    [== $body ==]

The variaables below are passed to Text::Template.

    body - This is output from pass two.
    name - This is the page name.
    from - This is the author or authors, from the From header.
    date - This is the entry name/date stap.
    g - This is a L<Toader::Render::General> object.
    toader - This is a L<Toader> object.
    sec - Seconds value take from the Date header.
    min - Minutes value take from the Date header.
    hour - Hours value take from the Date header.
    day - Day value take from the Date header.
    month - Month value take from the Date header.
    year - Year value take from the Date header.
    zone - Time zone value take from the Date header.
    self - The L<Toader::Render::Entry> object.
    obj - The L<Toader::Entry> object.
    c - The L<Config::Tiny> object containing the L<Toader> config.

Output Rendering.

This is rendered via the 'render' method.

The template used is 'page' with the variables below passed to it.

    toader - The L<Toader> object.
    g - The L<Toader::Render::General> object.
    self - The L<Toader::Render::Entry> object.
    obj - The L<Toader::Entry> object.
    c - The L<Config::Tiny> object containing the L<Toader> config.
    content - The output from the 'renderContent' method.

Once that is created, it is written to $outputDir.'/'.$r2r.'/.pages/'.$pageName.'/index.html'. Any files are written to $outputDir.'/'.$r2r.'/.entries/'.$entryName.'/.files/' .

Object Specific Methods ^

summary

This creates a summary of all the pages in a directory.

The template 'page' is filled out using the variables below.

    toader - This is the L<Toader> object.
    g - This is the L<Toader::Render::General> object.
    self - This is the L<Toader::Render::Page> object.
    obj - This is the L<Toader::Page> object.
    c - This is the L<Config::Tiny> object holding the L<Toader> config.
    locationID - This is the location ID, 'Pages Summary'.
    content - This the return from summaryContent.

Once it is rendered, it is written to $outputDir.'/'.$r2r.'/.pages/summary.html' .

summaryContent

This creates content for the summary of the pages.

The template 'pageSummary' is used with the variables below passed to it.

    toader - This is the L<Toader> object.
    g - This is the L<Toader::General> object.
    self - This is the L<Toader::Render::General>.
    obj - This is the L<Toader::Page> object.
    c  - This is the L<Config::Tiny> object storing the L<Toader> config.

The default template is as below.

    [== $g->pageSummary ==]
syntax highlighting: