blob: 36016f3493a57f39f033201b99b2ab69c0e2023a (
plain) (
tree)
|
|
#!/bin/bash
OUT=references.html
cat <<EOF > $OUT
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>references</title>
<style>
html {
font-family: Source Code Pro, monospace, sans-serif;
font-size: clamp(12px, 2vw, 16px);
}
button {
font-family: inherit;
font-size: inherit;
}
</style>
<script>
/// Map HTML elements to display kinds.
const elementToDisplay = (E) => {
switch (E.nodeName) {
case "LI":
return "list-item";
default:
return "block";
}
}
/// Display only elements which have all TAGS.
const showTag = (TAGS) => {
Array.from(document.getElementsByClassName("content")).forEach(E => {
// Display the element, iff the element contains every tag T in TAGS.
if (TAGS.every(T => Array.from(E.classList).includes(T))) {
E.style.display = elementToDisplay(E);
} else {
E.style.display = "none";
}
});
};
/// Initialize buttons and callbacks.
window.onload = () => {
// Handle to the filter placeholder.
const filter_node = document.getElementById("filter");
// Active filter tags.
const filter = Array();
// Create buttons for each tag T.
["arm", "x86", "riscv", "sysv", "clear"].forEach(T => {
const btn = document.createElement("button");
btn.innerHTML = T;
btn.onclick = T === "clear"
? (E) => {
// Clear active filter.
while (filter.length) { filter.pop(); }
showTag(["content"]);
filter_node.innerHTML = "filter:";
}
: (E) => {
// Toggle tag T in Active filter.
if ((idx = filter.indexOf(T)) > -1) {
filter.splice(idx, 1);
} else {
filter.push(T);
}
showTag(filter);
out = filter.map(T => \`<mark>\${T}</mark>\`).join(" + ");
filter_node.innerHTML = \`filter: \${out}\`;
};
filter_node.insertAdjacentElement("beforebegin", btn);
});
}
</script>
</head>
<body>
<p>Self-hosted collection of frequently referenced documents and specifications. This page provides links to the original sources.</p>
<p id = "filter">filter:</p>
<ul>
EOF
emit() {
cat <<-EOF >> $OUT
<li class="content $1">
<a style="color:black;" href="/pub/$2">$2</a>
[<a href="$3">original</a>]
</li>
EOF
}
emit "sysv" abi/sysv/sysv-gabi4-2013 https://www.sco.com/developers/gabi/latest/contents.html
emit "sysv" abi/sysv/sysv-gabi41.pdf https://www.sco.com/developers/devspecs/gabi41.pdf
emit "sysv x86" abi/sysv-psabi-x86-64.pdf https://gitlab.com/x86-psABIs/x86-64-ABI/-/jobs/artifacts/master/raw/x86-64-ABI/abi.pdf?job=build
emit "sysv arm" abi/sysv/sysv-psabi-arm64.pdf https://github.com/ARM-software/abi-aa/releases/download/2023Q3/aaelf64.pdf
emit "sysv arm" abi/arm/aapcs64.pdf https://github.com/ARM-software/abi-aa/releases/download/2023Q3/aapcs64.pdf
emit "syss riscv" abi/sysv/sysv-psabi-riscv.pdf https://github.com/riscv-non-isa/riscv-elf-psabi-doc/releases/latest
emit "x86" arch/intel/intel64-optimization-ref-vol1.pdf https://cdrdv2.intel.com/v1/dl/getContent/671488
emit "x86" arch/intel/intel64-optimization-ref-vol2.pdf https://cdrdv2.intel.com/v1/dl/getContent/787036
emit "x86" arch/intel/intel64-vol1-architecture-manual.pdf https://cdrdv2.intel.com/v1/dl/getContent/671436
emit "x86" arch/intel/intel64-vol2-instruction-ref.pdf https://cdrdv2.intel.com/v1/dl/getContent/671110
emit "x86" arch/intel/intel64-vol3-system-programming.pdf https://cdrdv2.intel.com/v1/dl/getContent/671447
emit "riscv" arch/riscv/rv-1-unprivileged-isa.pdf https://github.com/riscv/riscv-isa-manual/releases/tag/Ratified-IMAFDQC
emit "riscv" arch/riscv/rv-2-privileged-architecture.pdf https://github.com/riscv/riscv-isa-manual/releases/tag/Priv-v1.12
cat <<EOF >> $OUT
</ul>
</body>
</html>
EOF
|