-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #187 from sorru94/update-api-doc
Update api documentation
- Loading branch information
Showing
26 changed files
with
1,200 additions
and
1,242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* | ||
* (C) Copyright 2024, SECO Mind Srl | ||
* | ||
* SPDX-License-Identifier: MIT | ||
*/ | ||
|
||
html { | ||
/* side nav width. MUST be = `TREEVIEW_WIDTH`. | ||
* Make sure it is wide enough to contain the page title (logo + title + version) | ||
*/ | ||
--side-nav-fixed-width: 400px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* (C) Copyright 2024, SECO Mind Srl | ||
* | ||
* SPDX-License-Identifier: MIT | ||
*/ | ||
|
||
class DoxygenAwesomeFragmentCopyButton extends HTMLElement { | ||
constructor() { | ||
super(); | ||
this.onclick=this.copyContent | ||
} | ||
static title = "Copy to clipboard" | ||
static copyIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"/></svg>` | ||
static successIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/></svg>` | ||
static successDuration = 980 | ||
static init() { | ||
$(function() { | ||
$(document).ready(function() { | ||
if(navigator.clipboard) { | ||
const fragments = document.getElementsByClassName("fragment") | ||
for(const fragment of fragments) { | ||
const fragmentWrapper = document.createElement("div") | ||
fragmentWrapper.className = "doxygen-awesome-fragment-wrapper" | ||
const fragmentCopyButton = document.createElement("doxygen-awesome-fragment-copy-button") | ||
fragmentCopyButton.innerHTML = DoxygenAwesomeFragmentCopyButton.copyIcon | ||
fragmentCopyButton.title = DoxygenAwesomeFragmentCopyButton.title | ||
|
||
fragment.parentNode.replaceChild(fragmentWrapper, fragment) | ||
fragmentWrapper.appendChild(fragment) | ||
fragmentWrapper.appendChild(fragmentCopyButton) | ||
|
||
} | ||
} | ||
}) | ||
}) | ||
} | ||
|
||
|
||
copyContent() { | ||
const content = this.previousSibling.cloneNode(true) | ||
// filter out line number from file listings | ||
content.querySelectorAll(".lineno, .ttc").forEach((node) => { | ||
node.remove() | ||
}) | ||
let textContent = content.textContent | ||
// remove trailing newlines that appear in file listings | ||
let numberOfTrailingNewlines = 0 | ||
while(textContent.charAt(textContent.length - (numberOfTrailingNewlines + 1)) == '\n') { | ||
numberOfTrailingNewlines++; | ||
} | ||
textContent = textContent.substring(0, textContent.length - numberOfTrailingNewlines) | ||
navigator.clipboard.writeText(textContent); | ||
this.classList.add("success") | ||
this.innerHTML = DoxygenAwesomeFragmentCopyButton.successIcon | ||
window.setTimeout(() => { | ||
this.classList.remove("success") | ||
this.innerHTML = DoxygenAwesomeFragmentCopyButton.copyIcon | ||
}, DoxygenAwesomeFragmentCopyButton.successDuration); | ||
} | ||
} | ||
|
||
customElements.define("doxygen-awesome-fragment-copy-button", DoxygenAwesomeFragmentCopyButton) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* (C) Copyright 2024, SECO Mind Srl | ||
* | ||
* SPDX-License-Identifier: MIT | ||
*/ | ||
|
||
class DoxygenAwesomeInteractiveToc { | ||
static topOffset = 38 | ||
static hideMobileMenu = true | ||
static headers = [] | ||
|
||
static init() { | ||
window.addEventListener("load", () => { | ||
let toc = document.querySelector(".contents > .toc") | ||
if(toc) { | ||
toc.classList.add("interactive") | ||
if(!DoxygenAwesomeInteractiveToc.hideMobileMenu) { | ||
toc.classList.add("open") | ||
} | ||
document.querySelector(".contents > .toc > h3")?.addEventListener("click", () => { | ||
if(toc.classList.contains("open")) { | ||
toc.classList.remove("open") | ||
} else { | ||
toc.classList.add("open") | ||
} | ||
}) | ||
|
||
document.querySelectorAll(".contents > .toc > ul a").forEach((node) => { | ||
let id = node.getAttribute("href").substring(1) | ||
DoxygenAwesomeInteractiveToc.headers.push({ | ||
node: node, | ||
headerNode: document.getElementById(id) | ||
}) | ||
|
||
document.getElementById("doc-content")?.addEventListener("scroll", () => { | ||
DoxygenAwesomeInteractiveToc.update() | ||
}) | ||
}) | ||
DoxygenAwesomeInteractiveToc.update() | ||
} | ||
}) | ||
} | ||
|
||
static update() { | ||
let active = DoxygenAwesomeInteractiveToc.headers[0]?.node | ||
DoxygenAwesomeInteractiveToc.headers.forEach((header) => { | ||
let position = header.headerNode.getBoundingClientRect().top | ||
header.node.classList.remove("active") | ||
header.node.classList.remove("aboveActive") | ||
if(position < DoxygenAwesomeInteractiveToc.topOffset) { | ||
active = header.node | ||
active?.classList.add("aboveActive") | ||
} | ||
}) | ||
active?.classList.add("active") | ||
active?.classList.remove("aboveActive") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* (C) Copyright 2024, SECO Mind Srl | ||
* | ||
* SPDX-License-Identifier: MIT | ||
*/ | ||
|
||
class DoxygenAwesomeParagraphLink { | ||
// Icon from https://fonts.google.com/icons | ||
// Licensed under the Apache 2.0 license: | ||
// https://www.apache.org/licenses/LICENSE-2.0.html | ||
static icon = `<svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M17 7h-4v2h4c1.65 0 3 1.35 3 3s-1.35 3-3 3h-4v2h4c2.76 0 5-2.24 5-5s-2.24-5-5-5zm-6 8H7c-1.65 0-3-1.35-3-3s1.35-3 3-3h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-2zm-3-4h8v2H8z"/></svg>` | ||
static title = "Permanent Link" | ||
static init() { | ||
$(function() { | ||
$(document).ready(function() { | ||
document.querySelectorAll(".contents a.anchor[id], .contents .groupheader > a[id]").forEach((node) => { | ||
let anchorlink = document.createElement("a") | ||
anchorlink.setAttribute("href", `#${node.getAttribute("id")}`) | ||
anchorlink.setAttribute("title", DoxygenAwesomeParagraphLink.title) | ||
anchorlink.classList.add("anchorlink") | ||
node.classList.add("anchor") | ||
anchorlink.innerHTML = DoxygenAwesomeParagraphLink.icon | ||
node.parentElement.appendChild(anchorlink) | ||
}) | ||
}) | ||
}) | ||
} | ||
} |
Oops, something went wrong.