Myxogastria0808/web-api-docs-template
0
1<!DOCTYPE html>2<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>3 4<meta charset="utf-8">5<meta name="generator" content="quarto-1.5.57">6 7<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">8 9 10<title>Docs</title>11<style>12code{white-space: pre-wrap;}13span.smallcaps{font-variant: small-caps;}14div.columns{display: flex; gap: min(4vw, 1.5em);}15div.column{flex: auto; overflow-x: auto;}16div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}17ul.task-list{list-style: none;}18ul.task-list li input[type="checkbox"] {19 width: 0.8em;20 margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */ 21 vertical-align: middle;22}23</style>24 25 26<script src="site_libs/quarto-nav/quarto-nav.js"></script>27<script src="site_libs/quarto-nav/headroom.min.js"></script>28<script src="site_libs/clipboard/clipboard.min.js"></script>29<script src="site_libs/quarto-search/autocomplete.umd.js"></script>30<script src="site_libs/quarto-search/fuse.min.js"></script>31<script src="site_libs/quarto-search/quarto-search.js"></script>32<meta name="quarto:offset" content="./">33<script src="site_libs/quarto-html/quarto.js"></script>34<script src="site_libs/quarto-html/popper.min.js"></script>35<script src="site_libs/quarto-html/tippy.umd.min.js"></script>36<script src="site_libs/quarto-html/anchor.min.js"></script>37<link href="site_libs/quarto-html/tippy.css" rel="stylesheet">38<link href="site_libs/quarto-html/quarto-syntax-highlighting.css" rel="stylesheet" id="quarto-text-highlighting-styles">39<script src="site_libs/bootstrap/bootstrap.min.js"></script>40<link href="site_libs/bootstrap/bootstrap-icons.css" rel="stylesheet">41<link href="site_libs/bootstrap/bootstrap.min.css" rel="stylesheet" id="quarto-bootstrap" data-mode="light">42<script id="quarto-search-options" type="application/json">{43 "location": "navbar",44 "copy-button": false,45 "collapse-after": 3,46 "panel-placement": "end",47 "type": "overlay",48 "limit": 50,49 "keyboard-shortcut": [50 "f",51 "/",52 "s"53 ],54 "show-item-context": false,55 "language": {56 "search-no-results-text": "No results",57 "search-matching-documents-text": "matching documents",58 "search-copy-link-title": "Copy link to search",59 "search-hide-matches-text": "Hide additional matches",60 "search-more-match-text": "more match in this document",61 "search-more-matches-text": "more matches in this document",62 "search-clear-button-title": "Clear",63 "search-text-placeholder": "",64 "search-detached-cancel-button-title": "Cancel",65 "search-submit-button-title": "Submit",66 "search-label": "Search"67 }68}</script>69 70 71<link rel="stylesheet" href="styles.css">72</head>73 74<body class="nav-fixed">75 76<div id="quarto-search-results"></div>77 <header id="quarto-header" class="headroom fixed-top">78 <nav class="navbar navbar-expand-lg " data-bs-theme="dark">79 <div class="navbar-container container-fluid">80 <div id="quarto-search" class="" title="Search"></div>81 <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarCollapse" aria-controls="navbarCollapse" role="menu" aria-expanded="false" aria-label="Toggle navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">82 <span class="navbar-toggler-icon"></span>83</button>84 <div class="collapse navbar-collapse" id="navbarCollapse">85 <ul class="navbar-nav navbar-nav-scroll me-auto">86 <li class="nav-item">87 <a class="nav-link" href="./index.html"> 88<span class="menu-text">Home</span></a>89 </li> 90 <li class="nav-item">91 <a class="nav-link active" href="./docs.html" aria-current="page"> 92<span class="menu-text">Docs</span></a>93 </li> 94</ul>95 </div> <!-- /navcollapse -->96 <div class="quarto-navbar-tools">97</div>98 </div> <!-- /container-fluid -->99 </nav>100</header>101<!-- content -->102<div id="quarto-content" class="quarto-container page-columns page-rows-contents page-layout-article page-navbar">103<!-- sidebar -->104<!-- margin-sidebar -->105 <div id="quarto-margin-sidebar" class="sidebar margin-sidebar">106 <nav id="TOC" role="doc-toc" class="toc-active">107 <h2 id="toc-title">On this page</h2>108 109 <ul>110 <li><a href="#docs-sample" id="toc-docs-sample" class="nav-link active" data-scroll-target="#docs-sample">Docs Sample</a></li>111 </ul>112</nav>113 </div>114<!-- main -->115<main class="content" id="quarto-document-content">116 117<header id="title-block-header" class="quarto-title-block default">118<div class="quarto-title">119<h1 class="title">Docs</h1>120</div>121 122 123 124<div class="quarto-title-meta">125 126 127 128 129 </div>130 131 132 133</header>134 135 136<section id="docs-sample" class="level2">137<h2 class="anchored" data-anchor-id="docs-sample">Docs Sample</h2>138<p>This is a docs page.</p>139 140 141</section>142 143</main> <!-- /main -->144<script id="quarto-html-after-body" type="application/javascript">145window.document.addEventListener("DOMContentLoaded", function (event) {146 const toggleBodyColorMode = (bsSheetEl) => {147 const mode = bsSheetEl.getAttribute("data-mode");148 const bodyEl = window.document.querySelector("body");149 if (mode === "dark") {150 bodyEl.classList.add("quarto-dark");151 bodyEl.classList.remove("quarto-light");152 } else {153 bodyEl.classList.add("quarto-light");154 bodyEl.classList.remove("quarto-dark");155 }156 }157 const toggleBodyColorPrimary = () => {158 const bsSheetEl = window.document.querySelector("link#quarto-bootstrap");159 if (bsSheetEl) {160 toggleBodyColorMode(bsSheetEl);161 }162 }163 toggleBodyColorPrimary(); 164 const icon = "";165 const anchorJS = new window.AnchorJS();166 anchorJS.options = {167 placement: 'right',168 icon: icon169 };170 anchorJS.add('.anchored');171 const isCodeAnnotation = (el) => {172 for (const clz of el.classList) {173 if (clz.startsWith('code-annotation-')) { 174 return true;175 }176 }177 return false;178 }179 const onCopySuccess = function(e) {180 // button target181 const button = e.trigger;182 // don't keep focus183 button.blur();184 // flash "checked"185 button.classList.add('code-copy-button-checked');186 var currentTitle = button.getAttribute("title");187 button.setAttribute("title", "Copied!");188 let tooltip;189 if (window.bootstrap) {190 button.setAttribute("data-bs-toggle", "tooltip");191 button.setAttribute("data-bs-placement", "left");192 button.setAttribute("data-bs-title", "Copied!");193 tooltip = new bootstrap.Tooltip(button, 194 { trigger: "manual", 195 customClass: "code-copy-button-tooltip",196 offset: [0, -8]});197 tooltip.show(); 198 }199 setTimeout(function() {200 if (tooltip) {201 tooltip.hide();202 button.removeAttribute("data-bs-title");203 button.removeAttribute("data-bs-toggle");204 button.removeAttribute("data-bs-placement");205 }206 button.setAttribute("title", currentTitle);207 button.classList.remove('code-copy-button-checked');208 }, 1000);209 // clear code selection210 e.clearSelection();211 }212 const getTextToCopy = function(trigger) {213 const codeEl = trigger.previousElementSibling.cloneNode(true);214 for (const childEl of codeEl.children) {215 if (isCodeAnnotation(childEl)) {216 childEl.remove();217 }218 }219 return codeEl.innerText;220 }221 const clipboard = new window.ClipboardJS('.code-copy-button:not([data-in-quarto-modal])', {222 text: getTextToCopy223 });224 clipboard.on('success', onCopySuccess);225 if (window.document.getElementById('quarto-embedded-source-code-modal')) {226 // For code content inside modals, clipBoardJS needs to be initialized with a container option227 // TODO: Check when it could be a function (https://github.com/zenorocha/clipboard.js/issues/860)228 const clipboardModal = new window.ClipboardJS('.code-copy-button[data-in-quarto-modal]', {229 text: getTextToCopy,230 container: window.document.getElementById('quarto-embedded-source-code-modal')231 });232 clipboardModal.on('success', onCopySuccess);233 }234 var localhostRegex = new RegExp(/^(?:http|https):\/\/localhost\:?[0-9]*\//);235 var mailtoRegex = new RegExp(/^mailto:/);236 var filterRegex = new RegExp('/' + window.location.host + '/');237 var isInternal = (href) => {238 return filterRegex.test(href) || localhostRegex.test(href) || mailtoRegex.test(href);239 }240 // Inspect non-navigation links and adorn them if external241 var links = window.document.querySelectorAll('a[href]:not(.nav-link):not(.navbar-brand):not(.toc-action):not(.sidebar-link):not(.sidebar-item-toggle):not(.pagination-link):not(.no-external):not([aria-hidden]):not(.dropdown-item):not(.quarto-navigation-tool):not(.about-link)');242 for (var i=0; i<links.length; i++) {243 const link = links[i];244 if (!isInternal(link.href)) {245 // undo the damage that might have been done by quarto-nav.js in the case of246 // links that we want to consider external247 if (link.dataset.originalHref !== undefined) {248 link.href = link.dataset.originalHref;249 }250 }251 }252 function tippyHover(el, contentFn, onTriggerFn, onUntriggerFn) {253 const config = {254 allowHTML: true,255 maxWidth: 500,256 delay: 100,257 arrow: false,258 appendTo: function(el) {259 return el.parentElement;260 },261 interactive: true,262 interactiveBorder: 10,263 theme: 'quarto',264 placement: 'bottom-start',265 };266 if (contentFn) {267 config.content = contentFn;268 }269 if (onTriggerFn) {270 config.onTrigger = onTriggerFn;271 }272 if (onUntriggerFn) {273 config.onUntrigger = onUntriggerFn;274 }275 window.tippy(el, config); 276 }277 const noterefs = window.document.querySelectorAll('a[role="doc-noteref"]');278 for (var i=0; i<noterefs.length; i++) {279 const ref = noterefs[i];280 tippyHover(ref, function() {281 // use id or data attribute instead here282 let href = ref.getAttribute('data-footnote-href') || ref.getAttribute('href');283 try { href = new URL(href).hash; } catch {}284 const id = href.replace(/^#\/?/, "");285 const note = window.document.getElementById(id);286 if (note) {287 return note.innerHTML;288 } else {289 return "";290 }291 });292 }293 const xrefs = window.document.querySelectorAll('a.quarto-xref');294 const processXRef = (id, note) => {295 // Strip column container classes296 const stripColumnClz = (el) => {297 el.classList.remove("page-full", "page-columns");298 if (el.children) {299 for (const child of el.children) {300 stripColumnClz(child);301 }302 }303 }304 stripColumnClz(note)305 if (id === null || id.startsWith('sec-')) {306 // Special case sections, only their first couple elements307 const container = document.createElement("div");308 if (note.children && note.children.length > 2) {309 container.appendChild(note.children[0].cloneNode(true));310 for (let i = 1; i < note.children.length; i++) {311 const child = note.children[i];312 if (child.tagName === "P" && child.innerText === "") {313 continue;314 } else {315 container.appendChild(child.cloneNode(true));316 break;317 }318 }319 if (window.Quarto?.typesetMath) {320 window.Quarto.typesetMath(container);321 }322 return container.innerHTML323 } else {324 if (window.Quarto?.typesetMath) {325 window.Quarto.typesetMath(note);326 }327 return note.innerHTML;328 }329 } else {330 // Remove any anchor links if they are present331 const anchorLink = note.querySelector('a.anchorjs-link');332 if (anchorLink) {333 anchorLink.remove();334 }335 if (window.Quarto?.typesetMath) {336 window.Quarto.typesetMath(note);337 }338 // TODO in 1.5, we should make sure this works without a callout special case339 if (note.classList.contains("callout")) {340 return note.outerHTML;341 } else {342 return note.innerHTML;343 }344 }345 }346 for (var i=0; i<xrefs.length; i++) {347 const xref = xrefs[i];348 tippyHover(xref, undefined, function(instance) {349 instance.disable();350 let url = xref.getAttribute('href');351 let hash = undefined; 352 if (url.startsWith('#')) {353 hash = url;354 } else {355 try { hash = new URL(url).hash; } catch {}356 }357 if (hash) {358 const id = hash.replace(/^#\/?/, "");359 const note = window.document.getElementById(id);360 if (note !== null) {361 try {362 const html = processXRef(id, note.cloneNode(true));363 instance.setContent(html);364 } finally {365 instance.enable();366 instance.show();367 }368 } else {369 // See if we can fetch this370 fetch(url.split('#')[0])371 .then(res => res.text())372 .then(html => {373 const parser = new DOMParser();374 const htmlDoc = parser.parseFromString(html, "text/html");375 const note = htmlDoc.getElementById(id);376 if (note !== null) {377 const html = processXRef(id, note);378 instance.setContent(html);379 } 380 }).finally(() => {381 instance.enable();382 instance.show();383 });384 }385 } else {386 // See if we can fetch a full url (with no hash to target)387 // This is a special case and we should probably do some content thinning / targeting388 fetch(url)389 .then(res => res.text())390 .then(html => {391 const parser = new DOMParser();392 const htmlDoc = parser.parseFromString(html, "text/html");393 const note = htmlDoc.querySelector('main.content');394 if (note !== null) {395 // This should only happen for chapter cross references396 // (since there is no id in the URL)397 // remove the first header398 if (note.children.length > 0 && note.children[0].tagName === "HEADER") {399 note.children[0].remove();400 }401 const html = processXRef(null, note);402 instance.setContent(html);403 } 404 }).finally(() => {405 instance.enable();406 instance.show();407 });408 }409 }, function(instance) {410 });411 }412 let selectedAnnoteEl;413 const selectorForAnnotation = ( cell, annotation) => {414 let cellAttr = 'data-code-cell="' + cell + '"';415 let lineAttr = 'data-code-annotation="' + annotation + '"';416 const selector = 'span[' + cellAttr + '][' + lineAttr + ']';417 return selector;418 }419 const selectCodeLines = (annoteEl) => {420 const doc = window.document;421 const targetCell = annoteEl.getAttribute("data-target-cell");422 const targetAnnotation = annoteEl.getAttribute("data-target-annotation");423 const annoteSpan = window.document.querySelector(selectorForAnnotation(targetCell, targetAnnotation));424 const lines = annoteSpan.getAttribute("data-code-lines").split(",");425 const lineIds = lines.map((line) => {426 return targetCell + "-" + line;427 })428 let top = null;429 let height = null;430 let parent = null;431 if (lineIds.length > 0) {432 //compute the position of the single el (top and bottom and make a div)433 const el = window.document.getElementById(lineIds[0]);434 top = el.offsetTop;435 height = el.offsetHeight;436 parent = el.parentElement.parentElement;437 if (lineIds.length > 1) {438 const lastEl = window.document.getElementById(lineIds[lineIds.length - 1]);439 const bottom = lastEl.offsetTop + lastEl.offsetHeight;440 height = bottom - top;441 }442 if (top !== null && height !== null && parent !== null) {443 // cook up a div (if necessary) and position it 444 let div = window.document.getElementById("code-annotation-line-highlight");445 if (div === null) {446 div = window.document.createElement("div");447 div.setAttribute("id", "code-annotation-line-highlight");448 div.style.position = 'absolute';449 parent.appendChild(div);450 }451 div.style.top = top - 2 + "px";452 div.style.height = height + 4 + "px";453 div.style.left = 0;454 let gutterDiv = window.document.getElementById("code-annotation-line-highlight-gutter");455 if (gutterDiv === null) {456 gutterDiv = window.document.createElement("div");457 gutterDiv.setAttribute("id", "code-annotation-line-highlight-gutter");458 gutterDiv.style.position = 'absolute';459 const codeCell = window.document.getElementById(targetCell);460 const gutter = codeCell.querySelector('.code-annotation-gutter');461 gutter.appendChild(gutterDiv);462 }463 gutterDiv.style.top = top - 2 + "px";464 gutterDiv.style.height = height + 4 + "px";465 }466 selectedAnnoteEl = annoteEl;467 }468 };469 const unselectCodeLines = () => {470 const elementsIds = ["code-annotation-line-highlight", "code-annotation-line-highlight-gutter"];471 elementsIds.forEach((elId) => {472 const div = window.document.getElementById(elId);473 if (div) {474 div.remove();475 }476 });477 selectedAnnoteEl = undefined;478 };479 // Handle positioning of the toggle480 window.addEventListener(481 "resize",482 throttle(() => {483 elRect = undefined;484 if (selectedAnnoteEl) {485 selectCodeLines(selectedAnnoteEl);486 }487 }, 10)488 );489 function throttle(fn, ms) {490 let throttle = false;491 let timer;492 return (...args) => {493 if(!throttle) { // first call gets through494 fn.apply(this, args);495 throttle = true;496 } else { // all the others get throttled497 if(timer) clearTimeout(timer); // cancel #2498 timer = setTimeout(() => {499 fn.apply(this, args);500 timer = throttle = false;501 }, ms);502 }503 };504 }505 // Attach click handler to the DT506 const annoteDls = window.document.querySelectorAll('dt[data-target-cell]');507 for (const annoteDlNode of annoteDls) {508 annoteDlNode.addEventListener('click', (event) => {509 const clickedEl = event.target;510 if (clickedEl !== selectedAnnoteEl) {511 unselectCodeLines();512 const activeEl = window.document.querySelector('dt[data-target-cell].code-annotation-active');513 if (activeEl) {514 activeEl.classList.remove('code-annotation-active');515 }516 selectCodeLines(clickedEl);517 clickedEl.classList.add('code-annotation-active');518 } else {519 // Unselect the line520 unselectCodeLines();521 clickedEl.classList.remove('code-annotation-active');522 }523 });524 }525 const findCites = (el) => {526 const parentEl = el.parentElement;527 if (parentEl) {528 const cites = parentEl.dataset.cites;529 if (cites) {530 return {531 el,532 cites: cites.split(' ')533 };534 } else {535 return findCites(el.parentElement)536 }537 } else {538 return undefined;539 }540 };541 var bibliorefs = window.document.querySelectorAll('a[role="doc-biblioref"]');542 for (var i=0; i<bibliorefs.length; i++) {543 const ref = bibliorefs[i];544 const citeInfo = findCites(ref);545 if (citeInfo) {546 tippyHover(citeInfo.el, function() {547 var popup = window.document.createElement('div');548 citeInfo.cites.forEach(function(cite) {549 var citeDiv = window.document.createElement('div');550 citeDiv.classList.add('hanging-indent');551 citeDiv.classList.add('csl-entry');552 var biblioDiv = window.document.getElementById('ref-' + cite);553 if (biblioDiv) {554 citeDiv.innerHTML = biblioDiv.innerHTML;555 }556 popup.appendChild(citeDiv);557 });558 return popup.innerHTML;559 });560 }561 }562});563</script>564</div> <!-- /content -->565 566 567 568 569</body></html>