Skip to content

Commit

Permalink
Avoid poor man's bulleted lists
Browse files Browse the repository at this point in the history
  • Loading branch information
HeikoTheissen committed Apr 10, 2024
1 parent 7ed45a3 commit 9af6f68
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
17 changes: 10 additions & 7 deletions lib/csdl2markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -610,10 +610,11 @@ module.exports.csdl2markdown = function (filename, csdl, referenced = {}) {
*/
function applicableTermsList(applicableTerms) {
const text = [];
if (applicableTerms.length > 0) text.push("<br>Can be annotated with:");
if (applicableTerms.length > 0) text.push("<br>Can be annotated with:<ul>");
applicableTerms.forEach((term) => {
text.push(`<br>- ${typeLink({ $Type: term })}`);
text.push(`<li>${typeLink({ $Type: term })}</li>`);
});
if (applicableTerms.length > 0) text.push("</ul>");
return text.join("");
}

Expand All @@ -624,10 +625,11 @@ module.exports.csdl2markdown = function (filename, csdl, referenced = {}) {
*/
function allowedTermsList(allowedTerms) {
const text = [];
if (allowedTerms.length > 0) text.push("<br>Allowed terms:");
if (allowedTerms.length > 0) text.push("<br>Allowed terms:<ul>");
allowedTerms.forEach((term) => {
text.push(`<br>- ${typeLink({ $Type: term })}`);
text.push(`<li>${typeLink({ $Type: term })}</li>`);
});
if (allowedTerms.length > 0) text.push("</ul>");
return text.join("");
}

Expand All @@ -638,15 +640,16 @@ module.exports.csdl2markdown = function (filename, csdl, referenced = {}) {
*/
function allowedValuesList(allowedValues) {
const text = [];
if (allowedValues.length > 0) text.push("<br>Allowed values:");
if (allowedValues.length > 0) text.push("<dl>Allowed values:");
allowedValues.forEach((v) => {
v.$$name = v.Value;
v.$$parent = "nofragment";
let allowedValue = "<br>- " + sourceLink(v) + experimentalOrDeprecated(v);
let allowedValue = "<dt>" + sourceLink(v) + experimentalOrDeprecated(v);
const description = descriptionInTable(v);
if (description) allowedValue += ": " + description;
if (description) allowedValue += "<dd>" + description;
text.push(allowedValue);
});
if (allowedValues.length > 0) text.push("</dl>");
return text.join("");
}

Expand Down
2 changes: 1 addition & 1 deletion vocabularies/Org.OData.Capabilities.V1.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ Property|Type|Description
[ReferencesAcrossChangeSetsSupported](./Org.OData.Capabilities.V1.xml#L397:~:text=<ComplexType%20Name="-,BatchSupportType,-")|Boolean|Service supports Content-ID referencing across change sets
[EtagReferencesSupported](./Org.OData.Capabilities.V1.xml#L400:~:text=<ComplexType%20Name="-,BatchSupportType,-")|Boolean|Service supports referencing Etags from previous requests
[RequestDependencyConditionsSupported](./Org.OData.Capabilities.V1.xml#L403:~:text=<ComplexType%20Name="-,BatchSupportType,-")|Boolean|Service supports the `if` member in JSON batch requests
[SupportedFormats](./Org.OData.Capabilities.V1.xml#L406:~:text=<ComplexType%20Name="-,BatchSupportType,-")|\[MediaType\]|Media types of supported formats for $batch<br>Allowed values:<br>- [multipart/mixed](./Org.OData.Capabilities.V1.xml#L411): [Multipart Batch Format](http://docs.oasis-open.org/odata/odata/v4.01/cs01/part1-protocol/odata-v4.01-cs01-part1-protocol.html#sec_MultipartBatchFormat)<br>- [application/json](./Org.OData.Capabilities.V1.xml#L415): [JSON Batch Format](http://docs.oasis-open.org/odata/odata-json-format/v4.01/cs01/odata-json-format-v4.01-cs01.html#sec_BatchRequestsandResponses)
[SupportedFormats](./Org.OData.Capabilities.V1.xml#L406:~:text=<ComplexType%20Name="-,BatchSupportType,-")|\[MediaType\]|Media types of supported formats for $batch<dl>Allowed values:<dt>[multipart/mixed](./Org.OData.Capabilities.V1.xml#L411)<dd>[Multipart Batch Format](http://docs.oasis-open.org/odata/odata/v4.01/cs01/part1-protocol/odata-v4.01-cs01-part1-protocol.html#sec_MultipartBatchFormat)<dt>[application/json](./Org.OData.Capabilities.V1.xml#L415)<dd>[JSON Batch Format](http://docs.oasis-open.org/odata/odata-json-format/v4.01/cs01/odata-json-format-v4.01-cs01.html#sec_BatchRequestsandResponses)</dl>

**Applicable Annotation Terms:**

Expand Down
4 changes: 2 additions & 2 deletions vocabularies/Org.OData.Validation.V1.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Terms describing validation rules
Term|Type|Description
:---|:---|:----------
[Pattern](./Org.OData.Validation.V1.xml#L67:~:text=<Term%20Name="-,Pattern,-")|String|<a name="Pattern"></a>The pattern that a string property, parameter, or term must match. This SHOULD be a valid regular expression, according to the ECMA 262 regular expression dialect.
[Minimum](./Org.OData.Validation.V1.xml#L72:~:text=<Term%20Name="-,Minimum,-")|PrimitiveType|<a name="Minimum"></a>Minimum value that a property, parameter, or term can have.<br>Can be annotated with:<br>- [Exclusive](#Exclusive)
[Maximum](./Org.OData.Validation.V1.xml#L81:~:text=<Term%20Name="-,Maximum,-")|PrimitiveType|<a name="Maximum"></a>Maximum value that a property, parameter, or term can have.<br>Can be annotated with:<br>- [Exclusive](#Exclusive)
[Minimum](./Org.OData.Validation.V1.xml#L72:~:text=<Term%20Name="-,Minimum,-")|PrimitiveType|<a name="Minimum"></a>Minimum value that a property, parameter, or term can have.<br>Can be annotated with:<ul><li>[Exclusive](#Exclusive)</li></ul>
[Maximum](./Org.OData.Validation.V1.xml#L81:~:text=<Term%20Name="-,Maximum,-")|PrimitiveType|<a name="Maximum"></a>Maximum value that a property, parameter, or term can have.<br>Can be annotated with:<ul><li>[Exclusive](#Exclusive)</li></ul>
[Exclusive](./Org.OData.Validation.V1.xml#L90:~:text=<Term%20Name="-,Exclusive,-")|[Tag](Org.OData.Core.V1.md#Tag)|<a name="Exclusive"></a>Tags a Minimum or Maximum as exclusive, i.e. an open interval boundary.
[AllowedValues](./Org.OData.Validation.V1.xml#L94:~:text=<Term%20Name="-,AllowedValues,-")|\[[AllowedValue](#AllowedValue)\]|<a name="AllowedValues"></a>A collection of valid values for the annotated property, parameter, or type definition
[MultipleOf](./Org.OData.Validation.V1.xml#L108:~:text=<Term%20Name="-,MultipleOf,-")|Decimal|<a name="MultipleOf"></a>The value of the annotated property, parameter, or term must be an integer multiple of this positive value. For temporal types, the value is measured in seconds.
Expand Down

0 comments on commit 9af6f68

Please sign in to comment.