Skip to content

Metadata and Citations

respinos edited this page Jan 26, 2018 · 1 revision

Metadata

TBD.

Citations

You pass an array of hashes describing the format and exact text that make up the citation. For example, if you have that data as:

var my_citations = [
 { format: 'MLA', text: "Mock, Alex. <em>The Mock Life</em>. University Press, 2017." },
 { format: 'APA', text: "Mock, A. (2017). <em>The Mock Life</em>. Ann Arbor, MI: University Press." },
 { format: 'Chicago', text: "Mock, Alex. <em>The Mock Life</em>. Ann Arbor, MI: University Press, 2017." }
]

Either pass it as metadata when instantiating the reader:

reader = cozy.reader('reader', {
  href: '/path/to/epub',
  metadata: {
    citations: my_citations
  }
});
cozy.reader.citation({ region: 'top.toolbar.left' }).addTo(reader);

or to the control:

reader = cozy.reader('reader', { href: '/path/to/epub' });
cozy.reader.citation({ region: 'top.toolbar.left', citations: my_citations }).addTo(reader);
Clone this wiki locally