Code Monkey home page Code Monkey logo

epub-structural-tests's Introduction

Harvest epubcheck for the EPUB 3.3. CR report

Tool to combine the information extracted from the test feature files of epubcheck with the EPUB 3.3 specification, and to produce a test report that lists the available tests and their relationships to the specification. The tool itself is a script written in TypeScript, based on a standard node.js environment.

Workflow

The tool does two things for each HTML files of the EPUB 3.3 specifications (i.e., the core index.html file as well as the vocabulary specification files):

  • It produces a separate file in the docs/fragments directory. The final report itself (in docs/index.html) combines these fragment files to produce a comprehensive set of tables on the tests. [T.B.D.: whether this file should be moved to another repository, or whether it can be directly picked up by the final reports.]

  • It modifies the specification file by adding the references to the tests in the relevant sections. This is done by adding the data-tests attributes (or expanding an existing one, if applicable) with the references to the test suite (see the respec documentation for the details).

    The modified HTML files are stored in the epub33/core, resp. epub33/core/vocab, directory. These files must be manually moved back into the specification repository by, e.g., copying them in a local clone and the defining a Pull Request. The tool does not do that automatically.

The input data for the tool is epubcheck_data/tests.json, which contains the test descriptions as extracted from the epubcheck test suite.

Installing and running the tool

The repository must be cloned to a local machine and the standard npm install should be run. To execute the script run

ts-node src/main.ts

from the top directory or, alternatively, run

npm run generate

anywhere in the repository.

By default, the tool reads the content of the specifications' HTML files by accessing them directly on github. The tool can also be run with two more options:

  • -d or --download: the original (i.e., unchanged) specification files are also stored locally in the epub33-orig directory.
  • -l or --local: instead of accessing github, the tool uses the specification files in the epub33-orig directory.

Directory content

  • epub33/core: the generated specification files, with all the modifications done/updated.
  • epub33-orig/core: a copy of the original specification files.
  • epub-33/common: is a copy of the original files in the EPUB repository (necessary to visualize the files). In particular, it also contains (a modified version of) epub33/common/js/data-test-displays.js that makes some necessary modifications on the files generated by respec to show the test references correctly.
  • epubcheck-data: files, and necessary scripts, containing the descriptions of the epubcheck tests suite entries.
  • docs: the final report
  • src: the TypeScript code itself

The rest of the files (package.json, LICENSE, etc, are self-evident).

@iherman

epub-structural-tests's People

Contributors

iherman avatar mattgarrish avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

isabella232

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.