PPresenter
view release on metacpan or search on metacpan
doc_html/export/website/html.html view on Meta::CPAN
<HTML>
<HEAD>
<TITLE>Portable Presenter; Export as HTML Website</TITLE>
<BODY BGCOLOR=#FFFFFF TEXT=#000000>
<TABLE WIDTH=100%>
<TR><TD WIDTH=15% VALIGN=top><IMG SRC=../../images/ppresenter.png WIDTH=150 HEIGHT=170></TD>
<TD ALIGN=center><H1>Export website in HTML</H1></TD></TR>
<TR><TD VALIGN=top>
<A HREF=../../index.html>PPresenter</A><BR>
<A HREF=../../manual.html>Manual</A><BR>
<A HREF=../index.html>Export</A><BR>
<A HREF=index.html>Website</A><BR>
<B>HTML</B><BR>
<P>
<A HREF=#simple>Simple Website</A><BR>
<A HREF=#options>Options</A><BR>
<A HREF=#use>Use an Exporter</A><BR>
<A HREF=#your>Own Contents</A><BR>
<A HREF=#override>Override</A><BR>
<A HREF=#struct>Structure</A><BR>
<A HREF=#example>Example</A><BR>
</TD><TD VALIGN=top>
<A HREF=../index.html>Portable Presenter</A> is a package designed to give
presentations. Doing the presentation is one thing, but you like to
have this show publicly available afterwards.
<P>
The most popular way to present your slides after "the real thing" is
by creating a website. The module
<CODE>PPresenter::<WBR>Export::<WBR>Website::HTML.pm</CODE> can do this
for you, although this is not a really easy thing: you need a bit more
knowledge about Perl for this.
<P>
This export option is useless whithout Image::Magick installed.
<H2><A NAME=simple>A Simple Website</A></H2>
Exporters are not automatically added to your show. It is not (but could be)
a part of a style. So: anywhere in your program you have to add the line
<PRE>
$show->addExporter('PPresenter::Export::Website::HTML');
</PRE>
Start the show. When the compilation of the exporter module is successful,
you can access the options of the module via the background module.
<P>
Some basic changes can be made, like the format and the width of the
images to be produced (the height of the image is scaled the same as
the width is). Most changes you want to make to the produced site require
you to write your own exporter module.
<H2><A NAME=options>Options</A></H2>
The Website object extends to <A HREF=im_images.html#options>IM_Images</A>
object and the general <A HREF=index.html#options>Export</A> object.
Next to those options, you may set:
<DL>
<DT><B>-slideAs =></B> <I>way-to-dump</I><BR>
<B>-notesAs =></B> <I>way-to-dump</I>
<DD>The default settings how the slides should be included in the
webpages. The way-do-dump value is one of
<DL>
<DT><B>IMAGE</B>
<DD>Requires Image::Magick. The screens are copied using XWD and
then converted into the specified format and width.
<DT><B>TABLE</B>
<DD>The template should have a makeHTMLTable function and the
formatter shall provide a toHTML function for this to work.
The text is transformed into HTML which should show similar to
the screen.
<DT><B>LINEAR</B>
<DD>The formatter should provide a makeHTMLLinear function for
this to work. The template layout be be lost, but the content
of slides is translated into HTML.
<DT><B>SKIP</B>
</DL>
<P>
<DT><B>-outputDir =></B> <I>directory</I>
<DD>The specified directory will contain the site. If this directory
does not exist, it will be created.
<P>
<DT><B>-indexFile =></B> <I>file</I>
<DD>Each slide will be stored in a seperate directory, in a file under
this name. All links between the pages will be very explicit about
the filename specified here, although it is the default of the
machine where the site resides. Because of that, you can test your
site with the <CODE>file:</CODE> primitive too.
</DL>
<H2><A NAME=use>Using an Exporter</A></H2>
You can only use an export if you invoke it explicitly in your presentation
program. There are two ways to do this:
<PRE>
my $show = PPresenter->new(<I>options</I>);
my $export =
$show->addExporter('PPresenter::Export::Website::HTML');
$export->change(<I>options</I>);
</PRE>
or
<PRE>
my $show = PPresenter->new(<I>options</I>);
my $export =
PPresenter::Export::Website::HTML->new(<I>options</I>);
</PRE>
<H2><A NAME=your>Your own Website Contents</A></H2>
Each website is different. An option-menu is not sufficient to all demands.
Therefore, if you want to produce your own layout, you have to override
parts of the standard exporter.
<P>
Perl offers two ways to override the functionality: a very dirty but
fast one, and a pretty OO-version which is a bit more work.
<P>
<B>The dirty way:</B>
<PRE>
$show->addExporter('PPresenter::Export::Website::HTML');
sub PPresenter::Export:Website::HTML::PageLogo($$)
{ my ($export, $show, $slide) = @_;
my $file = $slide ? "../logo.gif" : "logo.gif";
"<IMG SRC=$file WIDTH=150 HEIGHT=107>";
}
</PRE>
( run in 0.631 second using v1.01-cache-2.11-cpan-39bf76dae61 )