Description | A static content generator. |
Newcomen::Writer::Rendered - Write rendered content to a file.
This module provides a writer backend that writes the rendered content of an Newcomen::Page
instance to a file. It must not be used directly, see Newcomen::Writer for the writer frontend.
If the page's rendered attribute is undef
, no file will be created. If a file is written, it
will be opened with the IO layer '>:encoding(UTF-8)'
.
{ 'writer' => { 'rendered' => { 'output_dir' => undef, 'output_file' => undef, 'override' => undef, }, }, }
These are the default options for this writer backend. The user may override any default setting in the configuration file as required. However, plugins may decide to supersede the user defined options. Usually this shouldn't be the case for this writer backend, though.
The output_dir option specifies the directory to which the pages should be written. It has to be
specified relative to the project's root directory (the ROOT_DIR option, usually set to the
current working directory '.'
). The output directory has to exist, it will not be created
automatically. If it does not exist, this backend will die(). Subdirectories of the output
directory will be created automatically if required. If this option is undef
, the backend will
try to use the global option writer/output_dir, see Newcomen::Writer.
output_file should usually not be set in the configuration, i.e. it should be left with the
default undef
value. It may be used by plugins to set the file name of the output file, relative
to the output_dir. If it is undef
(the default), the page target will be used as name of the
output file, see Newcomen::Page.
If the override option is set to a true value, existing files will be overridden. If this option
is set to a false value, and an output file already exists, the backend will die(). If this
option is undef
, the backend will try to use the global option writer/override, see
Newcomen::Writer.
See Newcomen::Writer::Backend.
Newcomen::Page, Newcomen::Writer, Newcomen::Writer::Backend
This is version 2014052501
.
Stefan Goebel - newcomen {at} subtype {dot} de
Copyright 2013-2014 Stefan Goebel.
This file is part of Newcomen.
Newcomen is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the license, or (at your option) any later version.
Newcomen is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Newcomen. If not, see <http://www.gnu.org/licenses/>.