Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 120 additions & 6 deletions overlay/v1.0.0.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE html><html lang="en"><head>
<meta charset="UTF-8">
<meta name="generator" content="ReSpec 35.1.1">
<meta name="generator" content="ReSpec 35.6.0">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<style>
dfn{cursor:pointer}
Expand All @@ -24,7 +24,7 @@
</style>
<title>Overlay Specification v1.0.0</title>
<script type="text/javascript" async="" src="https://www.google-analytics.com/analytics.js"></script>
<script type="text/javascript" async="" src="https://www.googletagmanager.com/gtag/js?id=G-JR4K3ZJLPH&amp;l=dataLayer&amp;cx=c&amp;gtm=457e4bk0za200"></script>
<script type="text/javascript" async="" src="https://www.googletagmanager.com/gtag/js?id=G-JR4K3ZJLPH&amp;cx=c&amp;gtm=4e5am1h1"></script>
<style id="respec-mainstyle">
@keyframes pop{
0%{transform:scale(1,1)}
Expand All @@ -41,7 +41,7 @@
.respec-offending-element{background:url(data:image/gif;base64,R0lGODdhBAADAPEAANv///8AAP///wAAACwAAAAABAADAEACBZQjmIAFADs=) bottom repeat-x}
}
#references :target{background:#eaf3ff;animation:pop .4s ease-in-out 0s 1}
cite .bibref{font-style:normal}
cite .bibref{font-style:italic}
a[href].orcid{padding-left:4px;padding-right:4px}
a[href].orcid>svg{margin-bottom:-2px}
ol.tof,ul.tof{list-style:none outside none}
Expand Down Expand Up @@ -83,6 +83,23 @@
<meta name="description" content="The Overlay Specification defines a document format for information that augments an existing [OpenAPI] description yet remains separate from the OpenAPI description’s source document(s).">
<link rel="canonical" href="https://spec.openapis.org/overlay/v1.0.0.html">
<style>
var:hover{text-decoration:underline;cursor:pointer}
var.respec-hl{color:var(--color,#000);background-color:var(--bg-color);box-shadow:0 0 0 2px var(--bg-color)}
@media (prefers-color-scheme:dark){
var.respec-hl{filter:saturate(.9) brightness(.9)}
}
var.respec-hl-c1{--bg-color:#f4d200}
var.respec-hl-c2{--bg-color:#ff87a2}
var.respec-hl-c3{--bg-color:#96e885}
var.respec-hl-c4{--bg-color:#3eeed2}
var.respec-hl-c5{--bg-color:#eacfb6}
var.respec-hl-c6{--bg-color:#82ddff}
var.respec-hl-c7{--bg-color:#ffbcf2}
@media print{
var.respec-hl{background:0 0;color:#000;box-shadow:unset}
}
</style>
<style>
var{position:relative;cursor:pointer}
var[data-type]::after,var[data-type]::before{position:absolute;left:50%;top:-6px;opacity:0;transition:opacity .4s;pointer-events:none}
var[data-type]::before{content:"";transform:translateX(-50%);border-width:4px 6px 0 6px;border-style:solid;border-color:transparent;border-top-color:#222}
Expand Down Expand Up @@ -522,11 +539,11 @@ <h1 id="title" class="title">Overlay Specification v1.0.0 </h1> <h2 id="subtitle
</dd><dt id="bib-rfc3986">[RFC3986]</dt><dd>
<a href="https://www.rfc-editor.org/rfc/rfc3986"><cite>Uniform Resource Identifier (URI): Generic Syntax</cite></a>. T. Berners-Lee; R. Fielding; L. Masinter. IETF. January 2005. Internet Standard. URL: <a href="https://www.rfc-editor.org/rfc/rfc3986">https://www.rfc-editor.org/rfc/rfc3986</a>
</dd><dt id="bib-rfc7159">[RFC7159]</dt><dd>
<a href="https://www.rfc-editor.org/rfc/rfc7159"><cite>The JavaScript Object Notation (JSON) Data Interchange Format</cite></a>. T. Bray, Ed.. IETF. March 2014. Proposed Standard. URL: <a href="https://www.rfc-editor.org/rfc/rfc7159">https://www.rfc-editor.org/rfc/rfc7159</a>
<a href="https://www.rfc-editor.org/rfc/rfc7159"><cite>The JavaScript Object Notation (JSON) Data Interchange Format</cite></a>. T. Bray, Ed. IETF. March 2014. Proposed Standard. URL: <a href="https://www.rfc-editor.org/rfc/rfc7159">https://www.rfc-editor.org/rfc/rfc7159</a>
</dd><dt id="bib-rfc8174">[RFC8174]</dt><dd>
<a href="https://www.rfc-editor.org/rfc/rfc8174"><cite>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</cite></a>. B. Leiba. IETF. May 2017. Best Current Practice. URL: <a href="https://www.rfc-editor.org/rfc/rfc8174">https://www.rfc-editor.org/rfc/rfc8174</a>
</dd><dt id="bib-rfc9535">[RFC9535]</dt><dd>
<a href="https://www.rfc-editor.org/rfc/rfc9535"><cite>JSONPath: Query Expressions for JSON</cite></a>. S. Gössner, Ed.; G. Normington, Ed.; C. Bormann, Ed.. IETF. February 2024. Proposed Standard. URL: <a href="https://www.rfc-editor.org/rfc/rfc9535">https://www.rfc-editor.org/rfc/rfc9535</a>
<a href="https://www.rfc-editor.org/rfc/rfc9535"><cite>JSONPath: Query Expressions for JSON</cite></a>. S. Gössner, Ed.; G. Normington, Ed.; C. Bormann, Ed. IETF. February 2024. Proposed Standard. URL: <a href="https://www.rfc-editor.org/rfc/rfc9535">https://www.rfc-editor.org/rfc/rfc9535</a>
</dd><dt id="bib-yaml">[YAML]</dt><dd>
<a href="http://yaml.org/spec/1.2/spec.html"><cite>YAML Ain’t Markup Language (YAML™) Version 1.2</cite></a>. Oren Ben-Kiki; Clark Evans; Ingy döt Net. 1 October 2009. URL: <a href="http://yaml.org/spec/1.2/spec.html">http://yaml.org/spec/1.2/spec.html</a>
</dd></dl>
Expand All @@ -552,7 +569,104 @@ <h1 id="title" class="title">Overlay Specification v1.0.0 </h1> <h2 id="subtitle
<ul>
<li>Not referenced in this document.</li>
</ul>
</div><script id="respec-dfn-panel">(() => {
</div><script id="respec-highlight-vars">(() => {
// @ts-check

if (document.respec) {
document.respec.ready.then(setupVarHighlighter);
} else {
setupVarHighlighter();
}

function setupVarHighlighter() {
document
.querySelectorAll("var")
.forEach(varElem => varElem.addEventListener("click", highlightListener));
}

function highlightListener(ev) {
ev.stopPropagation();
const { target: varElem } = ev;
const hightligtedElems = highlightVars(varElem);
const resetListener = () => {
const hlColor = getHighlightColor(varElem);
hightligtedElems.forEach(el => removeHighlight(el, hlColor));
[...HL_COLORS.keys()].forEach(key => HL_COLORS.set(key, true));
};
if (hightligtedElems.length) {
document.body.addEventListener("click", resetListener, { once: true });
}
}

// availability of highlight colors. colors from var.css
const HL_COLORS = new Map([
["respec-hl-c1", true],
["respec-hl-c2", true],
["respec-hl-c3", true],
["respec-hl-c4", true],
["respec-hl-c5", true],
["respec-hl-c6", true],
["respec-hl-c7", true],
]);

function getHighlightColor(target) {
// return current colors if applicable
const { value } = target.classList;
const re = /respec-hl-\w+/;
const activeClass = re.test(value) && value.match(re);
if (activeClass) return activeClass[0];

// first color preference
if (HL_COLORS.get("respec-hl-c1") === true) return "respec-hl-c1";

// otherwise get some other available color
return [...HL_COLORS.keys()].find(c => HL_COLORS.get(c)) || "respec-hl-c1";
}

function highlightVars(varElem) {
const textContent = norm(varElem.textContent);
const parent = varElem.closest(".algorithm, section");
const highlightColor = getHighlightColor(varElem);

const varsToHighlight = [...parent.querySelectorAll("var")].filter(
el =>
norm(el.textContent) === textContent &&
el.closest(".algorithm, section") === parent
);

// update availability of highlight color
const colorStatus = varsToHighlight[0].classList.contains("respec-hl");
HL_COLORS.set(highlightColor, colorStatus);

// highlight vars
if (colorStatus) {
varsToHighlight.forEach(el => removeHighlight(el, highlightColor));
return [];
} else {
varsToHighlight.forEach(el => addHighlight(el, highlightColor));
}
return varsToHighlight;
}

function removeHighlight(el, highlightColor) {
el.classList.remove("respec-hl", highlightColor);
// clean up empty class attributes so they don't come in export
if (!el.classList.length) el.removeAttribute("class");
}

function addHighlight(elem, highlightColor) {
elem.classList.add("respec-hl", highlightColor);
}

/**
* Same as `norm` from src/core/utils, but our build process doesn't allow
* imports in runtime scripts, so duplicated here.
* @param {string} str
*/
function norm(str) {
return str.trim().replace(/\s+/g, " ");
}
})()</script><script id="respec-dfn-panel">(() => {
// @ts-check
if (document.respec) {
document.respec.ready.then(setupPanel);
Expand Down
1 change: 1 addition & 0 deletions overlay/v1.1.html