where "variableName" is the name of the variable, and "variableValue" is the value of the variable.
Do not use underscore characters "_" in variable names.
A variable definition must be done in a single text line. Currently, hyPub is not smart enough to parse multiple lines
for variable definitions.
Recursive definitions of variables are not allowed.
The scope of a variable is limited to the container where it is defined.
If the same variable name is defined multiple times in the same container, the last definition wins.
Applying Variables
In book source files, variables can be applied (evaluated to their values) anywhere in the book source file
using the following syntax:
__variableName__
where "variableName" is the name of the variable.
When an undefined variable is used in the book source file, hyPub will not give you compilation errors.
It will simply ignore it.
When a variable is defined multiple nested levels, the definition of inner level wins.
hyPub Built-in Variables
Currently, hyPub supports 4 built-in variables:
__bookToc__ - The table of contents of the book, which will be generated automatically by hyPub
with all chapters and sections in the book.
__chapterToc__ - The table of contents of the chapter, which will be generated automatically by hyPub
with all sections in the chapter.
__fileName__ - The name of the final Web page files, which will be generated automatically by hyPub
as "index" for the index page file, the chapter name for a chapter page file, and the section name of a section page file.
__chapterName__ - The Web page file of the current chapter, which will be generated automatically by hyPub.
This will help you to build a link pointing back to the beginning of the chapter in a section block.
Required Variables
Currently, hyPub requires the following variables:
<p class="variable" id="title"> - Used at the Index level to define the title of the book.
<p class="variable" id="indexTitle"> - Used at the Index level to define the title of the index.
<p class="variable" id="chapterTitle"> - Used at the Chapter level to define the title of a chapter.
<p class="variable" id="sectionTitle"> - Used at the Section level to define the title of a section.
<p class="variable" id="pageTitle"> - Used at the Index, Chapter, or Section level to define the Web page title.
<p class="variable" id="version"> - Used at the Index level to define the version of the book.
<p class="variable" id="author"> - Used at the Index level to define the author of the book.
<p class="variable" id="copyright"> - Used at the Index level to define the copyright text of the book.
<p class="variable" id="homeUrl"> - Used at the Index level to define the URL of the Website where your book will be published.
<p class="variable" id="description"> - Used at the Index, Chapter or Section level to define the description text for the book, a chapter, or a section.
<p class="variable" id="keywords"> - Used at the Index, Chapter or Section level to define the key words for the book, a chapter, or a section.
Optional Variables
hyPub allows you to define your own variables in book source file, and apply them any where you want.
For example, you may define some variables listed below: