Skip to content

Commit

Permalink
[#OData-CSDL#section]
Browse files Browse the repository at this point in the history
  • Loading branch information
HeikoTheissen committed Sep 20, 2024
1 parent b447ab5 commit 823ec14
Show file tree
Hide file tree
Showing 27 changed files with 70 additions and 60 deletions.
3 changes: 2 additions & 1 deletion lib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ This folder contains several Node.js modules that generate OASIS specification d
See [subsection ##SubsectionHeading]. Reference to a subsection showing its number.
See [this example](#aggregation). Reference to an example.
See [example ##aggregation]. Reference to an example showing its number.
See [OData-Protocol, section #odata-protocol#SectionHeading]. Cross-document reference.
See [#OData-Protocol#SectionHeading]. Cross-document section reference.
See [OData-Protocol, example #OData-Protocol#SectionHeading]. Other cross-document reference.
[This important sentence]{id=important} is referenced [elsewhere](#important).
```
- Lines ending with single space are joined with the next line.
Expand Down
4 changes: 1 addition & 3 deletions lib/iterator.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ module.exports = function (callback) {
const meta = yaml.load(
fs.readFileSync(`${__dirname}/../${doc.name}/${metaname}`),
);
meta.name =
metaname === "meta.yaml" || !meta.dirname ? doc.name : meta.dirname;
callback(
doc.name,
meta.name,
metaname === "meta.yaml" || !meta.dirname ? doc.name : meta.dirname,
metaname.substring(0, metaname.length - 5),
{
...metameta,
Expand Down
20 changes: 12 additions & 8 deletions lib/number.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,18 +211,22 @@ class Number {
}
out.write(
outline.replace(
/#([-A-Za-z0-9]*)#([A-Za-z0-9.]+)\]/g,
function (m, d, p) {
/(\[?)#([-A-Za-z0-9]*)#([A-Za-z0-9.]+)\]/g,
function (m, o, d, p) {
var f, r;
if (d && this.meta[d]) f = this.meta[d] + "#";
else if (!d) f = "#";
if (f) r = (d ? builders[d] : this)?.refs[p];
if (r) return `${r}](${f}${p})`;
if (d && (r = builders[d]?.refs[p])) {
if (o) r = `${d}, section ${r}`;
f = builders[d].meta.url;
} else if (!d) {
r = this.refs[p];
f = "";
}
if (r) return `${o}${r}](${f}#${p})`;
else {
this.errors.push(
`${d || this.dir}/${file}(${lineno}): Undefined link #${d}#${p}`,
`${this.dir}/${file}(${lineno}): Undefined link #${d}#${p}`,
);
return `~~${d}#${p}~~]`;
return `${o}~~${d}#${p}~~]`;
}
}.bind(this),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const app = express()
var number = new Number(
`${__dirname}/../${req.params.doc}`,
req.query.variant,
{ ...metameta, ...meta, name: meta.dirname || req.params.doc },
{ ...metameta, ...meta },
);
delete req.query.variant;
res.type("html");
Expand Down
7 changes: 0 additions & 7 deletions meta.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
odata-csdl-json: https://docs.oasis-open.org/odata/odata-csdl-json/v4.02/odata-csdl-json-v4.02.html
odata-csdl-xml: https://docs.oasis-open.org/odata/odata-csdl-xml/v4.02/odata-csdl-xml-v4.02.html
odata-json-format: https://docs.oasis-open.org/odata/odata-json-format/v4.02/odata-json-format-v4.02.html
odata-data-aggregation-ext: https://docs.oasis-open.org/odata/odata-data-aggregation-ext/v4.0/odata-data-aggregation-ext-v4.0.html
odata-temporal-ext: https://docs.oasis-open.org/odata/odata-temporal-ext/v4.0/odata-temporal-ext-v4.0.html
odata-protocol: https://docs.oasis-open.org/odata/odata/v4.02/odata-v4.02-part1-protocol.html
odata-url-conventions: https://docs.oasis-open.org/odata/odata/v4.02/odata-v4.02-part2-url-conventions.html
OData-VocCore: https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Core.V1.md
OData-VocCap: https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Capabilities.V1.md
OData-VocAggr: https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Aggregation.V1.md
2 changes: 1 addition & 1 deletion odata-csdl/12 Action and Function.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ Unbound actions are invoked from the entity container through an [action
import](#ActionImport).

Unbound functions are invoked as static functions within a common expression
(see [OData-URL, section #odata-url-conventions#CommonExpressionSyntax]),
(see [#OData-URL#CommonExpressionSyntax]),
or from the entity container through a [function import](#FunctionImport).

::: {.varjson .rep}
Expand Down
2 changes: 1 addition & 1 deletion odata-csdl/14 Vocabulary and Annotation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2571,7 +2571,7 @@ Name property of the Actor entity

The `odata.matchesPattern` client-side function takes two string
expressions as arguments and returns a Boolean value.
It is the counterpart of the identically named URL function [OData-URL, section #odata-url-conventions#matchespattern].
It is the counterpart of the identically named URL function [#OData-URL#matchespattern].

The function returns true if the second expression evaluates to an
[ECMAScript](#_ECMAScript) (JavaScript) regular expression and
Expand Down
2 changes: 2 additions & 0 deletions odata-csdl/json.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: OData-CSDL
url: https://docs.oasis-open.org/odata/odata-csdl-json/v4.02/odata-csdl-json-v4.02.html
pagetitle: OData Common Schema Definition Language (CSDL) JSON Representation Version 4.02
subtitle: Committee Specification Draft 02
dirname: odata-csdl-json
Expand Down
2 changes: 2 additions & 0 deletions odata-csdl/xml.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: OData-CSDLXML
url: https://docs.oasis-open.org/odata/odata-csdl-xml/v4.02/odata-csdl-xml-v4.02.html
pagetitle: OData Common Schema Definition Language (CSDL) XML Representation Version 4.02
subtitle: Committee Specification Draft 02
dirname: odata-csdl-xml
Expand Down
Loading

0 comments on commit 823ec14

Please sign in to comment.