Transforms a EPUB 3 publication into a PEF.
You may alternatively use the EPUB package document (the OPF-file) if your input is a unzipped/”exploded” version of an EPUB.
true
or false
false
Style sheets, whether they’re user style sheets (specified with the “stylesheet” option) or author style sheets (associated with the source), may have parameters (Sass variables). The “stylesheet-parameters” option, which takes a list of parenthesis enclosed key-value pairs, can be used to set these variables.
For example, if a style sheet uses the Sass variable “foo”:
@if $foo {
/* some style that should only be enabled when "foo" is truthy */
}
you can control that variable with the following parameters list: (foo:true)
.
The syntax is as follows (described in terms of CSS grammar):
query
: feature*
;
feature
: '(' S* IDENT S* [ ':' S* value ]? ')' S*
;
value
: string | integer | IDENT
;
The following CSS rule is included by default (where $maximum-number-of-sheets
is the value of
this option):
@volume {
max-length: $maximum-number-of-sheets;
}
See the CSS specification for more info:
@volume
rulemax-length
property70
true
or false
false
DEPRECATION WARNING: XSLT style sheets are also supported, but this feature might be removed in the future. It is recommended to apply any XSLT style sheets during pre-processing of the document.
Must be a space separated list of URIs, absolute or relative to the input.
Style sheets specified through this option are called “user style sheets”. Style sheets can also be attached to the source document. These are referred to as “author style sheets”. They can be linked (using an ‘xml-stylesheet’ processing instruction or a ‘link’ element), embedded (using a ‘style’ element) and/or inlined (using ‘style’ attributes). Only author styles that apply to “embossed” media are taken into account.
Style sheets are applied to the document in the following way: XSLT style sheets are applied before CSS/Sass style sheets. XSLT style sheets are applied one by one, first the user style sheets, then the author style sheets, in the order in which they are specified.
All CSS/Sass style sheets are applied at once, but the order in which they are specified has an influence on the cascading order. Author styles take precedence over user styles.
CSS/Sass style sheets are interpreted according to braille CSS rules.
For info on how to use Sass (Syntactically Awesome StyleSheets) see the Sass manual.
A number of partials (helper style sheet modules) are available for use in Sass style sheets:
The following CSS rule is included by default (where $force-braille-page-break
is the value of
this option):
@if $force-braille-page-break {
.page-front,
.page-normal,
.page-special,
[epub|type='pagebreak'] {
page-break-before: always;
}
}
See the CSS specification for more info:
page-break-before
propertytrue
or false
false
Sets the default page height (this can be overwritten with @page
rules) and affects media queries
that use the ‘height’ feature. The variable $page-height
is available in Sass style sheets.
See the CSS specification for more info:
@page
rulesize
property25
true
or false
true
Sets the default page width (this can be overwritten with @page
rules) and affects media queries
that use the ‘width’ feature. The variable $page-width
is available in Sass style sheets.
See the CSS specification for more info:
@page
rulesize
property40
The following CSS rule is included by default (where $hyphenation
is the value of this option):
:root {
hyphens: $hyphenation;
}
This means that words are hyphenated according to the specified policy, except where overridden by more specific CSS rules. See the CSS specification for more info:
hyphens
propertyauto
manual
none
auto
The value can range from 1 to 10. The lower the value, the more preference is given to volume breaks
right before section
elements. The higher the value, the more equal the volumes will be in
size.
10
If set, braille transcription is
done using the selected braille code. If left empty, the braille code is determined by the document
language. Note that braille transcription can also be controlled through CSS @text-transform
rules.
Features of the braille transformer to be used for creating the paginated braille document from the CSS styled input document. Together with the “Braille code” option this determines the transformer that is selected.
The syntax is as follows (described in terms of CSS grammar):
query
: feature*
;
feature
: '(' S* IDENT S* [ ':' S* value ]? ')' S*
;
value
: string | integer | IDENT
;
(translator:liblouis)(formatter:dotify)
If left blank, the locale information in the input document will be used to select a suitable table.
The following CSS rule is included by default (where $line-spacing
is the value of this option):
@if $line-spacing == double {
:root {
line-height: 2;
}
}
See the CSS specification for more info:
line-height
propertysingle
double
single
true
or false
false
The value must be greater or equal to 0. It can be a non-integer. A value of 0 means no preference is given. A higher value results in volumes that are less equal in size.
0
The file format must be expressed as a list of parenthesis enclosed key-value pairs. For example, to
select a file format suited for the U.S., set the option to (locale:en-US)
. To use the braille
character set used in the Netherlands and store to a file with extension “.brl”, set the option to
(locale:nl)(file-extension:'.brl')
.
If left blank, the braille will be stored in PEF format.
The syntax is as follows (described in terms of CSS grammar):
query
: feature*
;
feature
: '(' S* IDENT S* [ ':' S* value ]? ')' S*
;
value
: string | integer | IDENT
;
Notes, i.e. elements that are referenced by an element with epub:type
“noteref”, can be rendered
either at bottom of the page on which they occur (on which they are referenced), at the end of the
block in which they occur, at the end of the volume in which they occur, or at the end of the
book. Elements with epub:type
“note”, “footnote”, “endnote” or “rearnote” that are not referenced
by a noteref are not rendered.
Note references can be styled using a a[epub|type~='noteref']
rule. Notes that are placed at the
end of the block can be styled with a [epub|type~='notes'], [epub|type~='footnotes'],
[epub|type~='endnotes'], [epub|type~='rearnotes']
rule. Notes that are placed at the bottom of the
page or at the end of a chapter, volume or the end of the book can be styled with a
a[epub|type~='noteref']::alternate
rule. A title can be inserted at the beginning of an endnotes
section using a .endnotes-section::-obfl-on-collection-start
rule. Example:
.endnotes-section::-obfl-on-collection-start {
content: "Notes in this volume";
text-align: center;
margin-bottom: 1;
}
bottom-of-page
Notes are rendered in the @footnotes
area of the page on which they occur.
There is a built-in fallback mechanism: if a note does not fit on a page, e.g. because it is too big, or there are too many other notes on that page, all notes in the whole book will be rendered at the end of the volume in which they occur.
The footnotes area can be styled using a @footnotes
rule. Example:
@page {
@footnotes {
border-top: ⠤;
max-height: 20;
}
}
end-of-block
Notes are rendered after the block (e.g. paragraph) in which they occur.
end-of-chapter
Notes are rendered at the end of the chapter (section
) in which they occur.
end-of-volume
Notes are rendered in the @end
area of
the volume in which they occur.
end-of-book
Notes are rendered in the @end
area of
the last volume.
Notes can be grouped by volume using a
.endnotes-section::-obfl-on-volume-start
rule. Example:
.endnotes-section::-obfl-on-volume-start {
content: "Notes in volume " -obfl-evaluate("$started-volume-number");
margin: 1 0;
}
custom
Special handling of notes is disabled. Notes are rendered as specified in custom style sheets.
end-of-book
The input EPUB may already contain CSS that applies to embossed media. Such document-specific CSS takes precedence over any CSS attached when running this script.
For instance, if the EPUB already contains the rule p { padding-left: 2; }
,
and using this script the rule p#docauthor { padding-left: 4; }
is provided, then the
padding-left
property will get the value 2
because that’s what was defined in the EPUB,
even though the provided CSS is more specific.
true
or false
false
Usage: dp2 [GLOBAL_OPTIONS] epub3-to-pef [OPTIONS] Options:
--source source | The EPUB you want to convert to braille. |
--preamble preamble | An HTML file to be prepended to the EPUB spine. |
--include-pef [include-pef] | Include PEF (default: false ) |
--stylesheet-parameters [stylesheet-parameters] | Style sheet parameters (default: ) |
--maximum-number-of-sheets [maximum-number-of-sheets] | Maximum number of sheets (default: 70 ) |
--include-obfl [include-obfl] | Include OBFL (default: false ) |
--stylesheet [stylesheet] | Style sheets (default: ) |
--force-braille-page-break [force-braille-page-break] | Force braille page break (default: false ) |
--page-height [page-height] | Page height (default: 25 ) |
--hyphenation-at-page-breaks [hyphenation-at-page-breaks] | |
--duplex [duplex] | Duplex (default: true ) |
--page-width [page-width] | Page width (default: 40 ) |
--hyphenation [hyphenation] | Hyphenation (default: auto ) |
--allow-volume-break-inside-leaf-section-factor [allow-volume-break-inside-leaf-section-factor] | Allow breaks within sections. (default: 10 ) |
--allow-text-overflow-trimming [allow-text-overflow-trimming] | |
--braille-code [braille-code] | Braille code (default: ) |
--transform [transform] | Transformer features (default: (translator:liblouis)(formatter:dotify) ) |
--preview-table [preview-table] | ASCII braille table for HTML preview (default: ) |
--line-spacing [line-spacing] | Line spacing (default: single ) |
--include-preview [include-preview] | Include preview (default: false ) |
--prefer-volume-break-before-higher-level-factor [prefer-volume-break-before-higher-level-factor] | Prefer breaks at higher level sections. (default: 0 ) |
--output-file-format [output-file-format] | Output file format (default: ) |
--notes-placement [notes-placement] | Notes placement (default: end-of-book ) |
--apply-document-specific-stylesheets [apply-document-specific-stylesheets] | Apply document-specific CSS (default: false ) |
-o,--output [OUTPUT] | Path where to store the results. This option is mandatory when the job is not executed in the background |
-z,--zip | Write the output to a zip file rather than to a folder |
-n,--nicename [NICENAME] | Set job's nice name |
-r,--priority [PRIORITY] | Set job's priority (high|medium|low) |
-q,--quiet | Do not print the job's messages |
-p,--persistent | Delete the job after it is executed |
-b,--background | Sends the job and exits |