Skip to content

Commit

Permalink
docs(report): add vocab documents
Browse files Browse the repository at this point in the history
Add JSON-LD context definition and terms list.

Refer to correct context URL in reports

Reorg report resources directory
  • Loading branch information
marisademeglio committed Jan 22, 2018
1 parent 2e80438 commit a8a3c18
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 33 deletions.
2 changes: 1 addition & 1 deletion packages/ace-report/src/generate-html-report.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ module.exports = function generateHtmlReport(reportData) {
return new handlebars.SafeString(htmlStr);
});

const content = fs.readFileSync(path.join(__dirname, "./resources/report-template.handlebars")).toString();
const content = fs.readFileSync(path.join(__dirname, "./report-template.handlebars")).toString();
var template = handlebars.compile(content);
var result = template(reportData);
resolve(result);
Expand Down
2 changes: 1 addition & 1 deletion packages/ace-report/src/report-builders.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class ReportBuilder {
) {
this._json = {
'@type': 'earl:report',
'@context': 'http://ace.daisy.org/ns/ace-report.jsonld',
'@context': 'http://daisy.github.io/ace/ace-report-1.0.jsonld',
'dct:title': (title == null) ? '' : title.toString(),
'dct:description': (title == null) ? '' : description.toString(),
'dct:date': new Date().toLocaleString(),
Expand Down
2 changes: 1 addition & 1 deletion packages/ace-report/src/report-builders.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('report builder', () => {
expect(report.build()).toBeDefined();
expect(report.build()).toMatchObject({
'@type': 'earl:report',
'@context': 'http://ace.daisy.org/ns/ace-report.jsonld',
'@context': 'http://daisy.github.io/ace/ace-report-1.0.jsonld',
'dct:title': 'Ace Report',
'dct:description': 'Report on automated accessibility checks for EPUB',
'earl:assertedBy': {
Expand Down
30 changes: 0 additions & 30 deletions packages/ace-report/src/resources/ace-report.jsonld

This file was deleted.

12 changes: 12 additions & 0 deletions website/terms/ace-report-1.0.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"@context":
{
"@version": 1.1,
"earl": "http://www.w3.org/ns/earl#",
"doap": "http://usefulinc.com/ns/doap#",
"dct": "http://purl.org/dc/terms/",
"url": "http://schema.org/url",
"css": "http://pending.schema.org/cssSelector",
"@vocab": "http://daisy.github.io/ace/terms-1.0#"
}
}
61 changes: 61 additions & 0 deletions website/terms/terms-1.0.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<html>
<head><title>Ace Vocabulary Terms</title></head>
<body>

<h1>Ace vocabulary terms</h1>
<p>Used in JSON reports produced by <a href="http://daisy.github.io/ace">Ace by DAISY</a>.</p>

<h2>Prefix</h2>
<p><code>http://daisy.github.io/ace/terms-1.0</code></p>

<ul>
<li id='a11y-metadata'>a11y-metadata</li>
<li id='alt'>alt</li>
<li id='assertions'>assertions</li>
<li id='audios'>audios</li>
<li id='canvass'>canvass</li>
<li id='cfi'>cfi</li>
<li id='controls'>controls</li>
<li id='data'>data</li>
<li id='describedby'>describedby</li>
<li id='embeds'>embeds</li>
<li id='empty'>empty</li>
<li id='figcaption'>figcaption</li>
<li id='hasBindings'>hasBindings</li>
<li id='hasFormElements'>hasFormElements</li>
<li id='hasManifestFallbacks'>hasManifestFallbacks</li>
<li id='hasMathML'>hasMathML</li>
<li id='hasPageBreaks'>hasPageBreaks</li>
<li id='headings'>headings</li>
<li id='help'>help</li>
<li id='html'>html</li>
<li id='id'>id</li>
<li id='iframes'>iframes</li>
<li id='images'>images</li>
<li id='kind'>kind</li>
<li id='label'>label</li>
<li id='links'>links</li>
<li id='location'>location</li>
<li id='maps'>maps</li>
<li id='metadata'>metadata</li>
<li id='missing'>missing</li>
<li id='name'>name</li>
<li id='objects'>objects</li>
<li id='outlines'>outlines</li>
<li id='present'>present</li>
<li id='properties'>properties</li>
<li id='role'>role</li>
<li id='rulesetTags'>rulesetTags</li>
<li id='scripts'>scripts</li>
<li id='src'>src</li>
<li id='srclang'>srclang</li>
<li id='switches'>switches</li>
<li id='toc'>toc</li>
<li id='tracks'>tracks</li>
<li id='triggers'>triggers</li>
<li id='type'>type</li>
<li id='url'>url</li>
<li id='videos'>videos</li>
</ul>
</body>
</html>

0 comments on commit a8a3c18

Please sign in to comment.