Skip to content

Commit

Permalink
Less color
Browse files Browse the repository at this point in the history
  • Loading branch information
ralfhandl committed Jul 25, 2023
1 parent 300ab16 commit 8b6d80c
Show file tree
Hide file tree
Showing 7 changed files with 133 additions and 175 deletions.
13 changes: 9 additions & 4 deletions lib/clean.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const clean = old
"$1"
)
.replace(
/<span[ \n](lang=[A-Z]+ )?style='(font-size:\n?[\d\.]+pt;[ \n]*)?color:\n?black(;\n?background:(white|#D9D9D9))?'>([^<]*)<\/span>/g,
/<span[ \n](lang=[A-Z]+ )?style='(font-size:\n?[\d\.]+pt;[ \n]*)?color:\n?black(;\n?background:\n?(white|#D9D9D9))?'>([^<]*)<\/span>/g,
"$5"
)
.replace(
Expand All @@ -45,15 +45,16 @@ const clean = old
)
.replace(/<span[ \n]style='color:(black|#333333)'>([^<]*)<\/span>/g, "$2")
.replace(
/<span[ \n]style='color:#333333;\n?background:white'>([^<]*)<\/span>/g,
"$1"
/<span[ \n]style='color:\n?(black|#333333);\n?background:\n?white'>([^<]*)<\/span>/g,
"$2"
)
.replace(/<span[ \n]class=MsoHyperlink>([^<]*)<\/span>/g, "$1")
.replace(
/<span[ \n]class=MsoHyperlink>([^<]*)<b>([^<]*)<\/b><\/span>/g,
"$1$2"
)
.replace(/<span lang=EN>([^<]*)<\/span>/g, "$1")
.replace(/<span[ \n]lang=EN>([^<]*)<\/span>/g, "$1")
.replace(/<span[ \n]class=string>([^<]*)<\/span>/g, "$1")
// TODO: clean up more <span> tags

// clean up code formatting
Expand All @@ -66,6 +67,10 @@ const clean = old
.replace(/<span[ \n]+class=VerbatimChar>([^<]*)<\/span>/g, "<code>$1</code>")
.replace(/<span[ \n]+class=CODEtemp>([^<]*)<\/span>/g, "$1")
.replaceAll("</code><code>", "")
.replace(
/<span[ \n]style='color:(black|#333333)'>((<code>|<\/code>|[^<])*)<\/span>/g,
"$2"
)
.replace(
/<p[ \n]+class=SourceCode>([^<]*)<\/p>/g,
"<p class=SourceCode><code>$1</code></p>"
Expand Down
13 changes: 5 additions & 8 deletions odata-protocol/temp/odata-v4.01-os-part1-protocol-clean.html
Original file line number Diff line number Diff line change
Expand Up @@ -2115,8 +2115,7 @@ <h2>##subsec Singleton</h2>

<p class=Code style='margin:0in;margin-bottom:.0001pt;background:#D9D9D9'><code>http://host/service/MainSupplier</code></p>

<p class=Code style='margin:0in;margin-bottom:.0001pt;background:#D9D9D9'><span
style='color:black'>http://host/service/$metadata#<code>MainSupplier</code></span></p>
<p class=Code style='margin:0in;margin-bottom:.0001pt;background:#D9D9D9'>http://host/service/$metadata#<code>MainSupplier</code></p>

</div>

Expand Down Expand Up @@ -2589,8 +2588,7 @@ <h2>##subsec Delta Payload Response</h2>
solid windowtext 1.0pt;border-right:none;padding:3.0pt 0in 3.0pt 0in;
background:#D9D9D9;margin-left:.3in;margin-right:.3in'>

<p class=Code style='margin:0in;margin-bottom:.0001pt;background:#D9D9D9'><span
style='color:black'>http://host/service/Customers<code>?$deltatoken=1234</code></span></p>
<p class=Code style='margin:0in;margin-bottom:.0001pt;background:#D9D9D9'>http://host/service/Customers<code>?$deltatoken=1234</code></p>

<p class=Code style='margin:0in;margin-bottom:.0001pt;background:#D9D9D9'><code>http://host/service/$metadata#Customers/$delta</code></p>

Expand Down Expand Up @@ -4345,9 +4343,8 @@ <h4>##subsubsubsec System Query Option <code>$search</code></h4>
solid windowtext 1.0pt;border-right:none;padding:3.0pt 0in 3.0pt 0in;
background:#D9D9D9;margin-left:.3in;margin-right:.3in'>

<p class=Code style='margin:0in;margin-bottom:.0001pt;background:#D9D9D9'><span
style='color:black'>GET http://host/service/Products?$search=(mountain OR bike)
AND NOT clothing </span></p>
<p class=Code style='margin:0in;margin-bottom:.0001pt;background:#D9D9D9'>GET http://host/service/Products?$search=(mountain OR bike)
AND NOT clothing </p>

</div>

Expand Down Expand Up @@ -4408,7 +4405,7 @@ <h4>##subsubsubsec Requesting an Individual
background:#D9D9D9;margin-left:.3in;margin-right:.3in'>

<p class=Code style='margin:0in;margin-bottom:.0001pt;page-break-after:avoid;
background:#D9D9D9'><span style='color:black'>GET http://host/service/Suppliers(MainSupplier)/Addresses/0</span></p>
background:#D9D9D9'>GET http://host/service/Suppliers(MainSupplier)/Addresses/0</p>

</div>

Expand Down
11 changes: 5 additions & 6 deletions odata-protocol/temp/odata-v4.01-os-part1-protocol-raw.md
Original file line number Diff line number Diff line change
Expand Up @@ -1903,7 +1903,7 @@ solid windowtext 1.0pt;border-right:none;padding:3.0pt 0in 3.0pt 0in;
background:#D9D9D9;margin-left:.3in;margin-right:.3in"}
`http://host/service/MainSupplier`

[http://host/service/\$metadata#`MainSupplier`]{style="color:black"}
http://host/service/\$metadata#`MainSupplier`
:::

## ##subsec Collection of Derived Entities
Expand Down Expand Up @@ -2339,7 +2339,7 @@ Example 30: resource URL and corresponding context URL
::: {style="border-top:solid windowtext 1.0pt;border-left:none;border-bottom:
solid windowtext 1.0pt;border-right:none;padding:3.0pt 0in 3.0pt 0in;
background:#D9D9D9;margin-left:.3in;margin-right:.3in"}
[http://host/service/Customers`?$deltatoken=1234`]{style="color:black"}
http://host/service/Customers`?$deltatoken=1234`

`http://host/service/$metadata#Customers/$delta`
:::
Expand Down Expand Up @@ -3429,8 +3429,8 @@ Example 63: return all Products that match either \"mountain\" or
::: {style="border-top:solid windowtext 1.0pt;border-left:none;border-bottom:
solid windowtext 1.0pt;border-right:none;padding:3.0pt 0in 3.0pt 0in;
background:#D9D9D9;margin-left:.3in;margin-right:.3in"}
[GET http://host/service/Products?\$search=(mountain OR bike) AND NOT
clothing ]{style="color:black"}
GET http://host/service/Products?\$search=(mountain OR bike) AND NOT
clothing
:::

The operations within a search expression MUST be evaluated in the
Expand Down Expand Up @@ -3485,8 +3485,7 @@ Example 64: the first address in a list of addresses for `MainSupplier`
::: {style="border-top:solid windowtext 1.0pt;border-left:none;border-bottom:
solid windowtext 1.0pt;border-right:none;padding:3.0pt 0in 3.0pt 0in;
background:#D9D9D9;margin-left:.3in;margin-right:.3in"}
[GET
http://host/service/Suppliers(MainSupplier)/Addresses/0]{style="color:black"}
GET http://host/service/Suppliers(MainSupplier)/Addresses/0
:::

### ##subsubsec Requesting Related Entities
Expand Down
11 changes: 5 additions & 6 deletions odata-protocol/temp/odata-v4.01-os-part1-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -1851,7 +1851,7 @@ Example ##ex: resource URL and corresponding context URL
`http://host/service/MainSupplier`
:::
[http://host/service/\$metadata#`MainSupplier`]{style="color:black"}
http://host/service/\$metadata#`MainSupplier`
```

## ##subsec Collection of Derived Entities
Expand Down Expand Up @@ -2271,7 +2271,7 @@ of the containing entity.
::: example
Example ##ex: resource URL and corresponding context URL
```
[http://host/service/Customers`?$deltatoken=1234`]{style="color:black"}
http://host/service/Customers`?$deltatoken=1234`
:::
`http://host/service/$metadata#Customers/$delta`
Expand Down Expand Up @@ -3302,8 +3302,8 @@ expressions.
Example ##ex: return all Products that match either \"mountain\" or
\"bike\" and do not match clothing
```
[GET http://host/service/Products?\$search=(mountain OR bike) AND NOT
clothing ]{style="color:black"}
GET http://host/service/Products?\$search=(mountain OR bike) AND NOT
clothing
```
:::

Expand Down Expand Up @@ -3357,8 +3357,7 @@ accessible using an ordinal index.
::: example
Example ##ex: the first address in a list of addresses for `MainSupplier`
```
[GET
http://host/service/Suppliers(MainSupplier)/Addresses/0]{style="color:black"}
GET http://host/service/Suppliers(MainSupplier)/Addresses/0
```
:::

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,7 @@ <h2>##subsec URL Syntax</h2>
<p class=Code style='margin:0in;margin-bottom:.0001pt;page-break-after:avoid;
background:#D9D9D9'>http://host/service/People%28%27O%27%27Neil%27%29</p>

<p class=Code style='margin:0in;margin-bottom:.0001pt;background:#D9D9D9'><span
style='color:black'>http://host/service/<code>Categories</code>('Smartphone%2FTablet')</span></p>
<p class=Code style='margin:0in;margin-bottom:.0001pt;background:#D9D9D9'>http://host/service/<code>Categories</code>('Smartphone%2FTablet')</p>

</div>

Expand All @@ -257,13 +256,12 @@ <h2>##subsec URL Syntax</h2>
background:#D9D9D9;margin-left:.3in;margin-right:.3in'>

<p class=Code style='margin:0in;margin-bottom:.0001pt;page-break-after:avoid;
background:#D9D9D9'><span style='color:black'>http://host/service<code>/People('O'Neil')&nbsp;</code></span></p>
background:#D9D9D9'>http://host/service<code>/People('O'Neil')&nbsp;</code></p>

<p class=Code style='margin:0in;margin-bottom:.0001pt;page-break-after:avoid;
background:#D9D9D9'><span style='color:black'>http://host/service<code>/People('O%27Neil')&nbsp;</code></span></p>
background:#D9D9D9'>http://host/service<code>/People('O%27Neil')&nbsp;</code></p>

<p class=Code style='margin:0in;margin-bottom:.0001pt;background:#D9D9D9'><span
style='color:black'>http://host/service<code>/Categories('Smartphone/Tablet')&nbsp;</code></span></p>
<p class=Code style='margin:0in;margin-bottom:.0001pt;background:#D9D9D9'>http://host/service<code>/Categories('Smartphone/Tablet')&nbsp;</code></p>

</div>

Expand Down Expand Up @@ -785,8 +783,7 @@ <h3>##subsubsec Key-as-Segment Convention</h3>
<p class=Code style='margin:0in;margin-bottom:.0001pt;page-break-after:avoid;
background:#D9D9D9'>http://host/service/People/O%27Neil&nbsp;</p>

<p class=Code style='margin:0in;margin-bottom:.0001pt;background:#D9D9D9'><span
style='color:black'>http://host/service/<code>Categories</code>/Smartphone%2FTablet</span></p>
<p class=Code style='margin:0in;margin-bottom:.0001pt;background:#D9D9D9'>http://host/service/<code>Categories</code>/Smartphone%2FTablet</p>

</div>

Expand Down Expand Up @@ -2050,8 +2047,7 @@ <h5>##subsubsubsubsec <a

<p class=MsoNormal>The <code>mul</code> operator multiplies the
left and right numeric operands. The
<code>mul</code><span style='color:#333333;background:
white'> operator is also valid for multiplying a </span><code>Duration</code> value with a numeric value.</p>
<code>mul</code> operator is also valid for multiplying a <code>Duration</code> value with a numeric value.</p>

<p class=MsoNormal>For operands of
type <code>Edm.Decimal</code> the scale of the result is scaleof(A mul B) = scaleof(A) + scaleof(B),
Expand All @@ -2073,11 +2069,10 @@ <h5>##subsubsubsubsec <a href="#sec_Division">Division</a> </h5>

<p class=MsoNormal><a
name="_Toc371341769">For operands of
type </a><code>Edm.Decimal</code> <span style='color:
#333333;background:white'>the result is computed with maximal decimal scale. If
type </a><code>Edm.Decimal</code> the result is computed with maximal decimal scale. If
any operand has floating scale, the result has floating scale, else if any
operand has variable scale, the result has variable scale. Otherwise the
resulting scale is service-specific, and clients can use </span><code>cast</code> to
resulting scale is service-specific, and clients can use <code>cast</code> to
force the result to a specific scale. </p>

<p class=MsoNormal>The <code>div</code> and<code>
Expand Down Expand Up @@ -2758,8 +2753,7 @@ <h5>##subsubsubsubsec <code>day</code></h5>

<p class=MsoNormal>Services that are unable to preserve the offset of <code>Edm.DateTimeOffset</code> values and instead normalize the values
to some common time zone (i.e. UTC) MUST
fail evaluation of the <code>day</code> function for literal <code>Edm.DateTimeOffset</code> <span style='color:black;background:
white'>values that are not stated in the time zone of the normalized values.</span></p>
fail evaluation of the <code>day</code> function for literal <code>Edm.DateTimeOffset</code> values that are not stated in the time zone of the normalized values.</p>

<p class=MsoCaption>Example 85: all employees born on the 8th day of a month</p>

Expand Down Expand Up @@ -2820,8 +2814,7 @@ <h5>##subsubsubsubsec <code>hour</code></h5>

<p class=MsoNormal>Services that are unable to preserve the offset of <code>Edm.DateTimeOffset</code> values and instead normalize the values
to some common time zone (i.e. UTC) MUST
fail evaluation of the <code>hour</code> function for literal <code>Edm.DateTimeOffset</code> <span style='color:black;background:
white'>values that are not stated in the time zone of the normalized values.</span></p>
fail evaluation of the <code>hour</code> function for literal <code>Edm.DateTimeOffset</code> values that are not stated in the time zone of the normalized values.</p>

<p class=MsoCaption>Example 87: all employees born in hour 4, between 04:00
(inclusive) and 05:00 (exclusive) </p>
Expand Down Expand Up @@ -2902,8 +2895,7 @@ <h5>##subsubsubsubsec <code>month</code></h5>

<p class=MsoNormal>Services that are unable to preserve the offset of <code>Edm.DateTimeOffset</code> values and instead normalize the values
to some common time zone (i.e. UTC) MUST
fail evaluation of the <code>month</code> function for literal <code>Edm.DateTimeOffset</code> <span style='color:black;background:
white'>values that are not stated in the time zone of the normalized values.</span></p>
fail evaluation of the <code>month</code> function for literal <code>Edm.DateTimeOffset</code> values that are not stated in the time zone of the normalized values.</p>

<p class=MsoCaption>Example 89: all employees born in May</p>

Expand Down Expand Up @@ -2975,8 +2967,7 @@ <h5>##subsubsubsubsec <code>time</code></h5>

<p class=MsoNormal>Services that are unable to preserve the offset of <code>Edm.DateTimeOffset</code> values and instead normalize the values
to some common time zone (i.e. UTC) MUST
fail evaluation of the <code>time</code> function for literal <code>Edm.DateTimeOffset</code> <span style='color:black;background:
white'>values that are not stated in the time zone of the normalized values.</span></p>
fail evaluation of the <code>time</code> function for literal <code>Edm.DateTimeOffset</code> values that are not stated in the time zone of the normalized values.</p>

<h5>##subsubsubsubsec <code>totaloffsetminutes</code></h5>

Expand Down Expand Up @@ -3012,15 +3003,13 @@ <h5>##subsubsubsubsec <code>year</code></h5>
<p class=MsoNormal>The <code>year</code> function returns the
year component of the <code>Date</code> or <code>DateTimeOffset</code>
parameter value, evaluated in the
time zone of the<span style='font-size:9.0pt;color:black;background:
white'> </span><code>DateTimeOffset</code> parameter value. The <code>yearMethodCallExpr</code>
time zone of the <code>DateTimeOffset</code> parameter value. The <code>yearMethodCallExpr</code>
syntax rule defines how the <code>year</code> function is
invoked.</p>

<p class=MsoNormal>Services that are unable to preserve the offset of <code>Edm.DateTimeOffset</code> values and instead normalize the values
to some common time zone (i.e. UTC) MUST
fail evaluation of the <code>year</code> function for literal <code>Edm.DateTimeOffset</code> <span style='color:black;background:
white'>values that are not stated in the time zone of the normalized values.</span></p>
fail evaluation of the <code>year</code> function for literal <code>Edm.DateTimeOffset</code> values that are not stated in the time zone of the normalized values.</p>

<p class=MsoCaption>Example 91: all employees born in 1971</p>

Expand Down Expand Up @@ -3452,50 +3441,35 @@ <h5>##subsubsubsubsec Primitive Literals</h5>

<p class=Code style='margin:0in;margin-bottom:.0001pt;background:#D9D9D9'>DoubleValue ge 0.31415926535897931e1</p>

<p class=Code style='margin:0in;margin-bottom:.0001pt;background:#D9D9D9'><span
class=string>SingleValue</span><span
style='color:black'> eq <span class=string>INF</span></span></p>
<p class=Code style='margin:0in;margin-bottom:.0001pt;background:#D9D9D9'>SingleValue eq INF</p>

<p class=Code style='margin:0in;margin-bottom:.0001pt;background:#D9D9D9'><span
class=string>DecimalValue eq 34.95</span></p>
<p class=Code style='margin:0in;margin-bottom:.0001pt;background:#D9D9D9'>DecimalValue eq 34.95</p>

<p class=Code style='margin:0in;margin-bottom:.0001pt;background:#D9D9D9'><span
style='color:black'>StringValue eq '<span class=string>Say Hello,then go'</span></span></p>
<p class=Code style='margin:0in;margin-bottom:.0001pt;background:#D9D9D9'>StringValue eq 'Say Hello,then go'</p>

<p class=Code style='margin:0in;margin-bottom:.0001pt;background:#D9D9D9'><span
class=string>DateValue eq 2012-12-03</span></p>
<p class=Code style='margin:0in;margin-bottom:.0001pt;background:#D9D9D9'>DateValue eq 2012-12-03</p>

<p class=Code style='margin:0in;margin-bottom:.0001pt;background:#D9D9D9'><span
class=string>DateTimeOffsetValue eq
2012-12-03T07:16:23Z</span></p>
<p class=Code style='margin:0in;margin-bottom:.0001pt;background:#D9D9D9'>DateTimeOffsetValue eq
2012-12-03T07:16:23Z</p>

<p class=Code style='margin:0in;margin-bottom:.0001pt;background:#D9D9D9'><span
class=string>DurationValue eq
duration'P12DT23H59M59.999999999999S'</span></p>
<p class=Code style='margin:0in;margin-bottom:.0001pt;background:#D9D9D9'>DurationValue eq
duration'P12DT23H59M59.999999999999S'</p>

<p class=Code style='margin:0in;margin-bottom:.0001pt;background:#D9D9D9'><span
class=string>DurationValue eq
'P12DT23H59M59.999999999999S'</span></p>
<p class=Code style='margin:0in;margin-bottom:.0001pt;background:#D9D9D9'>DurationValue eq
'P12DT23H59M59.999999999999S'</p>

<p class=Code style='margin:0in;margin-bottom:.0001pt;background:#D9D9D9'><span
class=string>TimeOfDayValue eq 07:59:59.999</span></p>
<p class=Code style='margin:0in;margin-bottom:.0001pt;background:#D9D9D9'>TimeOfDayValue eq 07:59:59.999</p>

<p class=Code style='margin:0in;margin-bottom:.0001pt;background:#D9D9D9'><span
class=string>GuidValue eq 01234567-89ab-cdef-0123-456789abcdef</span></p>
<p class=Code style='margin:0in;margin-bottom:.0001pt;background:#D9D9D9'>GuidValue eq 01234567-89ab-cdef-0123-456789abcdef</p>

<p class=Code style='margin:0in;margin-bottom:.0001pt;background:#D9D9D9'><span
class=string>Int64Value eq</span><span
style='color:black'> <span class=string>0</span></span></p>
<p class=Code style='margin:0in;margin-bottom:.0001pt;background:#D9D9D9'>Int64Value eq 0</p>

<p class=Code style='margin:0in;margin-bottom:.0001pt;background:#D9D9D9'><span
style='color:black'>ColorEnumValue eq <code>Sales.Pattern'Yellow'</code>,</span></p>
<p class=Code style='margin:0in;margin-bottom:.0001pt;background:#D9D9D9'>ColorEnumValue eq <code>Sales.Pattern'Yellow'</code>,</p>

<p class=Code style='margin:0in;margin-bottom:.0001pt;background:#D9D9D9'><span
style='color:black'>ColorEnumValue eq <code>'Yellow'</code>,</span></p>
<p class=Code style='margin:0in;margin-bottom:.0001pt;background:#D9D9D9'>ColorEnumValue eq <code>'Yellow'</code>,</p>

<p class=Code style='margin:0in;margin-bottom:.0001pt;background:#D9D9D9'><span
class=string>geo.distance(Location,geography'SRID=0;Point(142.1
64.1)')</span></p>
<p class=Code style='margin:0in;margin-bottom:.0001pt;background:#D9D9D9'>geo.distance(Location,geography'SRID=0;Point(142.1
64.1)')</p>

</div>

Expand Down Expand Up @@ -3771,8 +3745,8 @@ <h4>##subsubsubsec Annotation Values in Expressions</h4>
background:#D9D9D9;margin-left:.3in;margin-right:.3in'>

<p class=Code style='margin:0in;margin-bottom:.0001pt;page-break-after:avoid;
background:#D9D9D9'><span style='color:black'>http://host/service/[email protected]/any(m:m/severity
eq <code>'</code>error<code>'</code>)</span></p>
background:#D9D9D9'>http://host/service/[email protected]/any(m:m/severity
eq <code>'</code>error<code>'</code>)</p>

</div>

Expand Down
Loading

0 comments on commit 8b6d80c

Please sign in to comment.