Skip to content

Commit

Permalink
Bulleted lists in tables (#252)
Browse files Browse the repository at this point in the history
  • Loading branch information
HeikoTheissen authored Apr 11, 2024
1 parent 1887311 commit 9596c6a
Show file tree
Hide file tree
Showing 9 changed files with 157 additions and 149 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Setup pandoc
uses: nikeee/setup-pandoc@v1
with:
pandoc-version: 3.1.12.2
- name: npm install, build, and test
run: |
npm ci
Expand Down
5 changes: 3 additions & 2 deletions lib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ If you use [Visual Studio Code](https://code.visualstudio.com/), you can [run th

You should also install the recommended extension for [XML Language Support by Red Hat](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-xml). It will validate the XML files against the official [OData CDSL XML schemas](https://github.com/oasis-tcs/odata-csdl-schemas/tree/main/schemas).

`npm run pages` builds pages that can be deployed to github.io. To test these pages locally,
run `npm run serve-pages`.
`npm run pages` builds pages that can be deployed to github.io. It needs a local installation of
[Pandoc](https://pandoc.org/), version 3.1.12.2 or higher.
To test the built pages locally, run `npm run serve-pages`.

Node.js packages with a dependency on `odata-vocabularies` can inherit the page building functionality
by including the following in their `package.json`:
Expand Down
23 changes: 17 additions & 6 deletions lib/csdl2markdown.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const { spawnSync } = require("child_process");

/**
* Converts OData CSDL JSON to Github Flavored Markdown
*
Expand Down Expand Up @@ -659,12 +661,21 @@ module.exports.csdl2markdown = function (filename, csdl, referenced = {}) {
* @return {string} Escaped text
*/
function escape(text) {
return (text || "")
.trim()
.replace(/\n\n/g, "<br/>")
.replace(/\n/g, " ")
.replace(/[ \t]+/g, " ")
.replace(/\|/g, "\\|");
if (text && /(?<=^|\n)([-+*]|\d+\.) /.test(text))
return spawnSync(
"pandoc",
["-f", "gfm+tex_math_dollars", "-t", "html", "--mathjax", "--eol=lf"],
{ input: text },
)
.stdout.toString()
.replaceAll("\n", " ");
else
return (text || "")
.trim()
.replace(/\n\n/g, "<br/>")
.replace(/\n/g, " ")
.replace(/[ \t]+/g, " ")
.replace(/\|/g, "\\|");
}

/**
Expand Down
2 changes: 1 addition & 1 deletion vocabularies/Org.OData.Aggregation.V1.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"EntityContainer"
],
"@Core.Description": "Default support of the `$apply` system query option for all collection-valued resources in the container",
"@Core.LongDescription": "Annotating term [`ApplySupported`](#ApplySupported) for a specific collection-valued resource overrides the default support with the specified properties using PATCH semantics:\n\n- Primitive or collection-valued properties specified in `ApplySupported` replace the corresponding properties specified in `ApplySupportedDefaults`\n\n- Complex-valued properties specified in `ApplySupported` override the corresponding properties specified in `ApplySupportedDefaults` using PATCH semantics recursively\n\n- Properties specified neither in `ApplySupported` nor in `ApplySupportedDefaults` have their default value\n "
"@Core.LongDescription": "Annotating term [`ApplySupported`](#ApplySupported) for a specific collection-valued resource overrides the default support with the specified properties using PATCH semantics:\n- Primitive or collection-valued properties specified in `ApplySupported` replace the corresponding properties specified in `ApplySupportedDefaults`\n- Complex-valued properties specified in `ApplySupported` override the corresponding properties specified in `ApplySupportedDefaults` using PATCH semantics recursively\n- Properties specified neither in `ApplySupported` nor in `ApplySupportedDefaults` have their default value"
},
"ApplySupportedBase": {
"$Kind": "ComplexType",
Expand Down
216 changes: 108 additions & 108 deletions vocabularies/Org.OData.Aggregation.V1.md

Large diffs are not rendered by default.

6 changes: 1 addition & 5 deletions vocabularies/Org.OData.Aggregation.V1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,9 @@
</Annotation>
<Annotation Term="Core.LongDescription">
<String>Annotating term [`ApplySupported`](#ApplySupported) for a specific collection-valued resource overrides the default support with the specified properties using PATCH semantics:

- Primitive or collection-valued properties specified in `ApplySupported` replace the corresponding properties specified in `ApplySupportedDefaults`

- Complex-valued properties specified in `ApplySupported` override the corresponding properties specified in `ApplySupportedDefaults` using PATCH semantics recursively

- Properties specified neither in `ApplySupported` nor in `ApplySupportedDefaults` have their default value
</String>
- Properties specified neither in `ApplySupported` nor in `ApplySupportedDefaults` have their default value</String>
</Annotation>
</Term>
<ComplexType Name="ApplySupportedBase">
Expand Down
2 changes: 1 addition & 1 deletion vocabularies/Org.OData.Capabilities.V1.json
Original file line number Diff line number Diff line change
Expand Up @@ -1466,7 +1466,7 @@
"EntityContainer"
],
"@Core.Description": "Default capability settings for all collection-valued resources in the container",
"@Core.LongDescription": "Annotating a specific capability term, which is included as property in `DefaultCapabilitiesType`, for a specific collection-valued resource overrides the default capability with the specified properties using PATCH semantics:\n\n- Primitive or collection-valued properties specified in the specific capability term replace the corresponding properties specified in `DefaultCapabilities`\n\n- Complex-valued properties specified in the specific capability term override the corresponding properties specified in `DefaultCapabilities` using PATCH semantics recursively\n\n- Properties specified neither in the specific term nor in `DefaultCapabilities` have their default value\n "
"@Core.LongDescription": "Annotating a specific capability term, which is included as property in `DefaultCapabilitiesType`, for a specific collection-valued resource overrides the default capability with the specified properties using PATCH semantics:\n- Primitive or collection-valued properties specified in the specific capability term replace the corresponding properties specified in `DefaultCapabilities`\n- Complex-valued properties specified in the specific capability term override the corresponding properties specified in `DefaultCapabilities` using PATCH semantics recursively\n- Properties specified neither in the specific term nor in `DefaultCapabilities` have their default value"
},
"DefaultCapabilitiesType": {
"$Kind": "ComplexType",
Expand Down
42 changes: 21 additions & 21 deletions vocabularies/Org.OData.Capabilities.V1.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Term|Type|Description
[CustomHeaders](./Org.OData.Capabilities.V1.xml#L976:~:text=<Term%20Name="-,CustomHeaders,-")|\[[CustomParameter](#CustomParameter)\]|<a name="CustomHeaders"></a>Custom headers that are supported/required for the annotated resource ([Example](./Org.OData.Capabilities.V1.xml#L978))
[CustomQueryOptions](./Org.OData.Capabilities.V1.xml#L1002:~:text=<Term%20Name="-,CustomQueryOptions,-")|\[[CustomParameter](#CustomParameter)\]|<a name="CustomQueryOptions"></a>Custom query options that are supported/required for the annotated resource ([Example](./Org.OData.Capabilities.V1.xml#L1005))<br>If the entity container is annotated, the query option is supported/required by all resources in that container.
[MediaLocationUpdateSupported](./Org.OData.Capabilities.V1.xml#L1054:~:text=<Term%20Name="-,MediaLocationUpdateSupported,-")|[Tag](Org.OData.Core.V1.md#Tag)|<a name="MediaLocationUpdateSupported"></a>Stream property or media stream supports update of its media edit URL and/or media read URL
[DefaultCapabilities](./Org.OData.Capabilities.V1.xml#L1059:~:text=<Term%20Name="-,DefaultCapabilities,-")|[DefaultCapabilitiesType](#DefaultCapabilitiesType)|<a name="DefaultCapabilities"></a>Default capability settings for all collection-valued resources in the container<br>Annotating a specific capability term, which is included as property in `DefaultCapabilitiesType`, for a specific collection-valued resource overrides the default capability with the specified properties using PATCH semantics:<br/>- Primitive or collection-valued properties specified in the specific capability term replace the corresponding properties specified in `DefaultCapabilities`<br/>- Complex-valued properties specified in the specific capability term override the corresponding properties specified in `DefaultCapabilities` using PATCH semantics recursively<br/>- Properties specified neither in the specific term nor in `DefaultCapabilities` have their default value
[DefaultCapabilities](./Org.OData.Capabilities.V1.xml#L1059:~:text=<Term%20Name="-,DefaultCapabilities,-")|[DefaultCapabilitiesType](#DefaultCapabilitiesType)|<a name="DefaultCapabilities"></a>Default capability settings for all collection-valued resources in the container<br><p>Annotating a specific capability term, which is included as property in <code>DefaultCapabilitiesType</code>, for a specific collection-valued resource overrides the default capability with the specified properties using PATCH semantics:</p> <ul> <li>Primitive or collection-valued properties specified in the specific capability term replace the corresponding properties specified in <code>DefaultCapabilities</code></li> <li>Complex-valued properties specified in the specific capability term override the corresponding properties specified in <code>DefaultCapabilities</code> using PATCH semantics recursively</li> <li>Properties specified neither in the specific term nor in <code>DefaultCapabilities</code> have their default value</li> </ul>

<a name="ConformanceLevelType"></a>
## [ConformanceLevelType](./Org.OData.Capabilities.V1.xml#L118:~:text=<EnumType%20Name="-,ConformanceLevelType,-")
Expand Down Expand Up @@ -678,33 +678,33 @@ Property|Type|Description
[ExampleValues](./Org.OData.Capabilities.V1.xml#L1049:~:text=<ComplexType%20Name="-,CustomParameter,-")|\[[PrimitiveExampleValue](Org.OData.Core.V1.md#PrimitiveExampleValue)\]|Example values for the custom parameter

<a name="DefaultCapabilitiesType"></a>
## [DefaultCapabilitiesType](./Org.OData.Capabilities.V1.xml#L1072:~:text=<ComplexType%20Name="-,DefaultCapabilitiesType,-")
## [DefaultCapabilitiesType](./Org.OData.Capabilities.V1.xml#L1068:~:text=<ComplexType%20Name="-,DefaultCapabilitiesType,-")


Property|Type|Description
:-------|:---|:----------
[ChangeTracking](./Org.OData.Capabilities.V1.xml#L1073:~:text=<ComplexType%20Name="-,DefaultCapabilitiesType,-")|[ChangeTrackingBase?](#ChangeTrackingBase)|Change tracking capabilities
[CountRestrictions](./Org.OData.Capabilities.V1.xml#L1076:~:text=<ComplexType%20Name="-,DefaultCapabilitiesType,-")|[CountRestrictionsBase?](#CountRestrictionsBase)|Restrictions on /$count path suffix and $count=true system query option
[IndexableByKey](./Org.OData.Capabilities.V1.xml#L1079:~:text=<ComplexType%20Name="-,DefaultCapabilitiesType,-")|[Tag?](Org.OData.Core.V1.md#Tag)|Supports key values according to OData URL conventions
[TopSupported](./Org.OData.Capabilities.V1.xml#L1082:~:text=<ComplexType%20Name="-,DefaultCapabilitiesType,-")|[Tag?](Org.OData.Core.V1.md#Tag)|Supports $top
[SkipSupported](./Org.OData.Capabilities.V1.xml#L1085:~:text=<ComplexType%20Name="-,DefaultCapabilitiesType,-")|[Tag?](Org.OData.Core.V1.md#Tag)|Supports $skip
[ComputeSupported](./Org.OData.Capabilities.V1.xml#L1088:~:text=<ComplexType%20Name="-,DefaultCapabilitiesType,-")|[Tag?](Org.OData.Core.V1.md#Tag)|Supports $compute
[SelectSupport](./Org.OData.Capabilities.V1.xml#L1091:~:text=<ComplexType%20Name="-,DefaultCapabilitiesType,-")|[SelectSupportType?](#SelectSupportType)|Support for $select and nested query options within $select
[FilterRestrictions](./Org.OData.Capabilities.V1.xml#L1094:~:text=<ComplexType%20Name="-,DefaultCapabilitiesType,-")|[FilterRestrictionsBase?](#FilterRestrictionsBase)|Restrictions on filter expressions
[SortRestrictions](./Org.OData.Capabilities.V1.xml#L1097:~:text=<ComplexType%20Name="-,DefaultCapabilitiesType,-")|[SortRestrictionsBase?](#SortRestrictionsBase)|Restrictions on orderby expressions
[ExpandRestrictions](./Org.OData.Capabilities.V1.xml#L1100:~:text=<ComplexType%20Name="-,DefaultCapabilitiesType,-")|[ExpandRestrictionsBase?](#ExpandRestrictionsBase)|Restrictions on expand expressions
[SearchRestrictions](./Org.OData.Capabilities.V1.xml#L1103:~:text=<ComplexType%20Name="-,DefaultCapabilitiesType,-")|[SearchRestrictionsType?](#SearchRestrictionsType)|Restrictions on search expressions
[InsertRestrictions](./Org.OData.Capabilities.V1.xml#L1106:~:text=<ComplexType%20Name="-,DefaultCapabilitiesType,-")|[InsertRestrictionsBase?](#InsertRestrictionsBase)|Restrictions on insert operations
[UpdateRestrictions](./Org.OData.Capabilities.V1.xml#L1109:~:text=<ComplexType%20Name="-,DefaultCapabilitiesType,-")|[UpdateRestrictionsBase?](#UpdateRestrictionsBase)|Restrictions on update operations
[DeleteRestrictions](./Org.OData.Capabilities.V1.xml#L1112:~:text=<ComplexType%20Name="-,DefaultCapabilitiesType,-")|[DeleteRestrictionsBase?](#DeleteRestrictionsBase)|Restrictions on delete operations
[OperationRestrictions](./Org.OData.Capabilities.V1.xml#L1115:~:text=<ComplexType%20Name="-,DefaultCapabilitiesType,-")|[OperationRestrictionsType?](#OperationRestrictionsType)|Restrictions for function or action operations
[ReadRestrictions](./Org.OData.Capabilities.V1.xml#L1118:~:text=<ComplexType%20Name="-,DefaultCapabilitiesType,-")|[ReadRestrictionsType?](#ReadRestrictionsType)|Restrictions for retrieving a collection of entities, retrieving a singleton instance
[ChangeTracking](./Org.OData.Capabilities.V1.xml#L1069:~:text=<ComplexType%20Name="-,DefaultCapabilitiesType,-")|[ChangeTrackingBase?](#ChangeTrackingBase)|Change tracking capabilities
[CountRestrictions](./Org.OData.Capabilities.V1.xml#L1072:~:text=<ComplexType%20Name="-,DefaultCapabilitiesType,-")|[CountRestrictionsBase?](#CountRestrictionsBase)|Restrictions on /$count path suffix and $count=true system query option
[IndexableByKey](./Org.OData.Capabilities.V1.xml#L1075:~:text=<ComplexType%20Name="-,DefaultCapabilitiesType,-")|[Tag?](Org.OData.Core.V1.md#Tag)|Supports key values according to OData URL conventions
[TopSupported](./Org.OData.Capabilities.V1.xml#L1078:~:text=<ComplexType%20Name="-,DefaultCapabilitiesType,-")|[Tag?](Org.OData.Core.V1.md#Tag)|Supports $top
[SkipSupported](./Org.OData.Capabilities.V1.xml#L1081:~:text=<ComplexType%20Name="-,DefaultCapabilitiesType,-")|[Tag?](Org.OData.Core.V1.md#Tag)|Supports $skip
[ComputeSupported](./Org.OData.Capabilities.V1.xml#L1084:~:text=<ComplexType%20Name="-,DefaultCapabilitiesType,-")|[Tag?](Org.OData.Core.V1.md#Tag)|Supports $compute
[SelectSupport](./Org.OData.Capabilities.V1.xml#L1087:~:text=<ComplexType%20Name="-,DefaultCapabilitiesType,-")|[SelectSupportType?](#SelectSupportType)|Support for $select and nested query options within $select
[FilterRestrictions](./Org.OData.Capabilities.V1.xml#L1090:~:text=<ComplexType%20Name="-,DefaultCapabilitiesType,-")|[FilterRestrictionsBase?](#FilterRestrictionsBase)|Restrictions on filter expressions
[SortRestrictions](./Org.OData.Capabilities.V1.xml#L1093:~:text=<ComplexType%20Name="-,DefaultCapabilitiesType,-")|[SortRestrictionsBase?](#SortRestrictionsBase)|Restrictions on orderby expressions
[ExpandRestrictions](./Org.OData.Capabilities.V1.xml#L1096:~:text=<ComplexType%20Name="-,DefaultCapabilitiesType,-")|[ExpandRestrictionsBase?](#ExpandRestrictionsBase)|Restrictions on expand expressions
[SearchRestrictions](./Org.OData.Capabilities.V1.xml#L1099:~:text=<ComplexType%20Name="-,DefaultCapabilitiesType,-")|[SearchRestrictionsType?](#SearchRestrictionsType)|Restrictions on search expressions
[InsertRestrictions](./Org.OData.Capabilities.V1.xml#L1102:~:text=<ComplexType%20Name="-,DefaultCapabilitiesType,-")|[InsertRestrictionsBase?](#InsertRestrictionsBase)|Restrictions on insert operations
[UpdateRestrictions](./Org.OData.Capabilities.V1.xml#L1105:~:text=<ComplexType%20Name="-,DefaultCapabilitiesType,-")|[UpdateRestrictionsBase?](#UpdateRestrictionsBase)|Restrictions on update operations
[DeleteRestrictions](./Org.OData.Capabilities.V1.xml#L1108:~:text=<ComplexType%20Name="-,DefaultCapabilitiesType,-")|[DeleteRestrictionsBase?](#DeleteRestrictionsBase)|Restrictions on delete operations
[OperationRestrictions](./Org.OData.Capabilities.V1.xml#L1111:~:text=<ComplexType%20Name="-,DefaultCapabilitiesType,-")|[OperationRestrictionsType?](#OperationRestrictionsType)|Restrictions for function or action operations
[ReadRestrictions](./Org.OData.Capabilities.V1.xml#L1114:~:text=<ComplexType%20Name="-,DefaultCapabilitiesType,-")|[ReadRestrictionsType?](#ReadRestrictionsType)|Restrictions for retrieving a collection of entities, retrieving a singleton instance

<a name="HttpResponse"></a>
## [HttpResponse](./Org.OData.Capabilities.V1.xml#L1123:~:text=<ComplexType%20Name="-,HttpResponse,-")
## [HttpResponse](./Org.OData.Capabilities.V1.xml#L1119:~:text=<ComplexType%20Name="-,HttpResponse,-")


Property|Type|Description
:-------|:---|:----------
[StatusCode](./Org.OData.Capabilities.V1.xml#L1124:~:text=<ComplexType%20Name="-,HttpResponse,-")|String|HTTP response status code, for example 400, 403, 501
[Description](./Org.OData.Capabilities.V1.xml#L1127:~:text=<ComplexType%20Name="-,HttpResponse,-")|String|Human-readable description of the response
[StatusCode](./Org.OData.Capabilities.V1.xml#L1120:~:text=<ComplexType%20Name="-,HttpResponse,-")|String|HTTP response status code, for example 400, 403, 501
[Description](./Org.OData.Capabilities.V1.xml#L1123:~:text=<ComplexType%20Name="-,HttpResponse,-")|String|Human-readable description of the response
6 changes: 1 addition & 5 deletions vocabularies/Org.OData.Capabilities.V1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1060,13 +1060,9 @@ The absence of `RestrictedProperties` denotes all properties are accessible usin
<Annotation Term="Core.Description" String="Default capability settings for all collection-valued resources in the container" />
<Annotation Term="Core.LongDescription">
<String>Annotating a specific capability term, which is included as property in `DefaultCapabilitiesType`, for a specific collection-valued resource overrides the default capability with the specified properties using PATCH semantics:

- Primitive or collection-valued properties specified in the specific capability term replace the corresponding properties specified in `DefaultCapabilities`

- Complex-valued properties specified in the specific capability term override the corresponding properties specified in `DefaultCapabilities` using PATCH semantics recursively

- Properties specified neither in the specific term nor in `DefaultCapabilities` have their default value
</String>
- Properties specified neither in the specific term nor in `DefaultCapabilities` have their default value</String>
</Annotation>
</Term>
<ComplexType Name="DefaultCapabilitiesType">
Expand Down

0 comments on commit 9596c6a

Please sign in to comment.