Skip to content

Commit 7d72116

Browse files
committed
feat: Add abnf and turtle revdoc format blocks
1 parent 357f891 commit 7d72116

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed

packages/revdoc/extractee.js

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,40 @@
1-
const { extractee: { aggregate, cpath, em, ref, strong } } = require("@valos/vdoc");
1+
const { extractee: { aggregate, c, cpath, em, ref, strong } } = require("@valos/vdoc");
22

33
module.exports = {
4+
/**
5+
* Construct a revdoc:ABNF element.
6+
*
7+
* @param {*} text
8+
* @param {*} rest
9+
* @returns
10+
*/
11+
abnf (text) {
12+
// Add validation and maybe restructuring?
13+
return {
14+
// TODO(iridian, 2019-08): Figure out if there's any sense in
15+
// providing language identifiers for non-natural languages.
16+
...c("https://tools.ietf.org/html/rfc5234", text),
17+
"@type": "revdoc:ABNF",
18+
};
19+
},
20+
21+
/**
22+
* Construct a revdoc:ABNF element.
23+
*
24+
* @param {*} text
25+
* @param {*} rest
26+
* @returns
27+
*/
28+
turtle (text) {
29+
// Add validation and maybe restructuring?
30+
return {
31+
// TODO(iridian, 2019-08): Figure out if there's any sense in
32+
// providing language identifiers for non-natural languages.
33+
...c("https://www.w3.org/TR/turtle/", text),
34+
"@type": "revdoc:Turtle",
35+
};
36+
},
37+
438
/**
539
* Construct ReSpec authors section based on the @valos/type-vault
640
* valma configuration of the current working directory.

packages/revdoc/ontologies.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ module.exports = extendOntology("revdoc", "https://valospace.org/revdoc#", {}, {
1717
"rdfs:subClassOf": "vdoc:Reference",
1818
"rdfs:comment": "A package reference document node",
1919
},
20+
ABNF: { "@type": "vdoc:Class",
21+
"rdfs:subClassOf": "vdoc:CharacterData",
22+
"rdfs:comment": "An ABNF section node",
23+
},
24+
Turtle: { "@type": "vdoc:Class",
25+
"rdfs:subClassOf": "vdoc:CharacterData",
26+
"rdfs:comment": "An Turtle section node",
27+
},
2028
Invokation: { "@type": "vdoc:Class",
2129
"rdfs:subClassOf": "vdoc:Node",
2230
"rdfs:comment": "A command invokation document node",

0 commit comments

Comments
 (0)