Skip to content

Provides an implementation of the formatter interfaces in dotify.api

License

Notifications You must be signed in to change notification settings

brailleapps/dotify.formatter.impl

Repository files navigation

Build Status Type License: LGPL v2.1

dotify.formatter.impl

dotify.formatter.impl contains an implementation of the formatter interfaces of dotify.api.

Many of the OBFL tests are also used as OBFL examples. The examples can be useful to study when learning about OBFL or creating OBFL-files. The examples are published here.

Techniques

Java, StAX, OBFL, Java SPI, OSGi

Functionality and features

  • Implements most aspects of OBFL (including some experimental additions)
  • Extends the currently described specification for the evaluation language with features such as:
    • Converting numbers to text, e.g. 1 becomes “one”.
    • Formatting localized messages
    • Formatting dates

Using

Download the latest release from maven central and add it to your runtime environment.

Access the implementations via the following APIs in dotify.api:

  • FormatterEngineMaker
  • FormatterFactoryMaker
  • ExpressionFactoryMaker
  • PagedMediaWriterFactoryMaker

or in an OSGi environment use:

  • FormatterEngineFactoryService
  • FormatterFactory
  • ExpressionFactory
  • PagedMediaWriterFactoryMakerService

Building

Build with gradlew build (Windows) or ./gradlew build (Mac/Linux)

Testing

Tests are run with gradlew test (Windows) or ./gradlew test (Mac/Linux).

Adding tests

OBFL-to-PEF tests can be added by including lines such as the following:

testPEF("resource-files/foo-input.obfl", "resource-files/foo-expected.pef", false);

in a class that extends AbstractFormatterEngineTest.

If you want the tests to be included in the overview page (linked to above) the OBFL and PEF files need to be placed in integrationtest/org/daisy/dotify/formatter/test/resource-files and named according to the pattern foo-input.obfl/foo-expected.pef.

Requirements & Compatibility

  • Requires Java 8
  • Compatible with SPI and OSGi

Limitations

Compared to the latest OBFL-version, at least the following is not yet supported:

  • marker-reference scope=volume and scope=document
  • the text-style attribute outside of header/footers
  • tables (incubating)
    • repeating headers
    • border intersections (see issue #167)
    • render cell-border next to table border (see issue #168)
    • table-row-spacing > 0 (see issue #169)

Note that since OBFL does not have finalized releases, this list can be incomplete.

More information

See the common wiki for more information.