diff --git a/openrvdas/index.html b/openrvdas/index.html new file mode 100644 index 0000000..7291f29 --- /dev/null +++ b/openrvdas/index.html @@ -0,0 +1,22 @@ + + + + + + OpenRVDAS Documentation + + + + +
+ +
+
+ + + diff --git a/openrvdas/script.js b/openrvdas/script.js new file mode 100644 index 0000000..e095d4d --- /dev/null +++ b/openrvdas/script.js @@ -0,0 +1,43 @@ +document.addEventListener("DOMContentLoaded", function () { + const toc = document.getElementById("toc"); + const chapterContent = document.getElementById("chapter-content"); + + const chapters = [ + { title: "Quickstart", file: "quickstart.md" }, + { title: "GUI Quickstart", file: "quickstart_gui.md" }, + { title: "Introduction to Loggers", file: "intro_to_loggers.md" }, + // Add more chapters as needed + ]; + + // Populate TOC + chapters.forEach((chapter, index) => { + const li = document.createElement("li"); + const a = document.createElement("a"); + a.href = "#"; + a.textContent = chapter.title; + a.addEventListener("click", (e) => { + e.preventDefault(); + loadChapter(chapter.file); + }); + li.appendChild(a); + toc.appendChild(li); + }); + + // Load chapter content + function loadChapter(file) { + fetch(file) + .then((response) => response.text()) + .then((text) => { + chapterContent.innerHTML = marked(text); + }) + .catch((error) => { + chapterContent.innerHTML = "

Error loading chapter.

"; + console.error(error); + }); + } + + // Load the first chapter by default + if (chapters.length > 0) { + loadChapter(chapters[0].file); + } +}); diff --git a/openrvdas/styles.css b/openrvdas/styles.css new file mode 100644 index 0000000..38f67ff --- /dev/null +++ b/openrvdas/styles.css @@ -0,0 +1,45 @@ +body { + display: flex; + margin: 0; + font-family: Arial, sans-serif; +} + +.sidebar { + position: fixed; + top: 0; + left: 0; + width: 200px; + height: 100%; + background-color: #f4f4f4; + padding: 20px; + overflow-y: auto; + border-right: 1px solid #ccc; +} + +.content { + margin-left: 220px; + padding: 20px; + flex-grow: 1; +} + +h2 { + margin-top: 0; +} + +ul { + list-style-type: none; + padding: 0; +} + +li { + margin: 10px 0; +} + +li a { + text-decoration: none; + color: #333; +} + +li a:hover { + text-decoration: underline; +}