Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rufuspollock-okfn/textus-viewer

A sophisticated HTML-based viewer for texts
https://github.com/rufuspollock-okfn/textus-viewer

Last synced: 2 months ago
JSON representation

A sophisticated HTML-based viewer for texts

Awesome Lists containing this project

README

        

The Textus viewer application.

The Textus viewer is a pure HTML + Javascript application for viewing [Textus
format texts][format]. It is part of the [Textus project][textus].

[textus]: http://okfnlabs.org/textus/
[format]: http://okfnlabs.org/textus/doc/textus-format.html

## Demo

Check out:

## Usage

Include all the relevant vendor libraries (see `vendor` directory):

```

```

Include Textus Viewer JS in your app:

```

```

Now boot the viewer:

```
jQuery(document).ready(function() {
// Create a Text object with some fixture data
var text = new Textus.Model.Text({
// id is needed if new annotations will be allowed
id: 'text-1',
textUrl: # url to your text in textus format
typographyUrl: # textus typography
annotationsUrl: # url to load annotations from
});
// Load the text
text.fetch(function(err) {
// you could check the err if you want to be sure text has loaded ok

// set up the viewer
var viewer = new Textus.Viewer({
el: $('.textus-viewer-here'),
text: text,
router: null,
user: {
id: 'bob'
}
});
// and now render it
viewer.render();
});
});
```

Note: we are in the process of [reinstating support for loading and saving to a
proper Textus compatiable annotations API][ann-issue].

[ann-issue]: https://github.com/okfn/textus-viewer/issues/8

## For Contributors

You can try the app out test it during development by opening index.html in
your browser but note that you will need to have it loaded at a proper http://
url not a file:/// one (with file:/// urls you won't be able to load the
fixture data).

### Code Organization

```
vendor/ # dev
js/ # js code
css/ # css code
```