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

Text::Amuse::Compile::File - Object for file scheduled for compilation

SYNOPSIS

Everything here is pretty much private. It's used by Text::Amuse::Compile in a forked and chdir'ed environment.

ACCESSORS AND METHODS

new(name => $basename, suffix => $suffix, templates => $templates)

Constructor. Accepts the following named parameters:

name
virtual

If it's a virtual file which doesn't exit on the disk (a merged one)

suffix
templates
options

An hashref with the options to pass to the templates. It's returned as an hash, not as a reference, to protect it from mangling.

INTERNALS

is_deleted
status_file
mark_as_closed
mark_as_open
purged_extensions
lock_file
muse_file
document

The Text::Amuse object

tt

The Template object

logger

The logger subroutine set in the constructor.

cleanup

Remove auxiliary files (like the complete file and the status file)

purge_all

Remove all the output files related to basename

purge_latex

Remove files left by previous latex compilation

purge('.epub', ...)

Remove the files associated with this file, by extension.

METHODS

Formats

Emit the respective format, saving it in a file. Return value is meaningless, but exceptions could be raised.

html
bare_html
tex

This method is a bit tricky, because it's called with arguments internally by lt_pdf and a4_pdf, and with no arguments before pdf.

With no arguments, this method enforces the options twoside=true and bcor=0mm, effectively ignoring the global options which affect the imposed output.

pdf
epub
lt_pdf
a4_pdf
zip

The zipped sources. Beware that if you don't call html or tex before this, the attachments (if any) are ignored if both html and tex files exist. Hence, the muse-compile.pl scripts forces the --tex and --html switches.

Logging

While the logger accessor holds a reference to a sub, but could be very well be empty, the object uses these two methods:

log_info(@strings)

If logger exists, it will call it passing the strings as arguments. Otherwise print to the standard output.

log_fatal(@strings)

Calls log_info, remove the lock and dies.