<style>
.sidebar-elems ul.block.crate,
.sidebar-elems h3:has(+ ul.block.crate) {
display: none;
}
.sidebar h3.flm-nav-h {
font-size: 0.8125rem;
text-transform: uppercase;
letter-spacing: 0.09em;
margin: 1.1rem 0 0.35rem;
padding-top: 0.7rem;
border-top: 1px solid var(--sidebar-border-color);
}
.sidebar .flm-guide-nav h3.flm-nav-h {
border-top: none;
padding-top: 0;
margin-top: 0.5rem;
}
.sidebar .flm-api-nav h3,
.sidebar .flm-guide-nav h3:not(.flm-nav-h) {
font-size: 1rem;
}
.sidebar .flm-guide-nav li.current a,
.sidebar ul.flm-crates li.current a {
background-color: var(--sidebar-current-link-background-color);
}
</style>
<script>
document.addEventListener("DOMContentLoaded", () => {
"use strict";
const GUIDE_PAGES = [
["", "Overview"],
["introduction/", "Introduction"],
["language_syntax/", "FLM language syntax"],
["std_flm/", "std flm"],
["command_line/", "The flm command-line tool"],
["concepts_overview/", "Concepts overview"],
["document_model/", "The document model"],
["pipeline/", "Stages, capabilities, and plans"],
["rendering/", "Rendering: backends and outputs"],
["numbering/", "Numbering: counters and counter styles"],
["extending/", "Extending FLM: features and packages"],
["embedding/", "Embedding flm-core"],
["panics/", "List of panicking items"],
["python_flm_migration/", "Migrating from Python FLM"],
["ai_guide/", "AI guide"],
["ai_guide_document_model/", "AI guide: document model"],
["ai_guide_pipeline/", "AI guide: pipeline"],
["ai_guide_extending/", "AI guide: extending FLM"],
["ai_guide_embedding/", "AI guide: embedding"],
];
const CRATES = [["flm_core", "flm-core"], ["flm_host", "flm-host"]];
const vars = document.querySelector("meta[name='rustdoc-vars']");
const elems = document.querySelector("nav.sidebar .sidebar-elems");
if (!vars || !elems) {
return;
}
const rootPath = vars.getAttribute("data-root-path") || "./";
const currentCrate = vars.getAttribute("data-current-crate");
const docsRsVersion = window.location.hostname === "docs.rs"
? window.location.pathname.split("/")[2]
: null;
const href = (name, path) => {
if (docsRsVersion && name !== currentCrate) {
const entry = CRATES.find(([crate]) => crate === name);
const pkg = entry ? entry[1] : name;
return "https://docs.rs/" + pkg + "/" + docsRsVersion + "/" +
name + "/" + path;
}
return new URL(rootPath + name + "/" + path, window.location.href).href;
};
const sectionHeader = text => {
const h = document.createElement("h3");
h.className = "flm-nav-h";
h.textContent = text;
return h;
};
const linkItem = (url, text) => {
const a = document.createElement("a");
a.href = url;
a.textContent = text;
const item = document.createElement("li");
item.appendChild(a);
return item;
};
for (const crateList of elems.querySelectorAll("ul.block.crate")) {
const heading = crateList.previousElementSibling;
if (heading && heading.tagName === "H3") {
heading.remove();
}
crateList.remove();
}
const api = document.createElement("section");
api.className = "flm-api-nav";
while (elems.firstChild) {
api.appendChild(elems.firstChild);
}
const guide = document.createElement("section");
guide.className = "flm-guide-nav";
guide.appendChild(sectionHeader("Guide"));
const chapters = document.createElement("ul");
chapters.className = "block";
let onGuidePage = false;
for (const [sub, title] of GUIDE_PAGES) {
const url = href("flm_core", "guide/" + sub + "index.html");
const item = linkItem(url, title);
if (new URL(url).pathname === window.location.pathname) {
item.className = "current";
onGuidePage = true;
}
chapters.appendChild(item);
}
guide.appendChild(chapters);
const crates = document.createElement("ul");
crates.className = "block flm-crates";
for (const [name] of CRATES) {
const item = linkItem(href(name, "index.html"), name);
if (name === currentCrate) {
item.className = "current";
}
crates.appendChild(item);
}
if (onGuidePage) {
const toc = api.querySelector("#rustdoc-toc");
if (toc) {
for (const child of Array.from(toc.children)) {
const keep = child.classList.contains("top-toc") ||
(child.nextElementSibling !== null &&
child.nextElementSibling.classList.contains("top-toc"));
if (!keep) {
child.remove();
}
}
guide.appendChild(toc);
}
api.textContent = "";
}
elems.appendChild(guide);
elems.appendChild(sectionHeader("API"));
elems.appendChild(crates);
elems.appendChild(api);
});
</script>