WebBook allows you to create a navigation structure for your HTML pages. All you have to do is edit a configuration file and add your pages to the right place. You do not need any special CGI or Java configuration to run it, and you can use it without any WWW server. Simply open the "index.html" file.
There are 3 noticeable areas divided by frames. The Title area contains some information about the online book. The Tree area contains the book's hierarchy of pages with some tools to help navigation. The Contents area shows the user's pages.
You can use any HTML editor to build the pages for the Contents area. CGI documents are also valid.
The information on the Title area and on the Tree area can be changed by editing the configuration file "wb_usr.lua".
First of all, download a copy of the toolkit files:
wb (Folder) wb_img (Folder)
Edit a new configuration file named "wb_usr.lua" in the "wb" folder. This file must contain information about the book, including the tree definition. A file named "logo.gif" will be used in the title area before the text title.
The book files must be located in the respective language folder, even if only one language is provided. Here are the pre-defined language strings:
en = English - United States es = Spanish - Standard pt = Portuguese - Brazil
There are icons only for pt, en and es, but it is very simple to edit a new one based on these.
The respective files in each language must have the same name as the bookmarks inside them so the links in the tree can be only one for all languages.
It is a text file, coded in Lua, that describes all the configurable options of the toolkit. It has 3 tables, forming 3 groups of parameters.
The User section contains the main configuration parameters:
wb_usr langs (a table containing the language strings of the available languages) start_size (the initial width of the Tree area) title_bgcolor (background color of the Title area, not used anymore, the "title_background.png" image is usd instead) contact (contact e-mail for the Title area) copyright_name (copyright text for the Title area) copyright_link (URL for the link to the copyright text) search_link (URL for the search site) file_title (prefix name of the file, usually the short product name, ex: "webbook", used by the HTML Help) start_open (Indicates the state of the first tree node when the page is loaded) google_id (Identifier of the Google Custom Search Engine)
The Messages section contains language-dependent parameters:
wb_usr.messages
xx (language string, can be "nl" - neutral language used for all languages)
title (text of the browser's window title)
bar_title (text of the Title area)
The Tree section contains the topic-hierarchy tree:
wb_usr.tree
(for each topic)
title (a table with the topic's title in each language - nl stands for all languages.
It is allowed to use HTML tags to alter the style of the text)
link (name of a file with extension. If left blank the item will be unavailable and painted black)
folder (subtree of topics. Must be an array with other topics)
For an example of a configuration file, download Webbook and check the file "wb/wb_usr.lua". Here is an extract:
wb_usr = {
langs = {"en","pt"},
start_size = "200",
contact = "webbook@tecgraf.puc-rio.br",
copyright_link = "http://www.tecgraf.puc-rio.br",
search_link = "http://www.tecgraf.puc-rio.br/webbook",
copyright_name = "Tecgraf/PUC-Rio",
title_bgcolor = "midnightblue",
file_title = "wb",
start_open = "1"
}
wb_usr.messages = {
pt = {
title = "WebBook",
bar_title = "WebBook - Versão 3.0"
},
en = {
title = "WebBook",
bar_title = "WebBook - Version 3.0"
}
}
wb_usr.tree =
{
name= {nl= "Webbook"},
link= "home.html",
folder=
{
{
name= {en= "Product", pt= "Produto"},
link= "prod.html",
folder=
{
{
name= {en= "Overview", pt= "Visão Geral"},
link= "prod.html#over"
},
{
name= {en= "Authors", pt= "Autores"},
link= "prod.html#aut"
},
...
The HTML files for the frame set, the title area and the tree must be generated using the Lua 5 interpreter in the "wb" folder:
lua5.1 wb_build.lua
The files: "index.html", "wb_title.html" e "wb_tree.html" will be generatedin the folder that contains the folder "wb". The forlder "wb" does not needs to be distributed or copied to the web server. But the folder "wb_img" must be included.
When more than one language is configured there will be one file for each language with a language suffix in the file name.
In Windows the Lua interpreter is included in the WebBook distribution files. But for UNIX they must be downloaded from the site LuaBinaries.
Webbook's initial page is always the link defined in the "wb_usr.tree.link" parameter. Nonetheless, it is possible to start Webbook in a specific topic. To accomplish this, the specific topic must be included in the given URL in the following format:
http://webbook_url/index.html?url=file.html#bookmark
Where:
webbook_url is the location of your webbook;
file.html#bookmark is a link that exists in the tree description
provided in the "wb_usr.lua" file.
Example:
http://www.tecgraf.puc-rio.br/webbook/index.html?url=guide.html#init
To access a local file in your computer use:
file:///d:/tecgraf/webbook/html/index.html?url=guide.html#init
In Windows you can build a HTML Help file from the WebBook files. To do that you must have installed some utilities necessary to the conversion: the Microsoft Help Compiler (hhc.exe) and the Lua interpreter (lua5.1.exe). It is not necessary to have the HTML Help Workshop installed, but it is a simple way to install the "hcc.exe" program.
You can download the HTML Help Workshop from Microsoft:
http://go.microsoft.com/fwlink/?LinkId=14188 or
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/htmlhelp/html/hwMicrosoftHTMLHelpDownloads.asp or ../download/htmlhelp.exe
The WebBook distribution files include the Lua interpreter for Windows.
There are tools to access CHM files also in Linux and other platforms (http://xchm.sourceforge.net/).
The Lua script "wb\make_hh.lua" will build a HTML Help project from the WebBook configuration file. The batch file "wb2hh.bat" will help you build the project and compile the HTML Help. Just run "wb2hh myhelp en" and the "myhelp_en.chm" file will be built for the "en" language. You can edit the batch file so the final folder were the file is copied can be adjusted to your case.
Remember that everything that is locally referenced by your HTMLs will be included in the CHM file. Here is an example for the WebBook pages: wb_en.chm. It is important that your pages have different titles so in the search results each page found appears with a different name.
When online and the manual is also online, you can use the Google restricted search available in the title area.
A simple search is available using a Java Applet. The Applet was based in the ssSearch Applet from Nalla Senthilnathan.
When using the manual in the local disc, to search only in the local computer use the Java Applet or we suggest you to use the HTML Help search tools.
To migrate old WebBook 2 configuration files to WebBook 3 just do in the "wb" folder:
lua5.1 js2lua.lua ../wb_usr/wb_usr.js wb_usr.lua copy ../wb_usr/logo.gif .. remove ../index.html ../wb_hh ../wb_core ../wb_usr (only necessary to remove wb2 files)
Then manually edit the "wb_usr.lua" file and add the paramaters "wb_usr.search_link" and "wb_usr.file_title". The unsupported parameters can be removed later.
Build the new WebBook 3 files:
lua5.1 wb_build.lua
Finally if your HTML files contain calls to WebBook 2 JavaScript functions you must remove them.