mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-17 08:28:09 +08:00
Improve/Fix the documentation page.
Some checks are pending
Build / Bazel, ${{ matrix.cxx }}, ${{ matrix.os }} (cl, cl, windows-latest) (push) Waiting to run
Build / Bazel, ${{ matrix.cxx }}, ${{ matrix.os }} (clang, clang++, macos-latest) (push) Waiting to run
Build / Bazel, ${{ matrix.cxx }}, ${{ matrix.os }} (clang, clang++, ubuntu-latest) (push) Waiting to run
Build / Bazel, ${{ matrix.cxx }}, ${{ matrix.os }} (gcc, g++, macos-latest) (push) Waiting to run
Build / Bazel, ${{ matrix.cxx }}, ${{ matrix.os }} (gcc, g++, ubuntu-latest) (push) Waiting to run
Build / CMake, ${{ matrix.compiler }}, ${{ matrix.os }} (cl, Windows MSVC, windows-latest) (push) Waiting to run
Build / CMake, ${{ matrix.compiler }}, ${{ matrix.os }} (gcc, Linux GCC, ubuntu-latest) (push) Waiting to run
Build / CMake, ${{ matrix.compiler }}, ${{ matrix.os }} (llvm, llvm-cov gcov, Linux Clang, ubuntu-latest) (push) Waiting to run
Build / CMake, ${{ matrix.compiler }}, ${{ matrix.os }} (llvm, llvm-cov gcov, MacOS clang, macos-latest) (push) Waiting to run
Documentation / documentation (push) Waiting to run
Some checks are pending
Build / Bazel, ${{ matrix.cxx }}, ${{ matrix.os }} (cl, cl, windows-latest) (push) Waiting to run
Build / Bazel, ${{ matrix.cxx }}, ${{ matrix.os }} (clang, clang++, macos-latest) (push) Waiting to run
Build / Bazel, ${{ matrix.cxx }}, ${{ matrix.os }} (clang, clang++, ubuntu-latest) (push) Waiting to run
Build / Bazel, ${{ matrix.cxx }}, ${{ matrix.os }} (gcc, g++, macos-latest) (push) Waiting to run
Build / Bazel, ${{ matrix.cxx }}, ${{ matrix.os }} (gcc, g++, ubuntu-latest) (push) Waiting to run
Build / CMake, ${{ matrix.compiler }}, ${{ matrix.os }} (cl, Windows MSVC, windows-latest) (push) Waiting to run
Build / CMake, ${{ matrix.compiler }}, ${{ matrix.os }} (gcc, Linux GCC, ubuntu-latest) (push) Waiting to run
Build / CMake, ${{ matrix.compiler }}, ${{ matrix.os }} (llvm, llvm-cov gcov, Linux Clang, ubuntu-latest) (push) Waiting to run
Build / CMake, ${{ matrix.compiler }}, ${{ matrix.os }} (llvm, llvm-cov gcov, MacOS clang, macos-latest) (push) Waiting to run
Documentation / documentation (push) Waiting to run
This commit is contained in:
@@ -20,32 +20,78 @@
|
||||
<script type="text/javascript" src="$relpath^doxygen-awesome-paragraph-link.js"></script>
|
||||
<script type="text/javascript" src="$relpath^doxygen-awesome-interactive-toc.js"></script>
|
||||
<script type="text/javascript" src="$relpath^doxygen-awesome-tabs.js"></script>
|
||||
<script type="text/javascript">
|
||||
<script type="module">
|
||||
DoxygenAwesomeFragmentCopyButton.init()
|
||||
DoxygenAwesomeParagraphLink.init()
|
||||
DoxygenAwesomeInteractiveToc.init()
|
||||
DoxygenAwesomeTabs.init()
|
||||
|
||||
window.addEventListener('DOMContentLoaded', function () {
|
||||
document.querySelectorAll(".headertitle").forEach(div => {
|
||||
await new Promise(r => window.addEventListener('DOMContentLoaded', r));
|
||||
|
||||
// Hide progressively the title.
|
||||
if (div.textContent != "Getting Started" &&
|
||||
div.textContent != "Installation" &&
|
||||
div.textContent != "Modules" &&
|
||||
true) {
|
||||
return;
|
||||
}
|
||||
div.style.display = "none";
|
||||
// Remove title when a img[alt='title-img'] is present.
|
||||
// Find an image with the alt "img-title".
|
||||
const img = document.querySelector("img[alt='title-img']");
|
||||
const header = document.querySelector(".headertitle");
|
||||
|
||||
// Show progressively the image.
|
||||
const img = document.querySelector("img.inline");
|
||||
img.style.maxHeight = "40vh";
|
||||
img.style.maxWidth = "100%";
|
||||
img.style.objectFit = "contain";
|
||||
});
|
||||
if (img && header) {
|
||||
// Hide the header title progressively.
|
||||
header.style.display = "none";
|
||||
|
||||
// Show progressively the image.
|
||||
img.style.maxHeight = "40vh";
|
||||
img.style.maxWidth = "100%";
|
||||
img.style.objectFit = "contain";
|
||||
}
|
||||
|
||||
// In the "examples.html" page. Turn every link with text
|
||||
// "examples/<...>
|
||||
//
|
||||
// Add a "demo" link toward.
|
||||
// https://arthursonzogni.github.io/FTXUI/examples/?file=<...>
|
||||
const examples = document.querySelectorAll("a")
|
||||
examples.forEach((example) => {
|
||||
if (!example.textContent.startsWith("examples/")) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Remove the ".cpp" extension from the example name.
|
||||
const exampleName = example.textContent.replace("examples/", "").replace(".cpp", "");
|
||||
|
||||
const a = document.createElement("a");
|
||||
a.textContent = "[demo]";
|
||||
a.href = "https://arthursonzogni.github.io/FTXUI/examples/?file=" + exampleName;
|
||||
a.style.marginRight= "1em";
|
||||
a.style.fontWeight = "bold";
|
||||
|
||||
example.parentElement.insertBefore(a, example)
|
||||
});
|
||||
|
||||
// If the current URL ends with -example.html, we can add a link to the demo
|
||||
// as well using the div.title textContent.
|
||||
const url = new URL(window.location.href);
|
||||
if (url.pathname.endsWith("-example.html")) {
|
||||
// Get the title text.
|
||||
const title = document.querySelector("div.title").textContent;
|
||||
const example = title.replace("examples/", "").replace(".cpp", "");
|
||||
|
||||
// Create a link to the demo.
|
||||
const a = document.createElement("a");
|
||||
a.textContent = "[demo]";
|
||||
a.href = "https://arthursonzogni.github.io/FTXUI/examples/?file=" + example;
|
||||
a.style.marginLeft = "1em";
|
||||
a.style.fontWeight = "bold";
|
||||
a.style.display = "inline-block";
|
||||
|
||||
// Insert the link after the title.
|
||||
const titleDiv = document.querySelector("div.title");
|
||||
if (titleDiv) {
|
||||
titleDiv.insertBefore(a, titleDiv.nextSibling);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
$treeview
|
||||
$search
|
||||
$mathjax
|
||||
|
Reference in New Issue
Block a user