Categorygithub.com/readium/go-toolkit
module
0.4.4
Repository: https://github.com/readium/go-toolkit.git
Documentation: pkg.go.dev

# README

Readium Go Toolkit

More documentation coming soon! Things are changing too quickly right now.

For development, run go run cmd/server/main.go to start the server, which by default listens on 127.0.0.1:5080. Check out the example configuration file for configuration options.

Command line utility

The rwp command provides utilities to parse and generate Web Publications.

To install rwp in ~/go/bin, run make install. Use make build to build the binary in the current directory.

Generating a Readium Web Publication Manifest

The rwp manifest command will parse a publication file (such as EPUB, PDF, audiobook, etc.) and build a Readium Web Publication Manifest for it. The JSON manifest is printed to stdout.

Examples:

  • Print out a compact JSON RWPM.
    rwp manifest publication.epub
    
  • Pretty-print a JSON RWPM using two-space indent.
    rwp manifest --indent "  " publication.epub
    
  • Extract the publication title with jq.
    rwp manifest publication.epub | jq -r .metadata.title
    

Accessibility inference

rwp manifest can infer additional accessibility metadata when they are missing, with the --infer-a11y flag. It takes one of the following arguments:

OptionDescription
no (default)No accessibility metadata will be inferred.
mergedAccessibility metadata will be inferred and merged with the authored ones in metadata.accessibility.
splitAccessibility metadata will be inferred but stored separately in metadata.inferredAccessibility.
rwp manifest --infer-a11y=merged publication.epub  | jq .metadata
Inferred metadata
KeyValueInferred?
accessModeauditoryIf the publication contains a reference to an audio or video resource (inspect resources and readingOrder in RWPM)
accessModevisualIf the publications contains a reference to an image or a video resource (inspect resources and readingOrder in RWPM)
accessModeSufficienttextualIf the publication is partially or fully accessible (WCAG A or above)
Or if the publication does not contain any image, audio or video resource (inspect "resources" and "readingOrder" in RWPM)
Or if the only image available can be identified as a cover
featuredisplayTransformabilityIf the publication is fully accessible (WCAG AA or above)
:warning: This property should only be inferred for reflowable EPUB files as it doesn't apply to other formats (FXL, PDF, audiobooks, CBZ/CBR).
featureprintPageNumbersIf the publications contains a page list (check for the presence of a pageList collection in RWPM)
featuretableOfContentsIf the publications contains a table of contents (check for the presence of a toc collection in RWPM)
featureMathMLIf the publication contains any resource with MathML (check for the presence of the contains property where the value is mathml in readingOrder or resources in RWPM)
featuresynchronizedAudioTextIf the publication contains any reference to Media Overlays (TBD in RWPM)

HTTP streaming of local publications

rwp serve starts an HTTP server that serves EPUB, CBZ and other compatible formats from a given directory. A log is printed to stdout.

# Packages

No description provided by the author
No description provided by the author