<p:declare-stepxmlns:p="http://www.w3.org/ns/xproc"xmlns:px="http://www.daisy.org/ns/pipeline/xproc"xmlns:d="http://www.daisy.org/ns/pipeline/data"xmlns:c="http://www.w3.org/ns/xproc-step"xmlns:pef="http://www.daisy.org/ns/2008/pef"type="px:html-to-pef.script"version="1.0"exclude-inline-prefixes="#all"name="main">
<p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h1px:role="name">HTML to braille</h1><ppx:role="desc">Transforms a HTML document into an embosser ready braille document.</p>
<apx:role="homepage"href="http://daisy.github.io/pipeline/Get-Help/User-Guide/Scripts/html-to-pef/">
Online documentation
</a>
<dlpx:role="author">
<dt>Name:</dt>
<ddpx:role="name">Jostein Austvik Jacobsen</dd>
<dt>Organization:</dt>
<ddpx:role="organization"href="http://www.nlb.no/">NLB</dd>
<dt>E-mail:</dt>
<dd><apx:role="contact"href="mailto:josteinaj@gmail.com">josteinaj@gmail.com</a></dd>
</dl>
</p:documentation>
<p:optionname="html"required="true"px:type="anyFileURI"px:sequence="false"px:media-type="application/xhtml+xml text/html">
<p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Input HTML</h2><ppx:role="desc"xml:space="preserve">The HTML you want to convert to braille.</p>
</p:documentation>
</p:option><p:outputport="status"px:media-type="application/vnd.pipeline.status+xml">
<p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Status</h2><ppx:role="desc"xml:space="preserve">Whether or not the conversion was successful.
When `include-obfl` is set to true, the conversion may fail but still output a document on the
"obfl" port.</p>
</p:documentation>
<p:pipestep="convert"port="status"/>
</p:output><p:optionname="stylesheet"px:sequence="true"required="false"select="''"px:media-type="text/css application/xslt+xml">
<p:documentationxmlns="http://www.w3.org/1999/xhtml"><h2px:role="name">Style sheets</h2><ppx:role="desc"xml:space="preserve">A list of XSLT or CSS/Sass style sheets to apply.
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](https://www.w3.org/TR/CSS2/cascade.html#cascade)". Style sheets can also be attached to the
source document. These are referred to as "[author style
sheets](https://www.w3.org/TR/CSS2/cascade.html#cascade)". They can be linked (using an
['xml-stylesheet' processing instruction](https://www.w3.org/TR/xml-stylesheet) or a ['link'
element](https://www.w3.org/Style/styling-XML#External)), embedded (using a ['style'
element](https://www.w3.org/Style/styling-XML#Embedded)) and/or inlined (using '[style'
attributes](https://www.w3.org/TR/css-style-attr/)).
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 (first user
style sheets, then author style sheets) has an influence on the [cascading
order](https://www.w3.org/TR/CSS2/cascade.html#cascading-order).
CSS/Sass style sheets are interpreted according to [braille
CSS](http://braillespecs.github.io/braille-css) rules.
For info on how to use Sass (Syntactically Awesome StyleSheets) see the [Sass
manual](http://sass-lang.com/documentation/file.SASS_REFERENCE.html).
A number of [partials](https://sass-lang.com/documentation/at-rules/import#partials) (helper style
sheet modules) are available for use in Sass style sheets:
- [http://www.daisy.org/pipeline/modules/braille/html-to-pef/_tables.scss](http://daisy.github.io/pipeline/modules/braille/html-to-pef/src/main/resources/css/tables):
for styling tables
- [http://www.daisy.org/pipeline/modules/braille/html-to-pef/_definition-lists.scss](http://daisy.github.io/pipeline/modules/braille/html-to-pef/src/main/resources/css/definition-lists):
for styling definition lists
</p>
</p:documentation>
<p:pipeinfo>
<px:type>
<choice>
<datatype="anyFileURI"datatypeLibrary="http://www.daisy.org/ns/pipeline/xproc">
<documentationxml:lang="en">File path relative to input HTML.</documentation>
</data>
<datatype="anyURI">
<documentationxml:lang="en">Any other absolute URI</documentation>
</data>
</choice>
</px:type>
</p:pipeinfo>
</p:option><p:optionname="stylesheet-parameters"required="false"px:type="transform-query"select="''"><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Style sheet parameters</h2><ppx:role="desc"xml:space="preserve">A list of parameters passed to the style sheets.
Style sheets, whether they're specified with the "stylesheets" option or associated with the source,
may have parameters (variables in case of Sass). The "stylesheet-parameters" option can be used to
set these parameters.</p>
</p:documentation></p:option><p:optionname="braille-code"px:type="liblouis-table-query"required="false"select="''"><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Braille code</h2><ppx:role="desc"xml:space="preserve">Braille code to be used for braille transcription.
If set, [braille transcription](http://daisy.github.io/pipeline/Get-Help/User-Guide/Braille/) is
done with the selected braille code. If left empty, the braille code is determined by the document
language and the "Transformer features" option.</p>
</p:documentation></p:option><p:optionname="transform"required="false"px:type="transform-query"select="'(translator:liblouis)(formatter:dotify)'"><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Transformer features</h2><ppx:role="desc"xml:space="preserve">Features of the braille transformer.
Features of the [braille transformer](http://daisy.github.io/pipeline/Get-Help/User-Guide/Braille/)
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.</p>
</p:documentation></p:option><p:optionname="include-preview"required="false"px:type="boolean"select="'false'"><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Include preview</h2><ppx:role="desc"xml:space="preserve">Whether or not to include a HTML preview of the braille result.</p>
</p:documentation></p:option><p:optionname="include-pef"required="false"px:type="boolean"select="'false'"><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Include PEF</h2><ppx:role="desc"xml:space="preserve">Whether or not to keep the intermediary PEF file (for debugging).</p>
</p:documentation></p:option><p:optionname="include-obfl"required="false"px:type="boolean"select="'false'"><p:documentation>
<h2px:role="name">Include OBFL</h2><ppx:role="desc"xml:space="preserve">Whether or not the keep the intermediary OBFL file (for debugging).</p>
</p:documentation></p:option><p:optionname="output-file-format"required="false"px:type="transform-query"select="''"><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Output file format</h2><ppx:role="desc"xml:space="preserve">The file format in which to store the braille result.
If left blank, the braille will be stored in PEF format.</p>
</p:documentation></p:option><p:optionname="preview-table"required="false"px:type="transform-query"select="''"><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">ASCII braille table for HTML preview</h2><ppx:role="desc"xml:space="preserve">The ASCII braille table used to render the HTML preview.
If left blank, the locale information in the input document will be used to select a suitable table.</p>
</p:documentation></p:option><p:optionname="page-width"required="false"px:type="integer"select="'40'"><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Page layout: Page width</h2><ppx:role="desc"xml:space="preserve">The number of columns available for printing.
Sets the default page width (this can be overwritten with `@page` rules), affects media queries that
use the 'width' feature, and makes the variable `$page-width` available in style sheets.
See the CSS specification for more info:
- the [`@page`](http://braillespecs.github.io/braille-css/#h4_the-page-rule) rule
- the [`size`](http://braillespecs.github.io/braille-css/#the-size-property) property
- the [page dimensions media features](https://www.w3.org/TR/mediaqueries-4/#mf-dimensions)
</p>
</p:documentation></p:option><p:optionname="page-height"required="false"px:type="integer"select="'25'"><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Page layout: Page height</h2><ppx:role="desc"xml:space="preserve">The number of rows available for printing.
Sets the default page height (this can be overwritten with `@page` rules), affects media queries
that use the 'height' feature, and makes the variable `$page-height` available in style sheets.
See the CSS specification for more info:
- the [`@page`](http://braillespecs.github.io/braille-css/#h4_the-page-rule) rule
- the [`size`](http://braillespecs.github.io/braille-css/#the-size-property) property
- the [page dimensions media features](https://www.w3.org/TR/mediaqueries-4/#mf-dimensions)
</p>
</p:documentation></p:option><p:optionname="duplex"required="false"px:type="boolean"select="'true'"><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Page layout: Duplex</h2><ppx:role="desc"xml:space="preserve">When enabled, will print on both sides of the paper.</p>
</p:documentation></p:option><p:optionname="levels-in-footer"required="false"px:type="integer"select="'6'"><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Headers/footers: Levels in footer</h2><ppx:role="desc"xml:space="preserve">Specify which headings are rendered in the footer.
Makes the variable `$levels-in-footer` available in style sheets and includes the following rule by
default:
~~~sass
@for $level from 1 through 6 {
@if $levels-in-footer >= $level {
h#{$level} {
string-set: footer content();
}
}
}
~~~
In other words, the `footer` string is updated each time a heading with a level smaller than or
equal to `levels-in-footer` is encountered. In order to use the `footer` string include a rule like
the following in your custom style sheet:
~~~css
@page {
@bottom-center {
content: string(footer);
}
}
~~~
See the CSS specification for more info:
- the [`string-set`](http://braillespecs.github.io/braille-css/#h4_the-string-set-property) property
- the [`@page`](http://braillespecs.github.io/braille-css/#h4_the-page-rule) rule
- the [`string()`](http://braillespecs.github.io/braille-css/#h4_the-string-function) function
</p>
</p:documentation></p:option><p:optionname="hyphenation"required="false"px:type="boolean"select="'true'"><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Translation/formatting of text: Hyphenation</h2><ppx:role="desc"xml:space="preserve">When enabled, will automatically hyphenate text.
Makes the variable `$hyphenation` available in style sheets and includes the following rule by
default:
~~~sass
@if $hyphenation {
:root {
hyphens: auto;
}
}
~~~
See the CSS specification for more info:
- the [`hyphens`](http://braillespecs.github.io/braille-css/#the-hyphens-property) property
</p>
</p:documentation></p:option><p:optionname="line-spacing"required="false"select="'single'"><p:pipeinfo><px:type>
<choice>
<value>single</value>
<documentationxml:lang="en">Single</documentation>
<value>double</value>
<documentationxml:lang="en">Double</documentation>
</choice>
</px:type></p:pipeinfo><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Translation/formatting of text: Line spacing</h2><ppx:role="desc"xml:space="preserve">Single or double line spacing.
Makes the variable `$line-spacing` available in style sheets and includes the following rule by
default:
~~~sass
@if $line-spacing == double {
:root {
line-height: 2;
}
}
~~~
See the CSS specification for more info:
- the [`line-height`](http://braillespecs.github.io/braille-css/#h3_the-line-height-property)
property
</p>
</p:documentation></p:option><p:optionname="capital-letters"required="false"px:type="boolean"select="'true'"><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Translation/formatting of text: Capital letters</h2><ppx:role="desc"xml:space="preserve">When enabled, will indicate capital letters.
Makes the variable `$capital-letters` available in style sheets and includes the following rule by
default:
~~~sass
@if $capital-letters != true {
:root {
text-transform: lowercase;
}
}
~~~</p>
</p:documentation></p:option><p:optionname="include-captions"required="false"px:type="boolean"select="'true'"><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Block elements: Include captions</h2><ppx:role="desc"xml:space="preserve">When enabled, will include captions for images, tables, and so on.
Makes the variable `$include-captions` available in style sheets and includes the following rule by
default:
~~~sass
caption {
display: if($include-captions, block, none);
}
~~~</p>
</p:documentation></p:option><p:optionname="include-images"required="false"px:type="boolean"select="'true'"><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Block elements: Include images</h2><ppx:role="desc"xml:space="preserve">When enabled, will include the alt text of the images. When disabled, the images will be completely removed.
Makes the variable `$include-images` available in style sheets and includes the following rule by
default:
~~~sass
@if $include-images {
img::after {
content: attr(alt);
}
}
~~~</p>
</p:documentation></p:option><p:optionname="include-line-groups"required="false"px:type="boolean"select="'true'"><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Block elements: Include line groups</h2><ppx:role="desc"xml:space="preserve">When disabled, lines in a linegroup are joined together to form one block.
Makes the variable `$include-line-groups` available in style sheets and includes the following rule
by default:
~~~sass
.linegroup .line {
display: if($include-line-groups, block, inline);
}
~~~</p>
</p:documentation></p:option><p:optionname="include-production-notes"required="false"px:type="boolean"select="'false'"><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Inline elements: Include production notes</h2><ppx:role="desc"xml:space="preserve">When enabled, production notes are included in the content.
Makes the variable `$include-production-notes` available in style sheets and includes the following
rule by default:
~~~sass
.prodnote,
[epub|type~='z3998:production'] {
display: if($include-production-notes, block, none);
}
~~~</p>
</p:documentation></p:option><p:optionname="show-braille-page-numbers"required="false"px:type="boolean"select="'true'"><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Page numbers: Show braille page numbers</h2><ppx:role="desc"xml:space="preserve">When enabled, will number braille pages.
Makes the variable `$show-braille-page-numbers` available in style sheets. In order to use the
variable include a rule like the following in your custom style sheet:
~~~sass
@if $show-braille-page-numbers {
@page {
@top-right {
content: counter(page);
}
}
}
~~~
This will create a page number in the top right corner of every braille page.
See the CSS specification for more info:
- the [`@page`](http://braillespecs.github.io/braille-css/#h4_the-page-rule) rule
- the
[`counter()`](http://braillespecs.github.io/braille-css/#printing-counters-the-counter-function)
function
</p>
</p:documentation></p:option><p:optionname="show-print-page-numbers"required="false"px:type="boolean"select="'true'"><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Page numbers: Show print page numbers</h2><ppx:role="desc"xml:space="preserve">When enabled, will indicate original page numbers.
Makes the variable `$show-print-page-numbers` available in style sheets and includes the following
rule by default:
~~~sass
@if $show-print-page-numbers {
.page-front,
.page-normal,
.page-special,
[epub|type='pagebreak'] {
string-set: print-page attr(title);
}
}
~~~
In order to use the `print-page` string include a rule like the following in your custom style
sheet:
~~~css
@page {
@bottom-right {
content: string(print-page);
}
}
~~~
See the CSS specification for more info:
- the [`string-set`](http://braillespecs.github.io/braille-css/#h4_the-string-set-property) property
- the [`@page`](http://braillespecs.github.io/braille-css/#h4_the-page-rule) rule
- the [`string()`](http://braillespecs.github.io/braille-css/#h4_the-string-function) function
</p>
</p:documentation></p:option><p:optionname="force-braille-page-break"required="false"px:type="boolean"select="'false'"><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Page numbers: Force braille page break</h2><ppx:role="desc"xml:space="preserve">Force braille page breaks at print page breaks.
Makes the variable `$force-braille-page-break` available in style sheets and includes the following
rule by default:
~~~sass
@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:
- the [`page-break-before`](http://braillespecs.github.io/braille-css/#h4_controlling-page-breaks)
property
</p>
</p:documentation></p:option><p:optionname="toc-depth"required="false"px:type="integer"select="'0'"><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Table of contents: Table of contents depth</h2><ppx:role="desc"xml:space="preserve">The depth of the table of contents hierarchy to include. '0' means no table of contents.
A table of contents will be generated from the heading elements present in the document: from `h1`
elements if the specified value for "depth" is 1, from `h1` and `h2` elements if the specified value
is 2, etc. The resulting table of contents has the following nested structure:
~~~xml
<ol id="generated-document-toc">
<li>
<a href="#ch_1" title="Chapter 1">Chapter 1</a>
<ol>
<li>
<a href="#ch_1_1" title="1.1">1.1</a>
...
</li>
<li>
<a href="#ch_1_2" title="1.2">1.2</a>
...
</li>
...
</ol>
</li>
...
</ol>
~~~
Another one of these is generated but with ID `generated-volume-toc`. `ch_1`, `ch_1_2` etc. are the
IDs of the heading elements from which the list was constructed, and the content of the links are
exact copies of the content of the heading elements. By default the list is not rendered. The list
should be styled and positioned with CSS. The following rules are included by default:
~~~css
#generated-document-toc {
flow: document-toc;
display: -obfl-toc;
-obfl-toc-range: document;
}
#generated-volume-toc {
flow: volume-toc;
display: -obfl-toc;
-obfl-toc-range: volume;
}
~~~
This means that a document range table of contents is added to the named flow called "document-toc",
and a volume range table of contents is added to the named flow called "volume-toc". In order to
consume these named flows use the function `flow()`. For example, to position the document range
table of contents at the beginning of the first volume, and to repeat the volume range table of
content at the beginning of every other volume, include the following additional rules:
~~~css
@volume {
@begin {
content: flow(volume-toc, document);
}
}
@volume:first {
@begin {
content: flow(document-toc, document);
}
}
~~~
See the CSS specification for more info:
- the [`display:
obfl-toc`](http://braillespecs.github.io/braille-css/obfl#extending-the-display-property-with--obfl-toc)
value
- the [`flow`](http://braillespecs.github.io/braille-css/#the-flow-property) property
- the [`flow()`](http://braillespecs.github.io/braille-css/#h4_the-flow-function) function
- the [`@volume`](http://braillespecs.github.io/braille-css/#h3_the-volume-rule) rule
- the [`@begin`](http://braillespecs.github.io/braille-css/#h3_the-begin-and-end-rules) rule
</p>
</p:documentation></p:option><p:optionname="toc-exclude-class"required="false"px:type="string"select="''"><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Table of contents: Exclude headings</h2><ppx:role="desc"xml:space="preserve">Class name for excluding headings from the table of contents.
If specified, heading elements with this class name are excluded from the generated tables of contents.</p>
</p:documentation></p:option><p:optionname="maximum-number-of-sheets"required="false"px:type="integer"select="'70'"><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Volumes: Maximum number of sheets</h2><ppx:role="desc"xml:space="preserve">The maximum number of sheets in a volume.
Makes the variable `$maximum-number-of-sheets` available in style sheets and includes the following
rule by default:
~~~sass
@volume {
max-length: $maximum-number-of-sheets;
}
~~~
See the CSS specification for more info:
- the [`@volume`](http://braillespecs.github.io/braille-css/#h3_the-volume-rule) rule
- the [`max-length`](http://braillespecs.github.io/braille-css/#h3_the-length-properties) property
</p>
</p:documentation></p:option><p:optionname="allow-volume-break-inside-leaf-section-factor"required="false"px:type="integer"select="'10'"><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Volumes: Allow breaks within sections.</h2><ppx:role="desc"xml:space="preserve">Amount with which volume breaks are allowed within sections.
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.</p>
</p:documentation></p:option><p:optionname="prefer-volume-break-before-higher-level-factor"required="false"select="'0'"><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Volumes: Prefer breaks at higher level sections.</h2><ppx:role="desc"xml:space="preserve">Amount with which preference is given to volume breaks before higher level sections.
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.</p>
</p:documentation></p:option><p:optionname="notes-placement"required="false"select="'end-of-book'"><p:pipeinfo><px:type>
<choice>
<value>bottom-of-page</value>
<documentationxml:lang="en"xml:space="preserve">At the bottom of the page
Notes are rendered in the [`@footnotes`](http://braillespecs.github.io/braille-css/#the-footnotes-area)
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:
~~~css
@page {
@footnotes {
border-top: ⠤;
max-height: 20;
}
}
~~~
</documentation>
<value>end-of-block</value>
<documentationxml:lang="en"xml:space="preserve">At the end of the block
Notes are rendered after the block (e.g. paragraph) in which they occur.
</documentation>
<value>end-of-chapter</value>
<documentationxml:lang="en"xml:space="preserve">At the end of the chapter
Notes are rendered at the end of the chapter (`section`) in which they occur.
</documentation>
<value>end-of-volume</value>
<documentationxml:lang="en"xml:space="preserve">At the end of the volume
Notes are rendered in the [`@end`](http://braillespecs.github.io/braille-css/#the-footnotes-area) area of
the volume in which they occur.
</documentation>
<value>end-of-book</value>
<documentationxml:lang="en"xml:space="preserve">At the end of the book
Notes are rendered in the [`@end`](http://braillespecs.github.io/braille-css/#the-footnotes-area) area of
the last volume.
Notes can be grouped by volume using a
[`.endnotes-section::-obfl-on-volume-start`](http://braillespecs.github.io/braille-css/obfl#extending-the-display-property-with--obfl-list-of-references)
rule. Example:
~~~css
.endnotes-section::-obfl-on-volume-start {
content: "Notes in volume " -obfl-evaluate("$started-volume-number");
margin: 1 0;
}
~~~
</documentation>
<value>custom</value>
<documentationxml:lang="en"xml:space="preserve">Custom handling
Special handling of notes is disabled. Notes are rendered as specified in custom style sheets.
</documentation>
</choice>
</px:type></p:pipeinfo><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Placement of content: Notes placement</h2><ppx:role="desc"xml:space="preserve">Placement of notes
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:
~~~css
.endnotes-section::-obfl-on-collection-start {
content: "Notes in this volume";
text-align: center;
margin-bottom: 1;
}
~~~
</p>
</p:documentation></p:option><p:optionname="output-dir"required="true"px:output="result"px:type="anyDirURI"px:media-type="text"><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Output file</h2><ppx:role="desc">The output braille file.</p>
</p:documentation></p:option><p:optionname="pef-output-dir"required="false"px:output="result"px:type="anyDirURI"px:media-type="application/x-pef+xml"select="''"><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">PEF</h2><ppx:role="desc">The intermediary PEF file.</p>
</p:documentation></p:option><p:optionname="preview-output-dir"required="false"px:output="result"px:type="anyDirURI"px:media-type="text/html"select="''"><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Preview</h2><ppx:role="desc">An HTML preview of the braille result.</p>
</p:documentation></p:option><p:optionname="obfl-output-dir"required="false"px:output="result"px:type="anyDirURI"px:media-type="text/html"select="''"><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">OBFL</h2><ppx:role="desc">The intermediary OBFL file.</p>
</p:documentation></p:option>
<p:importhref="http://www.daisy.org/pipeline/modules/braille/common-utils/library.xpl">
<p:documentation>
px:delete-parameters
px:parse-query
</p:documentation>
</p:import>
<p:importhref="http://www.daisy.org/pipeline/modules/braille/html-to-pef/library.xpl">
<p:documentation>
px:html-to-pef
px:html-to-pef.store
</p:documentation>
</p:import>
<p:importhref="http://www.daisy.org/pipeline/modules/file-utils/library.xpl">
<p:documentation>
px:tempdir
</p:documentation>
</p:import>
<p:importhref="http://www.daisy.org/pipeline/modules/fileset-utils/library.xpl">
<p:documentation>
px:fileset-add-entry
</p:documentation>
</p:import>
<p:importhref="http://www.daisy.org/pipeline/modules/html-utils/library.xpl">
<p:documentation>
px:html-load
</p:documentation>
</p:import>
<p:in-scope-namesname="in-scope-names"/>
<px:delete-parametersname="input-options"px:message="Collecting parameters"px:message-severity="DEBUG"px:progress=".01"parameter-names="html stylesheet stylesheet-parameters transform braille-code output-file-format include-pef include-preview include-obfl output-dir pef-output-dir preview-output-dir obfl-output-dir temp-dir">
<p:inputport="source">
<p:pipeport="result"step="in-scope-names"/>
</p:input>
</px:delete-parameters>
<p:sink/>
<px:parse-queryname="stylesheet-parameters">
<p:with-optionname="query"select="$stylesheet-parameters"/>
</px:parse-query>
<p:sink/>
<px:tempdirname="temp-dir"px:message="Creating temporary directory"px:message-severity="DEBUG"px:progress=".01">
<p:with-optionname="href"select="if ($temp-dir!='') then $temp-dir else $output-dir"/>
</px:tempdir>
<px:fileset-add-entrymedia-type="application/xhtml+xml">
<p:inputport="source">
<p:inline><d:fileset/></p:inline>
</p:input>
<p:with-optionname="href"select="$html"/>
</px:fileset-add-entry>
<px:html-loadname="html"px:message="Loading HTML"px:progress=".03"/>
<px:html-to-pefname="convert"px:message="Converting from HTML to PEF"px:progress=".90">
<p:inputport="source.in-memory">
<p:pipestep="html"port="result.in-memory"/>
</p:input>
<p:with-optionname="temp-dir"select="concat(string(/c:result),'convert/')">
<p:pipestep="temp-dir"port="result"/>
</p:with-option>
<p:with-optionname="stylesheet"select="$stylesheet"/>
<p:with-optionname="transform"select="concat($braille-code,($transform,'(translator:liblouis)(formatter:dotify)')[not(.='')][1])"/>
<p:with-optionname="include-obfl"select="$include-obfl"/>
<p:inputport="parameters">
<p:pipeport="result"step="input-options"/>
<p:pipeport="result"step="stylesheet-parameters"/>
</p:input>
</px:html-to-pef>
<px:html-to-pef.storepx:message="Storing results"px:progress=".05">
<p:inputport="obfl">
<p:pipestep="convert"port="obfl"/>
</p:input>
<p:inputport="html">
<p:pipestep="html"port="result.in-memory"/>
</p:input>
<p:with-optionname="include-pef"select="$include-pef"/>
<p:with-optionname="include-preview"select="$include-preview"/>
<p:with-optionname="output-file-format"select="$output-file-format"/>
<p:with-optionname="preview-table"select="$preview-table"/>
<p:with-optionname="output-dir"select="$output-dir"/>
<p:with-optionname="pef-output-dir"select="$pef-output-dir"/>
<p:with-optionname="preview-output-dir"select="$preview-output-dir"/>
<p:with-optionname="obfl-output-dir"select="$obfl-output-dir"/>
</px:html-to-pef.store>
</p:declare-step>