Skip to content

Commit

Permalink
documentation #21
Browse files Browse the repository at this point in the history
  • Loading branch information
wissenbach committed Nov 21, 2017
1 parent af8fa50 commit 564ae07
Showing 1 changed file with 47 additions and 1 deletion.
48 changes: 47 additions & 1 deletion svg_rendering/page/js-gen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,18 @@ This directory contains code that renders the diplomatic transcript inside the w

Generate the intermediate text markup file, e.g. by calling `SimpleTransform` (see Dependencies) via maven

mvn --offline -q exec:java -Dexec.mainClass="de.faustedition.transcript.simple.SimpleTransform" < ${INPUT_FILE}
mvn --offline -q exec:java -Dexec.mainClass="de.faustedition.transcript.simple.SimpleTransform" < ${XML_INPUT_FILE}

The output is a JSON standoff markup format of the XML file.

Load the `.js`-files in this directory into a web page. Calling `transcriptGeneration.createDiplomaticSvg(standoff_transcript, callback)`
will generate an SVG rendering of the transcript in the HTML body. `standoff_transcript` is the output from above.
`callback` is an optional call back function which will be called with the generated SVG element as single argument.

If you want to ensure that all web fonts are loaded prior to rendering, you can wrap the rendering call with the included webfont
loader like so

Faust.Fonts.active (/* render */)

## Dependencies

Expand All @@ -15,3 +26,38 @@ The rendering library relies on a proprietary text markup format. This can be ge

## Directory Contents

### Utilities

`faust.js` General utility functions

`loadwebfonts.js` Wrap the Google web font loader

`svg-utils.js` SVG utility functions

### Legacy wrappers


`materialunit.js` Handle archival objects (TODO: check if used and remove)


### Standoff annotation handling

`adhoc-tree.js` Build a tree from the standoff annotations from `text-annotaion.js`

`text-annotation.js` Parse standoff markup

`text-index.js` Standoff annotation index for fast lookup

### Layout


`transcript.js` Abstract transcript layout classes

`transcript-adhoc-tree.js` Initialize layout objects from document tree

`transcript-configuration-faust.js` Parameters for transcript layout

`transcript-generation.js` Entry point for transcript generation

`transcript-svg.js` Augment the abstract classes in `transcript.js` to do the layout with an SVG terminal

0 comments on commit 564ae07

Please sign in to comment.