Text::Amuse::Output
The module is used internally by Text::Amuse, so everything here is pretty much internal only (and underdocumented).
\documentclass[DIV=9,fontsize=10pt,oneside,paper=a5]{scrbook} \usepackage{graphicx} \usepackage{alltt} \usepackage{verbatim} \usepackage[hyperfootnotes=false,hidelinks,breaklinks=true]{hyperref} \usepackage{bookmark} \usepackage[stable]{footmisc} \usepackage{enumerate} \usepackage{longtable} \usepackage[normalem]{ulem} \usepackage{wrapfig} % avoid breakage on multiple <br><br> and avoid the next [] to be eaten \newcommand*{\forcelinebreak}{~\\\relax} % this also works % \newcommand*{\forcelinebreak}{\strut\\{}} \newcommand*{\hairline}{% \bigskip% \noindent \hrulefill% \bigskip% } % reverse indentation for biblio and play \newenvironment{amusebiblio}{ \leftskip=\parindent \parindent=-\parindent \bigskip \indent }{\bigskip} \newenvironment{amuseplay}{ \leftskip=\parindent \parindent=-\parindent \bigskip \indent }{\bigskip} \newcommand{\Slash}{\slash\hspace{0pt}}
Constructor. Format can be ltx or html, while document must be a Text::Amuse::Document object.
ltx
html
Accessor to the Text::Amuse::Document object (read-only, but you may call its method on that.
Accessor to the current format (read-only);
This method returns a array ref with the processed chunks. To get a sensible output you will have to join the pieces yourself.
We don't return a joined string to avoid copying large amounts of data.
my $splat_pages = $obj->process(split => 1); foreach my $html (@$splat_pages) { # ...templating here... }
If the format is html, the option split may be passed. Instead of a arrayref of chuncks, an arrayref with html pages will be returned. Each page usually starts with an heading, and it's without <head> <body>. Footnotes are flushed and inserted at the end of each pages.
split
E.g.
print @{$obj->process};
Return the formatted header as an hashref with key/value pairs.
Add the footnote to the internal list of found footnotes. Its existence is checked against the document object.
Return the list of footnotes found as a list of digits.
Main routine to transform a string to the given format
Inline the footnotes in the given string, accordingly to the current format.
Be sure that the strings passed are properly escaped for the current format, to avoid command injection.
Escape the string for LaTeX output
Escape the string for HTML output
When we catch an header, we save it in the Output object, so we can emit the ToC. Level 5 is excluded as per doc.
It returns the numerical index (so you can inject the id).
Clear out the list. This is called at the beginning of the main loop, so we don't collect duplicates over multiple runs.
Emit the formatted toc (if any). Please note that this method works even for the LaTeX format, even if does not produce usable output.
This because we can test if we need to emit a table of contents looking at this without searching the whole output.
The HTML formatted table of contents.
Put an horizontal rule
If it's LaTeX, insert a newpage
Here we see if it's a single one or a link/desc pair. Then dispatch
Methods providing some fixed values
Regular expression to match image links.
Given the input string $link, return undef if it's not an image. If it is, return a Text::Amuse::Output::Image object.
To install Text::Amuse, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Text::Amuse
CPAN shell
perl -MCPAN -e shell install Text::Amuse
For more information on module installation, please visit the detailed CPAN module installation guide.