diff --git a/cmd/server/main.go b/cmd/server/main.go index 347b3e2..94715fb 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -607,6 +607,7 @@ func main() { e.GET("/docs", docsHandler.DocsHome) e.GET("/docs/*", docsHandler.ShowDocumentation) e.GET("/docs/api/search", docsHandler.Search) + e.GET("/docs/search-index.json", docsHandler.ServeSearchIndex) // Start server log.Printf("Starting server on port %s", cfg.ServerPort) diff --git a/internal/docs/handler.go b/internal/docs/handler.go index cd6b95f..daf09ed 100644 --- a/internal/docs/handler.go +++ b/internal/docs/handler.go @@ -359,3 +359,59 @@ func (h *DocsHandler) GetAPIEndpointData(endpointPath string) (*templates.Endpoi return nil, fmt.Errorf("endpoint not found: %s", endpointPath) } + +// SearchDoc represents a document for search indexing +type SearchDoc struct { + ID string `json:"id"` + Title string `json:"title"` + Content string `json:"content"` + URL string `json:"url"` +} + +// GenerateSearchIndex generates a search index for all documentation +func (h *DocsHandler) GenerateSearchIndex() ([]SearchDoc, error) { + docs, err := h.ListDocuments() + if err != nil { + return nil, fmt.Errorf("failed to list documents: %w", err) + } + + var searchDocs []SearchDoc + for _, path := range docs { + doc, err := h.LoadDocument(path) + if err != nil { + continue + } + + // Strip HTML tags for better search + content := h.stripHTML(doc.Content) + + searchDocs = append(searchDocs, SearchDoc{ + ID: path, + Title: doc.Title, + Content: content, + URL: "/docs/" + strings.TrimSuffix(path, ".md"), + }) + } + + return searchDocs, nil +} + +// stripHTML removes HTML tags from string +func (h *DocsHandler) stripHTML(html string) string { + var result strings.Builder + inTag := false + for _, r := range html { + if r == '<' { + inTag = true + continue + } + if r == '>' { + inTag = false + continue + } + if !inTag { + result.WriteRune(r) + } + } + return result.String() +} diff --git a/internal/docs/http_handler.go b/internal/docs/http_handler.go index 34050a8..a7a1967 100644 --- a/internal/docs/http_handler.go +++ b/internal/docs/http_handler.go @@ -332,3 +332,14 @@ func (h *HTTPHandler) TryEndpoint(c echo.Context) error { "message": "API explorer not yet implemented", }) } + +// ServeSearchIndex serves the Lunr.js search index +func (h *HTTPHandler) ServeSearchIndex(c echo.Context) error { + index, err := h.docs.GenerateSearchIndex() + if err != nil { + return c.JSON(http.StatusInternalServerError, map[string]string{ + "error": "failed to generate search index", + }) + } + return c.JSON(http.StatusOK, index) +} diff --git a/templates/docs.templ b/templates/docs.templ index 7631780..07c54cc 100644 --- a/templates/docs.templ +++ b/templates/docs.templ @@ -14,6 +14,8 @@ templ DocsLayout(nav Navigation, doc Document, user User) { { doc.Title } - Bookhoard Documentation + + @@ -270,21 +320,110 @@ templ DocsLayout(nav Navigation, doc Document, user User) { // Initialize syntax highlighting hljs.highlightAll(); }); - - // Search functionality - async function searchDocs(query) { - if (query.length < 2) return; - - try { - const response = await fetch('/docs/api/search?q=' + encodeURIComponent(query)); - const data = await response.json(); - - // Display search results (you can enhance this) - console.log('Search results:', data.results); - } catch (error) { - console.error('Search failed:', error); + + // Search state + let idx; + let searchResults = []; + + // Load index on page load + fetch('/docs/search-index.json') + .then(r => r.json()) + .then(data => { + // Initialize Lunr with fuzzy matching + idx = lunr(function() { + this.use(lunr.flex) + this.ref('id') + this.field('title', {boost: 10}) + this.field('content', {boost: 1}) + data.forEach(doc => this.add(doc)) + }) + console.log('Search index loaded:', data.length, 'documents') + }) + .catch(err => console.error('Failed to load search index:', err)); + + // Search input with debounce + const searchInput = document.getElementById('docs-search'); + const searchResultsDiv = document.getElementById('search-results'); + + let debounceTimer; + + searchInput.addEventListener('input', (e) => { + clearTimeout(debounceTimer); + debounceTimer = setTimeout(() => { + const query = e.target.value.trim(); + + if (query.length < 2) { + searchResultsDiv.style.display = 'none'; + return; + } + + // Search with fuzzy matching + const results = idx.search(query, { + fields: {title: {boost: 10}, content: 1}, + expand: true + }); + + // Store results for highlighting + searchResults = results; + + // Render results + renderSearchResults(results, query); + }, 150); + }); + + // Render search results + function renderSearchResults(results, query) { + if (results.length === 0) { + searchResultsDiv.innerHTML = '
No results found
'; + searchResultsDiv.style.display = 'block'; + return; } + + searchResultsDiv.innerHTML = results.map(r => { + const doc = getDocById(r.ref); + if (!doc) return ''; + + const snippet = getSnippet(doc.content, query); + + return ` + +
${doc.title}
+
${snippet}...
+
+ `; + }).join(''); + + searchResultsDiv.style.display = 'block'; } + + function getDocById(id) { + // This would be populated from the index + // For now, return a placeholder + return {title: id, url: '/docs/' + id.replace('.md', ''), content: ''}; + } + + function getSnippet(content, query) { + // Simple snippet extraction + const words = query.toLowerCase().split(/\s+/); + const contentLower = content.toLowerCase(); + + for (const word of words) { + const idx = contentLower.indexOf(word); + if (idx !== -1) { + const start = Math.max(0, idx - 50); + const end = Math.min(content.length, idx + 100); + return '...' + content.substring(start, end) + '...'; + } + } + return content.substring(0, 150) + '...'; + } + + // Close search results when clicking outside + document.addEventListener('click', (e) => { + if (!searchResultsDiv.contains(e.target) && e.target !== searchInput) { + searchResultsDiv.style.display = 'none'; + } + }); @@ -299,6 +438,8 @@ templ DocsLayoutWithExplorer(nav Navigation, doc Document, user User, explorer A { doc.Title } - Bookhoard Documentation + + @@ -554,25 +743,114 @@ templ DocsLayoutWithExplorer(nav Navigation, doc Document, user User, explorer A item.classList.add('active'); } }); - + // Initialize syntax highlighting hljs.highlightAll(); }); - - // Search functionality - async function searchDocs(query) { - if (query.length < 2) return; - - try { - const response = await fetch('/docs/api/search?q=' + encodeURIComponent(query)); - const data = await response.json(); - - // Display search results (you can enhance this) - console.log('Search results:', data.results); - } catch (error) { - console.error('Search failed:', error); + + // Search state + let idx; + let searchResults = []; + + // Load index on page load + fetch('/docs/search-index.json') + .then(r => r.json()) + .then(data => { + // Initialize Lunr with fuzzy matching + idx = lunr(function() { + this.use(lunr.flex) + this.ref('id') + this.field('title', {boost: 10}) + this.field('content', {boost: 1}) + data.forEach(doc => this.add(doc)) + }) + console.log('Search index loaded:', data.length, 'documents') + }) + .catch(err => console.error('Failed to load search index:', err)); + + // Search input with debounce + const searchInput = document.getElementById('docs-search'); + const searchResultsDiv = document.getElementById('search-results'); + + let debounceTimer; + + searchInput.addEventListener('input', (e) => { + clearTimeout(debounceTimer); + debounceTimer = setTimeout(() => { + const query = e.target.value.trim(); + + if (query.length < 2) { + searchResultsDiv.style.display = 'none'; + return; + } + + // Search with fuzzy matching + const results = idx.search(query, { + fields: {title: {boost: 10}, content: 1}, + expand: true + }); + + // Store results for highlighting + searchResults = results; + + // Render results + renderSearchResults(results, query); + }, 150); + }); + + // Render search results + function renderSearchResults(results, query) { + if (results.length === 0) { + searchResultsDiv.innerHTML = '
No results found
'; + searchResultsDiv.style.display = 'block'; + return; } + + searchResultsDiv.innerHTML = results.map(r => { + const doc = getDocById(r.ref); + if (!doc) return ''; + + const snippet = getSnippet(doc.content, query); + + return ` + +
${doc.title}
+
${snippet}...
+
+ `; + }).join(''); + + searchResultsDiv.style.display = 'block'; } + + function getDocById(id) { + // This would be populated from the index + // For now, return a placeholder + return {title: id, url: '/docs/' + id.replace('.md', ''), content: ''}; + } + + function getSnippet(content, query) { + // Simple snippet extraction + const words = query.toLowerCase().split(/\s+/); + const contentLower = content.toLowerCase(); + + for (const word of words) { + const idx = contentLower.indexOf(word); + if (idx !== -1) { + const start = Math.max(0, idx - 50); + const end = Math.min(content.length, idx + 100); + return '...' + content.substring(start, end) + '...'; + } + } + return content.substring(0, 150) + '...'; + } + + // Close search results when clicking outside + document.addEventListener('click', (e) => { + if (!searchResultsDiv.contains(e.target) && e.target !== searchInput) { + searchResultsDiv.style.display = 'none'; + } + }); diff --git a/templates/docs_templ.go b/templates/docs_templ.go index d146b4d..c869b46 100644 --- a/templates/docs_templ.go +++ b/templates/docs_templ.go @@ -46,7 +46,7 @@ func DocsLayout(nav Navigation, doc Document, user User) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, " - Bookhoard Documentation
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, " - Bookhoard Documentation
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -58,7 +58,7 @@ func DocsLayout(nav Navigation, doc Document, user User) templ.Component { var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(section.Title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 187, Col: 22} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 237, Col: 22} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { @@ -81,7 +81,7 @@ func DocsLayout(nav Navigation, doc Document, user User) templ.Component { var templ_7745c5c3_Var4 templ.SafeURL templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinURLErrs(item.URL) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 192, Col: 27} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 242, Col: 27} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) if templ_7745c5c3_Err != nil { @@ -94,7 +94,7 @@ func DocsLayout(nav Navigation, doc Document, user User) templ.Component { var templ_7745c5c3_Var5 string templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(item.Icon) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 193, Col: 21} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 243, Col: 21} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) if templ_7745c5c3_Err != nil { @@ -107,7 +107,7 @@ func DocsLayout(nav Navigation, doc Document, user User) templ.Component { var templ_7745c5c3_Var6 string templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(item.Title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 193, Col: 36} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 243, Col: 36} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) if templ_7745c5c3_Err != nil { @@ -135,7 +135,7 @@ func DocsLayout(nav Navigation, doc Document, user User) templ.Component { var templ_7745c5c3_Var7 templ.SafeURL templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinURLErrs(item.URL) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 200, Col: 27} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 250, Col: 27} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) if templ_7745c5c3_Err != nil { @@ -148,7 +148,7 @@ func DocsLayout(nav Navigation, doc Document, user User) templ.Component { var templ_7745c5c3_Var8 string templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(item.Icon) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 201, Col: 21} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 251, Col: 21} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) if templ_7745c5c3_Err != nil { @@ -161,7 +161,7 @@ func DocsLayout(nav Navigation, doc Document, user User) templ.Component { var templ_7745c5c3_Var9 string templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(item.Title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 201, Col: 36} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 251, Col: 36} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) if templ_7745c5c3_Err != nil { @@ -205,7 +205,7 @@ func DocsLayout(nav Navigation, doc Document, user User) templ.Component { var templ_7745c5c3_Var10 templ.SafeURL templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinURLErrs(crumb.URL) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 219, Col: 26} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 269, Col: 26} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10)) if templ_7745c5c3_Err != nil { @@ -218,7 +218,7 @@ func DocsLayout(nav Navigation, doc Document, user User) templ.Component { var templ_7745c5c3_Var11 string templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(crumb.Title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 219, Col: 42} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 269, Col: 42} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) if templ_7745c5c3_Err != nil { @@ -241,7 +241,7 @@ func DocsLayout(nav Navigation, doc Document, user User) templ.Component { var templ_7745c5c3_Var12 string templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(doc.Title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 225, Col: 48} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 275, Col: 48} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12)) if templ_7745c5c3_Err != nil { @@ -264,7 +264,7 @@ func DocsLayout(nav Navigation, doc Document, user User) templ.Component { var templ_7745c5c3_Var13 templ.SafeURL templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinURLErrs("#" + item.Anchor) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 232, Col: 34} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 282, Col: 34} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13)) if templ_7745c5c3_Err != nil { @@ -277,7 +277,7 @@ func DocsLayout(nav Navigation, doc Document, user User) templ.Component { var templ_7745c5c3_Var14 string templ_7745c5c3_Var14, templ_7745c5c3_Err = templruntime.SanitizeStyleAttributeValues("margin-left: " + fmt.Sprintf("%drem", item.Level)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 232, Col: 112} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 282, Col: 112} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14)) if templ_7745c5c3_Err != nil { @@ -290,7 +290,7 @@ func DocsLayout(nav Navigation, doc Document, user User) templ.Component { var templ_7745c5c3_Var15 string templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(item.Title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 233, Col: 20} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 283, Col: 20} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15)) if templ_7745c5c3_Err != nil { @@ -314,7 +314,7 @@ func DocsLayout(nav Navigation, doc Document, user User) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -350,13 +350,13 @@ func DocsLayoutWithExplorer(nav Navigation, doc Document, user User, explorer AP var templ_7745c5c3_Var17 string templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(doc.Title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 299, Col: 21} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 438, Col: 21} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, " - Bookhoard Documentation
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, " - Bookhoard Documentation
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -368,7 +368,7 @@ func DocsLayoutWithExplorer(nav Navigation, doc Document, user User, explorer AP var templ_7745c5c3_Var18 string templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(section.Title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 472, Col: 22} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 661, Col: 22} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18)) if templ_7745c5c3_Err != nil { @@ -391,7 +391,7 @@ func DocsLayoutWithExplorer(nav Navigation, doc Document, user User, explorer AP var templ_7745c5c3_Var19 templ.SafeURL templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinURLErrs(item.URL) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 477, Col: 27} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 666, Col: 27} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19)) if templ_7745c5c3_Err != nil { @@ -404,7 +404,7 @@ func DocsLayoutWithExplorer(nav Navigation, doc Document, user User, explorer AP var templ_7745c5c3_Var20 string templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(item.Icon) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 478, Col: 21} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 667, Col: 21} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20)) if templ_7745c5c3_Err != nil { @@ -417,7 +417,7 @@ func DocsLayoutWithExplorer(nav Navigation, doc Document, user User, explorer AP var templ_7745c5c3_Var21 string templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(item.Title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 478, Col: 36} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 667, Col: 36} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21)) if templ_7745c5c3_Err != nil { @@ -445,7 +445,7 @@ func DocsLayoutWithExplorer(nav Navigation, doc Document, user User, explorer AP var templ_7745c5c3_Var22 templ.SafeURL templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinURLErrs(item.URL) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 485, Col: 27} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 674, Col: 27} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var22)) if templ_7745c5c3_Err != nil { @@ -458,7 +458,7 @@ func DocsLayoutWithExplorer(nav Navigation, doc Document, user User, explorer AP var templ_7745c5c3_Var23 string templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(item.Icon) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 486, Col: 21} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 675, Col: 21} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23)) if templ_7745c5c3_Err != nil { @@ -471,7 +471,7 @@ func DocsLayoutWithExplorer(nav Navigation, doc Document, user User, explorer AP var templ_7745c5c3_Var24 string templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinStringErrs(item.Title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 486, Col: 36} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 675, Col: 36} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var24)) if templ_7745c5c3_Err != nil { @@ -515,7 +515,7 @@ func DocsLayoutWithExplorer(nav Navigation, doc Document, user User, explorer AP var templ_7745c5c3_Var25 templ.SafeURL templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinURLErrs(crumb.URL) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 504, Col: 26} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 693, Col: 26} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25)) if templ_7745c5c3_Err != nil { @@ -528,7 +528,7 @@ func DocsLayoutWithExplorer(nav Navigation, doc Document, user User, explorer AP var templ_7745c5c3_Var26 string templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(crumb.Title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 504, Col: 42} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 693, Col: 42} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26)) if templ_7745c5c3_Err != nil { @@ -551,7 +551,7 @@ func DocsLayoutWithExplorer(nav Navigation, doc Document, user User, explorer AP var templ_7745c5c3_Var27 string templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(doc.Title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 510, Col: 48} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 699, Col: 48} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27)) if templ_7745c5c3_Err != nil { @@ -574,7 +574,7 @@ func DocsLayoutWithExplorer(nav Navigation, doc Document, user User, explorer AP var templ_7745c5c3_Var28 templ.SafeURL templ_7745c5c3_Var28, templ_7745c5c3_Err = templ.JoinURLErrs("#" + item.Anchor) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 517, Col: 34} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 706, Col: 34} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var28)) if templ_7745c5c3_Err != nil { @@ -587,7 +587,7 @@ func DocsLayoutWithExplorer(nav Navigation, doc Document, user User, explorer AP var templ_7745c5c3_Var29 string templ_7745c5c3_Var29, templ_7745c5c3_Err = templruntime.SanitizeStyleAttributeValues("margin-left: " + fmt.Sprintf("%drem", item.Level)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 517, Col: 112} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 706, Col: 112} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var29)) if templ_7745c5c3_Err != nil { @@ -600,7 +600,7 @@ func DocsLayoutWithExplorer(nav Navigation, doc Document, user User, explorer AP var templ_7745c5c3_Var30 string templ_7745c5c3_Var30, templ_7745c5c3_Err = templ.JoinStringErrs(item.Title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 518, Col: 20} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/docs.templ`, Line: 707, Col: 20} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var30)) if templ_7745c5c3_Err != nil { @@ -632,7 +632,7 @@ func DocsLayoutWithExplorer(nav Navigation, doc Document, user User, explorer AP if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 69, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 69, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err }