// Populate the sidebar // // This is a script, and not included directly in the page, to control the total size of the book. // The TOC contains an entry for each page, so if each page includes a copy of the TOC, // the total size of the page becomes O(n**2). class MDBookSidebarScrollbox extends HTMLElement { constructor() { super(); } connectedCallback() { this.innerHTML = '
  1. Introduction
  2. Project Definition
  3. What is KOGRAL?
  4. Core Concepts
  5. Why KOGRAL?
  6. Design Philosophy
  7. Guides
  8. Installation
  9. Quick Start
  10. Daily Workflows
  11. Use Cases
  12. Best Practices
  13. Architecture
  14. System Overview
  15. Graph Model
  16. Config-Driven Design
  17. Storage Architecture
  18. Logseq Blocks Design
  19. ADR-001: Nickel vs TOML for Configuration
  20. ADR-002: FastEmbed via AI Providers
  21. ADR-003: Hybrid Storage Strategy
  22. ADR-004: Logseq Blocks Support
  23. ADR-005: MCP Protocol for AI Integration
  24. Setup
  25. Prerequisites
  26. Installation Methods
  27. Project Initialization
  28. Environment Configuration
  29. Verification
  30. Configuration
  31. Configuration Overview
  32. Nickel Schemas
  33. Graph Settings
  34. Inheritance
  35. Examples
  36. Storage
  37. Storage Backends
  38. Filesystem Storage
  39. SurrealDB Storage
  40. In-Memory Storage
  41. Sync Strategies
  42. AI & Embeddings
  43. Embeddings Overview
  44. Provider Configuration
  45. FastEmbed Local
  46. OpenAI Integration
  47. Claude Integration
  48. Ollama Integration
  49. Semantic Search
  50. Templates
  51. Template System
  52. Document Templates
  53. Export Templates
  54. Customization
  55. CLI
  56. CLI Overview
  57. Commands Reference
  58. Workflows
  59. NuShell Scripts
  60. Apps & Connections
  61. MCP Quick Guide
  62. Claude Code Integration
  63. Logseq Integration
  64. Obsidian Compatibility
  65. Git Workflows
  66. API Reference
  67. MCP Protocol
  68. Tools Reference
  69. Resources
  70. Rust API
  71. Contributing
  72. Development Setup
  73. Code Standards
  74. Testing
'; // Set the current, active page, and reveal it if it's hidden let current_page = document.location.href.toString().split("#")[0].split("?")[0]; if (current_page.endsWith("/")) { current_page += "index.html"; } var links = Array.prototype.slice.call(this.querySelectorAll("a")); var l = links.length; for (var i = 0; i < l; ++i) { var link = links[i]; var href = link.getAttribute("href"); if (href && !href.startsWith("#") && !/^(?:[a-z+]+:)?\/\//.test(href)) { link.href = path_to_root + href; } // The "index" page is supposed to alias the first chapter in the book. if (link.href === current_page || (i === 0 && path_to_root === "" && current_page.endsWith("/index.html"))) { link.classList.add("active"); var parent = link.parentElement; if (parent && parent.classList.contains("chapter-item")) { parent.classList.add("expanded"); } while (parent) { if (parent.tagName === "LI" && parent.previousElementSibling) { if (parent.previousElementSibling.classList.contains("chapter-item")) { parent.previousElementSibling.classList.add("expanded"); } } parent = parent.parentElement; } } } // Track and set sidebar scroll position this.addEventListener('click', function(e) { if (e.target.tagName === 'A') { sessionStorage.setItem('sidebar-scroll', this.scrollTop); } }, { passive: true }); var sidebarScrollTop = sessionStorage.getItem('sidebar-scroll'); sessionStorage.removeItem('sidebar-scroll'); if (sidebarScrollTop) { // preserve sidebar scroll position when navigating via links within sidebar this.scrollTop = sidebarScrollTop; } else { // scroll sidebar to current active section when navigating via "next/previous chapter" buttons var activeSection = document.querySelector('#sidebar .active'); if (activeSection) { activeSection.scrollIntoView({ block: 'center' }); } } // Toggle buttons var sidebarAnchorToggles = document.querySelectorAll('#sidebar a.toggle'); function toggleSection(ev) { ev.currentTarget.parentElement.classList.toggle('expanded'); } Array.from(sidebarAnchorToggles).forEach(function (el) { el.addEventListener('click', toggleSection); }); } } window.customElements.define("mdbook-sidebar-scrollbox", MDBookSidebarScrollbox);