default

ReSpec to EPUB

f
convert

The top level entry in the package: convert a single Respec file, or a collection thereof, into an EPUB document.

c
OCF

Convenience class to export the internal OCF class for the package as a whole. Conversion methods or functions return an instance of this class, containing the generated EPUB content.

c
RespecToEPUB

Convenience class, to export the internal RespecToEPUB class for the package as a whole. (This is only useful if, for some reasons, the conversion is done starting with a DOM tree, using create_epub_from_dom. In general, convert should be used).

lib/common.ts

Global constants used at various places.

v
acceptable_url_endings

Acceptable endings for document URL-s. We try to avoid cases when the relative URL calculations go wrong

I
ConfigOptions

Config options, to be used as part of the arguments in [[Options]] to overwrite the configuration options of ReSpec.

v
entity_codes

Entity/code pairs: the XHTML conversion is supposed to remove the XML entities (if used) to their code alternatives.

v
ENV_MODIFIED_FILE_LOCATION

Environmental variable name for the location of external copies of some css and image files

E
Environment
No documentation available
v
environment

Flag to decide whether the code runs in a browser, in Deno, or in node.js.

f
finalize_style_constants
No documentation available
v
fixup_js

Generic 'fixup' script (used for warnings for rescinded or obsolete versions).

v
invalid_host_names

Invalid host names (essentially "localhost" and friends); unless explicitly set in the environment, these are considered to be unsafe. This is important for server deployment: servers should never accept these host names

v
local_icons
No documentation available
v
local_port_number

Default port number for the server locally. Set to the default HTTP port number; the environment variable PORT may, however, overwrite this for a server.

v
local_style_files

Local (relative) URL for styles and logos

v
media_types

Various media types used in the code.

I
MediaType
No documentation available
v
modified_epub_files

Base URL for the W3C files (like base.css, logos in SVG format) modified for EPUB.

I
Options

Options provided by the user if and when the source has to be pre-processed via ReSpec.

v
process_2021_date

Cut-off date for the publication process change

v
process_version

Process version being used

v
spec_generator

URL of the spec generator service, used if the source has to be transformed via respec first.

v
spec_status_values

Valid Spec Status values

v
text_content

These media types refer to textual content, no reason to bother about streaming when fetching them...

v
TR_css_files

Base URL for the official W3C css files (only the non-SVG ones are used directly).

v
tr_epub_css

Extra CSS file for EPUB content; mainly used to adapt and, possibly, to compensate the effects of the main CSS file. The features are

v
TR_logo_files

Base URL for the official W3C logos (only the non-SVG ones are used directly).

v
W3C_icons

Generic ICON directory on the W3C site

v
wcag_checked

Document types that are supposed to be WCAG A level due to the W3C publication check.

lib/convert.ts

Main entry points

lib/cover.ts

Cover page

v
cover_svg

The SVG template to be used for the cover image.

f
create_cover_image

Create the cover image: it is an SVG file with title, the type of the document, date, and a W3C Logo.

lib/css2016.ts

CSS files (for the 2016 version of the Process)

f
extract_css

Extract/add the right CSS references and gathers all resources (logo files, watermark image, etc.) to be added to the overall set of resources in the final book. Note that the HTML DOM of the main file is modified on the fly:

lib/css2021.ts

CSS files (for the 2021 version of the Process)

f
extract_css

Extract/add the right CSS references and gathers all resources (logo files, watermark image, etc.) to be added to the overall set of resources in the final book. Note that the HTML DOM of the main file is modified on the fly:

lib/defontSvg.ts

Handle a nasty bug in some SVG files

f
deFontSvg

Replace all occurrences of the <font> element in the SVG file by a <span>.

f
fetch_html

Fetch an HTML file via [[fetch_resource]] and parse the result into a DOM instance.

f
fetch_json

Fetch an JSON file via [[fetch_resource]] and parse the result into an object.

f
fetch_resource

Fetch a resource.

f
fetch_type

Fetch the media type of the resource.

lib/home.ts

Service home page

v
homepage
No documentation available

lib/nav.ts

Navigation File

f
create_nav_file

Create a navigation file, and return the necessary resource (to be added to the overall set of resources).

lib/ocf.ts

OCF Package

c
OCF

The class representing the EPUB 3.4 OCF package.

lib/opf.ts

The OPF package

I
Collection

Representations of the "collections" element

I
CollectionMetadata

The minimal metadata, used in collections

I
Package

Encoding of the XML structure of the package file in JSON; simply a wrapper around [[PackageContent]].

lib/overview.ts

Generate the Overview.xhtml entry

f
generate_overview_item

Generate the resource entry for the Overview.xhtml item into the package; that includes setting the various manifest item properties (see manifest item properties).

lib/title.ts

Title page

f
create_title_page

Create the cover page: it is an XHTML file with title, editors, copyright information, and a disclaimer whereby the EPUB version of the document is not authoritative.

lib/utils.ts

Some common utilities

f
date_to_string

Convert an ISO formatted date to a more readable format.

f
de_xml

Remove any XML/HTML tags from the input; <br/> tags are replaced by space and all other tags are removed.

f
remove_entities

Filter XML entities in an xhtml code, and turn them into their equivalent hexadecimal Unicode point

f
slice_text

“Slice” a long text into lines separated by the (HTML) <br/> tag. Used as a rudimentary tool when adding the title lines to an SVG content.

f
to_xhtml

Convert an HTML5 content (in text or as a DOM) into XHTML5.