Skip to content

Commit

Permalink
Preparation for cross-spec links
Browse files Browse the repository at this point in the history
  • Loading branch information
HeikoTheissen committed Sep 6, 2024
1 parent a79ab2d commit 2b8185c
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1835,7 +1835,7 @@ <h5 id="32134-standard-aggregation-method-average"><a name="StandardAggregationM
<details open><summary>
<h5 id="32135-standard-aggregation-method-countdistinct"><a name="StandardAggregationMethodcountdistinct" href="#StandardAggregationMethodcountdistinct">3.2.1.3.5 Standard Aggregation Method <code>countdistinct</code></a></h5>
</summary>
<p>The aggregation method <code>countdistinct</code> can be applied to arbitrary collections to count the distinct values. Instance comparison uses the definition of equality in <a href="#ODataURL">OData-URL, section 5.1.1.1.1</a>.</p>
<p>The aggregation method <code>countdistinct</code> can be applied to arbitrary collections to count the distinct values. Instance comparison uses the definition of equality in <a href="https://docs.oasis-open.org/odata/odata/v4.02/odata-v4.02-part2-url-conventions.html#Equals">OData-URL, section 5.1.1.1.1</a>.</p>
<p>The result property MUST have type <code>Edm.Decimal</code> with <code>Scale</code> 0 and sufficient <code>Precision</code>.</p>
<div class="example">
<p>Example 13:</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1276,7 +1276,7 @@ results in

##### <a name="StandardAggregationMethodcountdistinct" href="#StandardAggregationMethodcountdistinct">3.2.1.3.5 Standard Aggregation Method `countdistinct`</a>

The aggregation method `countdistinct` can be applied to arbitrary collections to count the distinct values. Instance comparison uses the definition of equality in [OData-URL, section 5.1.1.1.1](#ODataURL).
The aggregation method `countdistinct` can be applied to arbitrary collections to count the distinct values. Instance comparison uses the definition of equality in [OData-URL, section 5.1.1.1.1](https://docs.oasis-open.org/odata/odata/v4.02/odata-v4.02-part2-url-conventions.html#Equals).

The result property MUST have type `Edm.Decimal` with `Scale` 0 and sufficient `Precision`.

Expand Down
9 changes: 1 addition & 8 deletions lib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,7 @@ The single Markdown document is output into a writable stream:

```js
import * as Number from './lib/number.js';
new Number("odata-data-aggregation-ext").build(«writable stream»);
```

or, if variant `XXX` shall be produced:

```js
import * as Number from './lib/number.js';
new Number("odata-data-aggregation-ext", "XXX").build(«writable stream»);
new Number("odata-data-aggregation-ext", "meta", {...}).build(«writable stream»);
```

The [`pandoc.js`](pandoc.js) module converts this single Markdown document to HTML with [MathJax](https://www.mathjax.org/). It expects a certain [pandoc release](https://github.com/jgm/pandoc/releases) to be set up, according to the GitHub Action [`nodejs.yml`](../.github/workflows/nodejs.yml) with the step
Expand Down
16 changes: 8 additions & 8 deletions lib/iterator.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const fs = require("fs");
const yaml = require("js-yaml");

const metameta = yaml.load(fs.readFileSync(`${__dirname}/../meta.yaml`));

module.exports = function (callback) {
fs.readdirSync(`${__dirname}/..`, {
withFileTypes: true,
Expand All @@ -9,17 +11,15 @@ module.exports = function (callback) {
fs.readdirSync(`${__dirname}/../${doc.name}`)
.filter((fn) => fn.endsWith(".yaml"))
.forEach(function (metaname) {
var meta = yaml.load(
const meta = yaml.load(
fs.readFileSync(`${__dirname}/../${doc.name}/${metaname}`),
);
var name =
const name =
metaname === "meta.yaml" || !meta.dirname ? doc.name : meta.dirname;
callback(
doc.name,
name,
metaname.substring(0, metaname.length - 5),
meta,
);
callback(doc.name, name, metaname.substring(0, metaname.length - 5), {
...metameta,
...meta,
});
});
}
});
Expand Down
4 changes: 1 addition & 3 deletions lib/number.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ class Number {
.readdirSync(this.dir)
.filter((fn) => fn.endsWith(".md"))
.sort(compareSectionNumbers);
this.meta =
meta ||
yaml.load(fs.readFileSync(`${this.dir}/${this.variant || "meta"}.yaml`));
this.meta = meta;
this.meta["pandoc-version"] = pandoc;
}

Expand Down
11 changes: 7 additions & 4 deletions lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ liveReloadServer.watch(path.join(__dirname, ".."));
const connectLivereload = require("connect-livereload");
const statics = { images: {} };

const metameta = yaml.load(fs.readFileSync(`${__dirname}/../meta.yaml`));

const app = express()
.enable("strict routing")
.use(connectLivereload())
Expand All @@ -39,15 +41,16 @@ const app = express()
if (branch) req.query["-T"] = branch;
} catch (e) {}
try {
var metaname = `${__dirname}/../${req.params.doc}/${
req.query.variant || "meta"
}.yaml`;
var meta = yaml.load(fs.readFileSync(metaname));
var number = new Number(
`${__dirname}/../${req.params.doc}`,
req.query.variant,
{ ...metameta, ...meta },
);
var metaname = `${__dirname}/../${req.params.doc}/${
req.query.variant || "meta"
}.yaml`;
delete req.query.variant;
var meta = yaml.load(fs.readFileSync(metaname));
res.type("html");
var proc = pandoc({
"--metadata-file": metaname,
Expand Down
7 changes: 7 additions & 0 deletions meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
OData-CSDLJSON: https://docs.oasis-open.org/odata/odata-csdl-json/v4.02/odata-csdl-json-v4.02.html
OData-CSDLXML: https://docs.oasis-open.org/odata/odata-csdl-xml/v4.02/odata-csdl-xml-v4.02.html
OData-JSON: https://docs.oasis-open.org/odata/odata-json-format/v4.02/odata-json-format-v4.02.html
OData-Data-Agg: https://docs.oasis-open.org/odata/odata-data-aggregation-ext/v4.0/odata-data-aggregation-ext-v4.0.html
OData-Temporal: 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: https://docs.oasis-open.org/odata/odata/v4.02/odata-v4.02-part2-url-conventions.html
2 changes: 1 addition & 1 deletion odata-data-aggregation-ext/3.2 Basic Aggregation.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ results in

##### ##subsubsubsubsec Standard Aggregation Method `countdistinct`

The aggregation method `countdistinct` can be applied to arbitrary collections to count the distinct values. Instance comparison uses the definition of equality in [OData-URL, section 5.1.1.1.1](#ODataURL).
The aggregation method `countdistinct` can be applied to arbitrary collections to count the distinct values. Instance comparison uses the definition of equality in [OData-URL, section 5.1.1.1.1]($$$OData-URL$$$#Equals).

The result property MUST have type `Edm.Decimal` with `Scale` 0 and sufficient `Precision`.

Expand Down

0 comments on commit 2b8185c

Please sign in to comment.