Comic Viewer

Introduction

A simple html [web] comic viewer with an easy XML configuration. The viewer is written in perl and requires the following perl modules:

Config File

the config file looks like this:

 <?xml version="1.0"?>

<comic name="Thalion Dynasty">  

  <-- base directories. these are automatically prepended to the given
       links -->
  <base name="comic" path="/"/>  
  <base name="nav" path="/images/"/>  

  <-- navigation tools. you can use textual, graphical and some others -->
  <nav id="prev" titleimg="back.gif" title="bleedin' one before this one"/>  
  <nav id="next" titleimg="next.gif" title="whatever bloody page is after this"/>
  <nav id="first" title="back to the start of this 'ole mess"/>
  <nav id="last" title="'e bloody end, already"/>

  <-- the contents of the book are defined here. -->
  <-- the book can be divided into multiple sections (chapters?) -->
  <section titleimg="book1.gif" titlesmall="book1_small.gif" 
           title="Book 1 - The Dawning" path="Book1/">
    <page titleimg="one.gif" src="1-1.JPG" small="page1_small.jpg"
          title="Page 1" date="February 2002"/>     
    <page titleimg="two.gif" src="1-2.JPG" small="page2_small.jpg"
          title="Page 2" date="March 10, 2002"/>  
  </section>
</comic>


  

Navigation

Named directions that can be used when specifying pages relative to the current page:

next
the page that comes after the current one, if one exists.
prev
the page that comes before the current one, if one exists.
first
the first page in the entire comic.
last
the last page in the entire comic.

HTML Templates

In the HTML template, you can use the following case-insensative tags to insert data into the HTML source:
%PAGE%
Inserts an image with the current page and a link to the large image if the "small" attribute of the page is set.
%PAGE-SMALL%
Inserts the url of the small image for a page if there is one.
%URL%
Inserts the url of the current page.
%NAV-direction%
Inserts a navigation image and link to the page in the given direction, if there is one. e.g.: %NAV-PREV% or %NAV-FIRST%. A list of valid directions.
%URL-direction%
Inserts the url of the page in the given direction, if there is one. e.g.: %URL-PREV% or %URL-FIRST%
%LINK-direction%
Inserts an HTML link to the page in the given direction, if there is one. e.g.: %LINK-NEXT% or %LINK-LAST%
%LINKREL%
Inserts a set of HTML page-relative links from the page. This outputs <link rel="next" href="...">
%LIST-PAGES:tag%
Creates a list of links to the pages in the current section and surrounds the links with tag tags. e.g.: %LIST-PAGES:li% could put:
<li><a href="comicview.pl?page=0;section=1">Page 1</a></li>
<li><a href="comicview.pl?page=1;section=1">Page 2</a></li>
<li><a href="comicview.pl?page=2;section=1">Page 3</a></li>
%LIST-SECTIONS:tag%
Creates a list of links to the first page of the sections of the comic and surrounds the links with tag tags. See %LIST-PAGES%
%SECTION-TITLE%
Inserts the title of the current section
%SECTION-TITLE-IMG:attributes%
Inserts an image for the title of the current section, if there is one. more attributes can be added with the attributes tag
%TITLE%
Inserts the title of the current page
%TITLE-IMG%
Inserts the title of the current page as an image, if there is one. Attribute titleimg
%DATE%
Inserts the date of the current page