<p:declare-stepxmlns:p="http://www.w3.org/ns/xproc"xmlns:px="http://www.daisy.org/ns/pipeline/xproc"xmlns:pf="http://www.daisy.org/ns/pipeline/functions"xmlns:d="http://www.daisy.org/ns/pipeline/data"xmlns:c="http://www.w3.org/ns/xproc-step"xmlns:cx="http://xmlcalabash.com/ns/extensions"xmlns:xs="http://www.w3.org/2001/XMLSchema"xmlns:map="http://www.w3.org/2005/xpath-functions/map"xmlns:pef="http://www.daisy.org/ns/2008/pef"type="px:html-to-pef.script"version="1.0"exclude-inline-prefixes="#all"name="main"px:input-filesets="html"px:output-filesets="pef">
<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>
<address>
Authors:
<dlpx:role="author">
<dt>Name:</dt>
<ddpx:role="name">Jostein Austvik Jacobsen</dd>
<dt>E-mail:</dt>
<dd><apx:role="contact"href="mailto:josteinaj@gmail.com">josteinaj@gmail.com</a></dd>
<dt>Organization:</dt>
<ddpx:role="organization"href="http://www.nlb.no/">NLB</dd>
</dl>
</address>
</p:documentation>
<p:inputport="source"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:input><p:outputport="status"px:media-type="application/vnd.pipeline.status+xml">
<p:pipestep="convert-and-store"port="status"/>
</p:output><p:optionname="braille-code"px:type="liblouis-table-query"required="false"select="''"px:reusable="false"><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 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.</p>
</p:documentation></p:option><p:optionname="formatting-standard"select="''"px:reusable="false"><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Formatting standard</h2><ppx:role="desc"xml:space="preserve">Standard to be used for braille formatting.
If set, [braille formatting](http://daisy.github.io/pipeline/Get-Help/User-Guide/Braille/) is done
using the selected formatting standard. If left empty, the formatting of the document is determined
entirely by custom styles.
It is important to understand that when no formatting standard or custom style sheets are specified,
the output will not be formatted (meaning everything will be aligned to the left, without blank
lines, pages will be filled completely, and there will be no page numbering).
Custom formatting rules may be specified using the "Custom style sheets" option, or in style sheets
attached to the source document.</p>
</p:documentation>
<p:pipeinfo>
<px:type>
<choicexmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">
<value/>
<a:documentationxml:lang="en">-</a:documentation>
<value>https://raw.githubusercontent.com/daisy/braille-stylesheets/refs/heads/main/bana/bana.scss</value>
<a:documentationxml:lang="en"xml:space="preserve">United States and Canada (BANA)
The document is formatted according to the rules of the [Braille Authority of North America
(BANA)](https://www.brailleauthority.org/). [UEB](https://iceb.org/) is used as the braille code for
all text.
Equivalent to specifying the value
`https://raw.githubusercontent.com/daisy/braille-stylesheets/refs/heads/main/bana/bana.scss` for the
"Custom style sheets" option.
See the [online documentation](https://daisy.github.io/braille-stylesheets/bana/) for more information.
</a:documentation>
</choice>
</px:type>
</p:pipeinfo>
</p:option><p:optionxmlns:_="embossed"name="_:stylesheet"required="false"px:type="anyURI"select="''"px:sequence="true"px:separator=" "px:reusable="true"px:media-type="text/css text/x-scss">
<p:documentationxmlns="http://www.w3.org/1999/xhtml"><h2px:role="name">Style sheets</h2><ppx:role="desc"xml:space="preserve">CSS/Sass style sheets to take into account.
Each style sheet must be specified as a URI, absolute or relative to the input.
Style sheets specified through this option or through the "Formatting standard" 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/)). Only author styles that apply to "embossed"
media are taken into account.
All style sheets are applied at once, but the order in which they are specified has an influence on
the [cascading order](https://www.w3.org/TR/CSS2/cascade.html#cascading-order). Author styles take
precedence over user styles, and user style sheets specified through this option take precedence
over the selected formatting standard.
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/_generate-toc.scss](http://daisy.github.io/pipeline/modules/braille/html-to-pef/src/main/resources/css/generate-toc):
for generating a table of content
- [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
- [http://www.daisy.org/pipeline/modules/braille/html-to-pef/_legacy.scss](http://daisy.github.io/pipeline/modules/braille/html-to-pef/src/main/resources/css/_legacy.scss/):
collection of styles that used to be included by default
</p>
</p:documentation>
</p:option><p:optionname="stylesheet-parameters"cx:as="xs:string*"required="false"px:type="stylesheet-parameters"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 user style sheets (specified through options) or author style sheets
(associated with the source), may have parameters (Sass variables). This option, which takes a
comma-separated list of key-value pairs enclosed in parenthesis, can be used to set these variables.
For example, if a style sheet uses the Sass variable "foo":
~~~sass
@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)`.</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-pdf"required="false"px:type="boolean"select="'false'"><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Include PDF</h2><ppx:role="desc"xml:space="preserve">Whether or not to include a PDF version of the braille result showing ASCII braille.</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).
[PEF (Portable Embosser Format)](https://braillespecs.github.io/pef/pef-specification.html) is an
internal data format used by DAISY Pipeline to represent the final formatted braille document,
before it is converted to another embosser-ready format.</p>
</p:documentation></p:option><p:optionname="include-obfl"required="false"px:type="boolean"select="'false'"><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Include OBFL</h2><ppx:role="desc"xml:space="preserve">Whether or not the keep the intermediary OBFL file (for debugging).
[OBFL (Open Braille Formatting Language)](https://mtmse.github.io/obfl/obfl-specification.html) is
an internal data format used by DAISY Pipeline to represent an intermediary stage of the document
being transformed (before it is formatted).
The OBFL file may be used for debugging, or it may also be edited and re-transformed to the final
braille document using the "OBFL to braille" script.</p>
</p:documentation></p:option><p:optionname="include-css"px:type="boolean"select="'false'">
<p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Include HTML with inline CSS</h2><ppx:role="desc"xml:space="preserve">Whether or not the include the intermediary HTML with all CSS styles inlined (for debugging).</p>
</p:documentation>
</p:option><p:optionname="output-file-format"required="false"px:type="medium"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.
The file format must be expressed in the media query syntax. For example, to select a file format
suited for the U.S., set the option to `(-daisy-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
`(-daisy-locale: nl) AND (-daisy-file-extension: \.brl)`.
If left blank, the braille will be stored in
[PEF](https://braillespecs.github.io/pef/pef-specification.html) (Portable Embosser Format).</p>
</p:documentation></p:option><p:optionname="preview-table"required="false"px:type="preview-table"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 and PDF previews.
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="pdf-offset-x"required="false"select="'0'"><p:pipeinfo><px:type>
<dataxmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"type="string">
<a:documentationxml:lang="en"xml:space="preserve">A positive or negative length
The syntax is as follows (described in terms of [CSS grammar](https://www.w3.org/TR/CSS21/grammar.html)):
length
: '0' | unary_operator number unit
;
unit
: 'mm' | 'cm' | 'in' | 'px'
;
</a:documentation>
<paramname="pattern">^0|[+-]?([0-9]*\.)?[0-9]+([eE][+-]?[0-9]+)?(mm|cm|in|px)?$</param>
</data>
</px:type></p:pipeinfo><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">PDF: horizontal offset</h2><ppx:role="desc"xml:space="preserve">Tweak the position of content on the page horizontally.
A positive offset results in a shift to the right, a negative offset results in a shift to the left.</p>
</p:documentation></p:option><p:optionname="pdf-offset-y"required="false"select="'0'"><p:pipeinfo><px:type>
<dataxmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"type="string">
<a:documentationxml:lang="en"xml:space="preserve">A positive or negative length
The syntax is as follows (described in terms of [CSS grammar](https://www.w3.org/TR/CSS21/grammar.html)):
length
: '0' | unary_operator number unit
;
unit
: 'mm' | 'cm' | 'in' | 'px'
;
</a:documentation>
<paramname="pattern">^0|[+-]?([0-9]*\.)?[0-9]+([eE][+-]?[0-9]+)?(mm|cm|in|px)?$</param>
</data>
</px:type></p:pipeinfo><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">PDF: vertical offset</h2><ppx:role="desc"xml:space="preserve">Tweak the position of content on the page vertically.
A positive offset results in a shift downwards, a negative offset results in a shift upwards.</p>
</p:documentation></p:option><p:optionname="pdf-scale-font"required="false"select="'100%'"><p:pipeinfo><px:type>
<dataxmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"type="string">
<a:documentationxml:lang="en"xml:space="preserve">A percentage</a:documentation>
<paramname="pattern">^[+]?([0-9]*\.)?[0-9]+%?$</param>
</data>
</px:type></p:pipeinfo><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">PDF: scale font</h2><ppx:role="desc"xml:space="preserve">Tweak the size of the font.
Increase or decrease the font of the PDF by providing a scaling factor higher or lower than 100%.</p>
</p:documentation></p:option><p:optionname="pdf-font-color"required="false"select="'#000000'"><p:pipeinfo><px:type>
<dataxmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"type="string">
<a:documentationxml:lang="en"xml:space="preserve">An RGB hex color code</a:documentation>
<paramname="pattern">^#([0-9a-f]{6}|[0-9A-F]{6}|[0-9a-f]{3}|[0-9A-F]{3})$</param>
</data>
</px:type></p:pipeinfo><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">PDF: font color</h2><ppx:role="desc"xml:space="preserve">The font color of the PDF.
Defaults to black.</p>
</p:documentation></p:option><p:optionname="page-width"required="false"select="()"cx:as="xs:string?"px:role="media-feature"><p:pipeinfo><px:type>
<dataxmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"type="string">
<a:documentationxml:lang="en"xml:space="preserve">A length
The syntax is as follows (described in terms of [CSS grammar](https://www.w3.org/TR/CSS21/grammar.html)):
length
: number unit?
;
unit
: 'mm' | 'cm' | 'in' | 'px' | 'ch'
;
</a:documentation>
<paramname="pattern">^+?([0-9]*\\.)?[0-9]+([eE][+-]?[0-9]+)?(mm|cm|in|px|ch)?$</param>
</data>
</px:type></p:pipeinfo><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Page width</h2><ppx:role="desc"xml:space="preserve">The width of the targeted medium.
Sets the default page width, and affects media queries that use the 'width' and 'device-width' media
features. The 'width' media feature describes the width of the targeted display area, i.e. the
printable area of the page. The 'device-width' media feature describes the total width of the
rendering surface, i.e. the page width.
Note that the default page width may be overwritten with `@page` rules, but this does not
affect media queries.
The width may be specified in an absolute (`mm`, `cm`, `in`, ...) or cell-relative (`ch`)
length. A dimension without a unit is interpreted as a multiple of the braille cell width.
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"select="()"cx:as="xs:string?"px:role="media-feature"><p:pipeinfo><px:type>
<dataxmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"type="string">
<a:documentationxml:lang="en"xml:space="preserve">A length
The syntax is as follows (described in terms of [CSS grammar](https://www.w3.org/TR/CSS21/grammar.html)):
length
: number unit?
;
unit
: 'mm' | 'cm' | 'in' | 'px' | 'em'
;
</a:documentation>
<paramname="pattern">^+?([0-9]*\.)?[0-9]+([eE][+-]?[0-9]+)?(mm|cm|in|px|em)?$</param>
</data>
</px:type></p:pipeinfo><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Page height</h2><ppx:role="desc"xml:space="preserve">The height of the targeted medium.
Sets the default page height, and affects media queries that use the 'height' and 'device-height'
media features. The 'height' media feature describes the height of the targeted display area,
i.e. the printable area of the page. The 'device-height' media feature describes the total height of
the rendering surface, i.e. the page height.
The height may be specified in an absolute (`mm`, `cm`, `in`, ...) or cell-relative (`em`)
length. A dimension without a unit is interpreted as a multiple of the braille cell height.
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"select="()"cx:as="xs:boolean?"px:role="media-feature"><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Duplex</h2><ppx:role="desc"xml:space="preserve">Whether to print on both sides of the leaves.
Sets the number of printed sides per leaf, and affects media queries that use the '-daisy-duplex'
media feature.</p>
</p:documentation></p:option><p:optionname="saddle-stitch"required="false"select="()"cx:as="xs:boolean?"px:role="media-feature"><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Saddle stitch (folio binding)</h2><ppx:role="desc"xml:space="preserve">Whether the targeted medium is bound in folios.
In this mode, sheets of paper are folded once to produce two leaves (four pages). This option
affects media queries that use the '-daisy-saddle-stitch' media feature.</p>
</p:documentation></p:option><p:optionname="hyphenation-at-page-breaks"required="false"select="'false'"><p:pipeinfo><px:type>
<choicexmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">
<value>false</value>
<a:documentationxml:lang="en">Never hyphenate words at page boundaries</a:documentation>
<value>except-at-volume-breaks</value>
<a:documentationxml:lang="en">Allow hyphenation at page boundaries except when it's a volume boundary</a:documentation>
<value>true</value>
<a:documentationxml:lang="en">Allow hyphenation at page boundaries</a:documentation>
</choice>
</px:type></p:pipeinfo><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Hyphenation at page boundaries</h2><ppx:role="desc"xml:space="preserve">Whether hyphenation of words at page boundaries is allowed or not.
This option only determines whether hyphenation is allowed at page boundaries. The "Hyphenation"
option and the CSS determine how the hyphenation is done, when allowed.
</p>
</p:documentation></p:option><p:optionname="allow-text-overflow-trimming"px:type="boolean"required="false"select="'false'"><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Trimming of overflowing text</h2><ppx:role="desc"xml:space="preserve">Allow trimming of overflowing text.
By default, text that overflows its containing box will result in an error. By selecting this
option, overflowing text will be truncated and generate a warning instead whenever
possible. Notably, this will happen with text within page margins (top, right, bottom and left) that
is too long to fit the space.
</p>
</p:documentation></p:option><p:optionname="result"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"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"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="pdf"required="false"px:output="result"px:type="anyDirURI"px:media-type="application/pdf"select="''"><p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">PDF</h2><ppx:role="desc">A PDF version of the braille showing ASCII braille.</p>
</p:documentation></p:option><p:optionname="obfl"required="false"px:output="result"px:type="anyDirURI"px:media-type="application/x-obfl+xml"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:optionname="html-with-css"px:output="result"px:type="anyDirURI"px:media-type="application/xhtml+xml"select="''">
<p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">HTML with inline CSS</h2><ppx:role="desc">The intermediary HTML file with inline CSS.</p>
</p:documentation>
</p:option>
<p:importhref="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/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>
<cx:importhref="http://www.daisy.org/pipeline/modules/css-utils/library.xsl"type="application/xslt+xml">
<p:documentation>
pf:css-parse-medium
</p:documentation>
</cx:import>
<cx:importhref="http://www.daisy.org/pipeline/modules/braille/pef-utils/library.xsl"type="application/xslt+xml">
<p:documentation>
pf:pef-assert-embossable
</p:documentation>
</cx:import>
<p:sink/>
<px:fileset-add-entrymedia-type="application/xhtml+xml"name="source">
<p:inputport="source.fileset">
<p:inline><d:fileset/></p:inline>
</p:input>
<p:inputport="entry">
<p:pipestep="main"port="source"/>
</p:input>
</px:fileset-add-entry>
<px:html-loadname="html"px:message="Loading HTML"px:progress=".04"warn-on-missing-files="false">
<p:inputport="source.in-memory">
<p:pipestep="source"port="result.in-memory"/>
</p:input>
<p:with-optionname="handle-xinclude"select="$handle-xinclude='true'"/>
</px:html-load>
<p:groupname="convert-and-store"px:progress=".96">
<p:outputport="status">
<p:pipestep="convert"port="status"/>
</p:output>
<p:variablename="medium"select="pf:pef-assert-embossable( pf:css-parse-medium(( ($output-file-format,'embossed AND (-daisy-format:pef)')[not(.='')][1], map:merge(( for $page-width in $page-width return map:entry('device-width',$page-width), for $page-height in $page-height return map:entry('device-height',$page-height), for $duplex in $duplex return map:entry('duplex',$duplex), for $saddle-stitch in $saddle-stitch return map:entry('saddle-stitch',$saddle-stitch), map:entry('-daisy-document-locale',(/*/@xml:lang,/*/@lang,'und')[1]))))))">
<p:pipestep="main"port="source"/>
</p:variable>
<px:html-to-pefname="convert"px:message="Converting from HTML to PEF"px:progress="90/96">
<p:inputport="source.in-memory">
<p:pipestep="html"port="result.in-memory"/>
</p:input>
<p:with-optionname="temp-dir"select="concat($temp-dir,'convert/')"/>
<p:with-optionxmlns:_="embossed"name="stylesheet"select="string-join(($formatting-standard,$_:stylesheet),' ')"/>
<p:with-optionname="parameters"select="($stylesheet-parameters, map:merge(( for $page-width in $page-width return map:entry('page-width',$page-width), for $page-height in $page-width return map:entry('page-height',$page-height), for $duplex in $duplex return map:entry('duplex',$duplex), for $saddle-stitch in $saddle-stitch return map:entry('saddle-stitch',$saddle-stitch), map:entry('hyphenation-at-page-breaks',$hyphenation-at-page-breaks), map:entry('allow-text-overflow-trimming',$allow-text-overflow-trimming))))"/>
<p:with-optionname="transform"select="concat($braille-code,($transform,'(translator:liblouis)(formatter:dotify)')[not(.='')][1])"/>
<p:with-optionname="medium"select="$medium"/>
<p:with-optionname="include-obfl"select="$include-obfl"/>
</px:html-to-pef>
<px:html-to-pef.storepx:progress="6/96">
<p:inputport="obfl">
<p:pipestep="convert"port="obfl"/>
</p:input>
<p:inputport="html">
<p:pipestep="html"port="result.in-memory"/>
</p:input>
<p:inputport="css">
<p:pipestep="convert"port="css"/>
</p:input>
<p:with-optionname="include-pef"select="$include-pef"/>
<p:with-optionname="include-preview"select="$include-preview"/>
<p:with-optionname="include-pdf"select="$include-pdf"/>
<p:with-optionname="include-css"select="$include-css"/>
<p:with-optionname="medium"select="$medium"/>
<p:with-optionname="preview-table"select="$preview-table"/>
<p:with-optionname="pdf-offset-x"select="$pdf-offset-x"/>
<p:with-optionname="pdf-offset-y"select="$pdf-offset-y"/>
<p:with-optionname="pdf-scale-font"select="$pdf-scale-font"/>
<p:with-optionname="pdf-font-color"select="$pdf-font-color"/>
<p:with-optionname="output-dir"select="$result"/>
<p:with-optionname="pef-output-dir"select="$pef"/>
<p:with-optionname="preview-output-dir"select="$preview"/>
<p:with-optionname="pdf-output-dir"select="$pdf"/>
<p:with-optionname="obfl-output-dir"select="$obfl"/>
<p:with-optionname="css-output-dir"select="$html-with-css"/>
</px:html-to-pef.store>
</p:group>
</p:declare-step>