Quick start

Prerequisites

We need the following:

  1. Bulldoc distributive, please refer to Installation chapter
  2. Web-site on your computer under Apache web-server
  3. Suppose that files lie in /home/bulldoc, and website is available via http://bulldoc.

Unpack files into /home/bulldoc

Draft book plan

Our book will be pretty simple. Some chapters, introuduction. Let's name our book 'Web for lemmings'. We'll make draft plan:

Web for lemmings
=======================

Introduction
Browsers
  Firefox
  Opera

Create new project

In /home/bulldoc run command:

bulldoc -c lemmings

This command will create 2 directories:
/home/bulldoc/workshop/source/lemmings
/home/bulldoc/workshop/source/lemmings/pages

And two files:
empty /home/bulldoc/workshop/source/lemmings/toc.yml
and /home/bulldoc/workshop/source/lemmings/book_data.yml

It will also add the following line to file /home/bulldoc/workshop/source/bookshelf.yml:

lemmings:

Edit file /home/bulldoc/workshop/source/lemmings/book_data.yml, to indicate author, book's title, web-site and copyright (attention! YML files uses spaces instead of tabs):

title: Web for lemmings
author: Shadow wizard

copyright: Shadow Wizard, 2008
site: www.lemmings-web.net

Note, you can create project right from Bulldoc's start page, i.e. from the bookshelf. Click "create book" link. Fill just the keyword field with "lemmings", optionally fill the book's data fields (name, author, etc.) and you're done. But it is worth to know file structure, that's why we use command line and edit files in editor.

The system already could work with our book. Point your browser to http://bulldoc and see your book in available books list. Click the link and you'll see the first page. It is still empty. Let's do something with it.

Table of contents file

Let's fill up /home/bulldoc/workshop/source/lemmings/toc.yml file. Use the following code (you can use web-interface, by pressing 'Edit TOC' in top-right menu):

introduction.html: Introduction
browsers:
  type: chapter
  title: Browsers
  topics:
    firefox.html: Firefox
    opera.html: Opera

Review your book in the browser http://bulldoc/lemmings. You can see outline, navigation and silly 'Under construction' message instead of page's content. Now let's write our pages.

The content

Create file /home/bulldoc/workshop/source/lemmings/introduction.html. Put the following content into it:

<bdc:keywords data='browser' />

<p>
<b>A web browser </b> is a software application which enables a user to display and interact with text, images, videos, music, games and other information typically located on a web page at a website on the World Wide Web or a local area network. Text and images on a web page can contain hyperlinks to other web pages at the same or different website. Web browsers allow a user to quickly and easily access information provided on many web pages at many web sites by traversing these links.
</p>

<p>
Although browsers are typically used to access the World Wide Web, they can also be used to access information provided by web servers in private networks or content in file systems.
</p>

<p>
The purpose of a web browser is to display web pages to the user. This process begins when the user inputs a Uniform Resource Identifier (URI), for example http://en.wikipedia.org/, into the browser. The prefix of the URI determines how the URI will be interpreted. The most commonly used kind of URI starts with http: and identifies content to be retrieved over Hypertext Transfer Protocol (HTTP). Many browsers also support a variety of other prefixes, such as https: for HTTPS, ftp: for the File Transfer Protocol, and file: for local files. Prefixes that the web browser cannot directly handle are often handed off to another application entirely. For example, mailto: URIs are usually passed into the user's default e-mail application, and news: URIs are passed to the user's default newsgroup reader.
</p>

<p>
The Opera browser is a good example.
</p>

Look at the result: http://bulldoc/lemmings/introduction.html

Create files about browsers and fill them (you can use web-interface. Just use table of contents page and open page you want to edit. Press 'Edit' link):

/home/bulldoc/workshop/source/lemmings/browsers/firefox.html
<bdc:keywords data='netscape, mozilla, firefox' />

<p>
Mozilla was the official, public, original name of Mozilla Application Suite by the Mozilla Foundation, currently known as SeaMonkey suite.
</p>

<p>
The name has been used in a number of ways and in combination with other phrases, though all of them have been related to the now-defunct Netscape Communications Corporation and its related application software.
</p>

<p>
Only three things have ever formally used the term "Mozilla" alone: the codename for the Netscape Navigator software project the official name of what was re-named Mozilla Application Suite the Mascot of Netscape.
</p>

/home/bulldoc/workshop/source/lemmings/browsers/opera.html
<bdc:keywords data='opera, opera mini' />

<p>
Opera is a web browser and Internet suite developed by the Opera Software company. Opera handles common Internet-related tasks such as displaying web sites, sending and receiving e-mail messages, managing contacts, IRC online chatting, downloading files via BitTorrent, and reading web feeds. Opera is offered free of charge for personal computers and mobile phones, but for other devices it must be paid for.
</p>

<p>
Features of Opera include tabbed browsing, page zooming, mouse gestures, and an integrated download manager. Its security features include built-in phishing and malware protection, strong encryption when browsing secure web sites, and the ability to easily delete private data such as cookies and browsing history by simply clicking a button.
</p>

<p>
Opera runs on a variety of personal computer operating systems, including Microsoft Windows, Mac OS X, Linux, FreeBSD, and Solaris.[2] Though evaluations of Opera have been largely positive, Opera has captured only a fraction of the worldwide personal computer browser market.
</p>

Walk throug pages, and check the result.

Place this logo into /home/bulldoc/workshop/source/lemmings/browsers/firefox.png and edit /home/bulldoc/workshop/source/lemmings/browsers/firefox.html by adding

<img src='firefox.png'>

to beginning of the file.

Check the result.

Edit /home/bulldoc/workshop/source/lemmings/introduction.html, by replacing Opera with

<bdc:link page='browsers/opera.html' />

Check the result.

You can add PHP-code to any page:

<bdc:php> 
function _yamlizeArray($array,$indent) {
    if (is_array($array)) {
      $string = '';
      foreach ($array as $key => $value) {
        $string .= $this->_yamlize($key,$value,$indent);
      }
      return $string;
    } else {
      return false;
    }
  }
</bdc:php>  

You should see the highlighting.

The index

Add Index page to the Table of Contents file /home/bulldoc/workshop/source/lemmings/toc.yml (you can also use web-interface by pressing TOC-edit link on the top):

introduction.html: Introduction
browsers:
  type: chapter
  title: Browsers
  topics:
    firefox.html: Firefox
    opera.html: Opera
topic_index.html: {type: index, title: Index}

Check the Index page — there are something allready!

Let's add the cover image

Save this picture as /home/bulldoc/workshop/source/lemmings/pages/cover.png. Point your browser to the first book's page (http://bulldoc/lemmings), press "Edit" link and place the following content:

<img src='cover.png' style='display: block'>
<h2>Table of contents</h2>

Now you can see an image. More over, your bookshelf will display the book's cover in the book list.

Export to static html

Let's export book to the html-files. Type in your command line

cd /home/bulldoc bulldoc lemmings

Look into /home/bulldoc/workshop/output/lemmings for the result.


© H-type, 2008
www.bulldoc.ru