-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
110 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>OpenRVDAS Documentation</title> | ||
<link rel="stylesheet" href="styles.css"> | ||
</head> | ||
<body> | ||
<div class="sidebar"> | ||
<h2>Table of Contents</h2> | ||
<ul id="toc"> | ||
<!-- TOC entries will be populated here --> | ||
</ul> | ||
</div> | ||
<div class="content"> | ||
<!-- Chapters will be displayed here --> | ||
<div id="chapter-content"></div> | ||
</div> | ||
<script src="script.js"></script> | ||
</body> | ||
</html> |
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,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 = "<p>Error loading chapter.</p>"; | ||
console.error(error); | ||
}); | ||
} | ||
|
||
// Load the first chapter by default | ||
if (chapters.length > 0) { | ||
loadChapter(chapters[0].file); | ||
} | ||
}); |
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,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; | ||
} |