NAME

Text::Amuse::Compile::Merged - Merging muse files together.

SYNOPSIS

my $doc = Text::Amuse::Compile::Merged->new( files => ([ file1, file2, ..]);
$doc->as_html;
$doc->as_splat_html;
$doc->as_latex;
$doc->header_as_html;
$doc->header_as_latex;

This module emulates a Text::Amuse document merging files together, and so it can be passed to Text::Amuse::Compile::File and have the thing produced seemlessly.

METHODS

new(files => [qw/file1 file2/], title => 'blabl', ...)

The constructor requires the files argument. Any other option is considered part of the header of this virtual Text::Amuse document.

On creation, the module will store in the object a list of Text::Amuse objects, which will be merged together.

When asking for header_as_html, you get the constructor options (save for the files option) properly formatted.

The headers of the individual merged files go into the body.

The first file determine the main language of the whole document.

Anyway, if it's a multilanguage text, hyphenation is supposed to switch properly.

Optionally, include_paths can be passed here.

language

Return the english name of the main language

language_code

Return the code of the main language

other_languages

If it's a multilingual merged text, return an arrayref of the other language names, undef otherwise.

other_language_codes

If it's a multilingual merged text, return an arrayref of the other language codes, undef otherwise.

hyphenation

Return the hyphenation of the first text.

font_script

The font script of the first text.

html_direction

The direction (rtl or ltr) of the first text

is_rtl

Return true if the first text is RTL.

is_bidi

Return true if any of the text is RTL or bidirectional.

include_paths

Return the include paths set in the object.

has_ruby

Return true if any of the pieces needs ruby

as_splat_html

Return a list of HTML fragments.

as_splat_html_with_attrs

Return a list of tokens for the minimal html template

as_html

As as as_splat_html but return a single string. This is invalid HTML and it should be used only for debugging.

raw_html_toc

Implements the raw_html_toc from Text::Amuse

attachments

Implement the attachments method from Text::Amuse::Document

included_files

Implement the included_files method from Text::Amuse::Document

as_latex

Return the latex body

wants_toc

Always returns true

wants_postamble

Always returns true

wants_preamble

Always returns true

is_deleted

Always returns false

header_as_latex

Returns an hashref with the LaTeX-formatted info (passed to the constructor).

header_as_html

Same as above, but with HTML format.

header_defined

Implements the header_defined method of Text::Amuse.

INTERNALS

docs

Accessor to the list of Text::Amuse objects.

files

Accessor to the list of files.

headers

Accessor to the headers.

tt

Accessor to the Template::Tiny object.

templates

Accessor to the Text::Amuse::Compile::Templates object.