Added Google Analytics tracking.
[tengwarjs.git] / README.md
1
2 This is a Tengwar transcriber suitable for transcribing Sindarin
3 Elvish from a phonetic encoding of the Latin alphabet, to the General
4 Use mode of the Tengwar. It is written in JavaScript and is suitable
5 for use as:
6
7 - A plain script in a web page.
8 - A jQuery plugin.
9 - A CommonJS module as used by Node, with the NPM package name
10 ``tengwar``.
11 - A RequireJS script as used by Dojo and others.
12
13 The script depends on a shimmable subset of ECMAScript 5. You might
14 benefit from using ES5 Shim if you're deploying to older browsers.
15 <https://github.com/kriskowal/es5-shim>
16
17 The API includes:
18
19 - ``transcribe(latin)`` returns a string of characters encoded for the
20 custom Tengwar Annatar font included. Paragraphs and sections are
21 encoded with new lines.
22 - ``transcribeHtml(latin)`` returns a string of HTML. Stanzas,
23 paragraphs, and sections are encoded with HTML tags, ``br`` and
24 ``p``.
25 - ``annotate(latin)`` returns a multi-dimensional array that describes
26 the phoneme produced by each character and diacritic of the
27 corresponding elvish.
28 - ``annotateHtml(latin)`` returns an HTML table of the annotation
29 data.
30
31 When used as a script, the API is planted in a ``tengwar`` global
32 variable.
33
34 If used as a jQuery plugin, you can use the "tengwar" method to
35 transcribe the contents of selected tags and add the "tengwar" class
36 to successfully transcribed tags.
37
38 $(".transcribe-tengwar").tengwar();
39
40 Be sure to use the included web font, derrived from Johan Winge's
41 Tengwar Annatar. It is customized for this web-deployed transcriber.
42
43 If used as a Node module, the ``tengwar`` module exports the API.
44