diff --git a/docs/.obsidian/core-plugins.json b/docs/.obsidian/core-plugins.json index 436f43c..c89a841 100644 --- a/docs/.obsidian/core-plugins.json +++ b/docs/.obsidian/core-plugins.json @@ -26,5 +26,6 @@ "workspaces": false, "file-recovery": true, "publish": false, - "sync": false + "sync": false, + "webviewer": false } \ No newline at end of file diff --git a/docs/.obsidian/workspace.json b/docs/.obsidian/workspace.json index b3dcde9..a7956b2 100644 --- a/docs/.obsidian/workspace.json +++ b/docs/.obsidian/workspace.json @@ -20,8 +20,21 @@ "icon": "lucide-file", "title": "DeepImpact" } + }, + { + "id": "7899dc85e8880db2", + "type": "leaf", + "state": { + "type": "release-notes", + "state": { + "currentVersion": "1.8.4" + }, + "icon": "lucide-book-up", + "title": "Release Notes 1.8.4" + } } - ] + ], + "currentTab": 1 } ], "direction": "vertical" @@ -40,7 +53,8 @@ "state": { "type": "file-explorer", "state": { - "sortOrder": "alphabetical" + "sortOrder": "alphabetical", + "autoReveal": false }, "icon": "lucide-folder-closed", "title": "Files" @@ -162,7 +176,7 @@ "command-palette:Open command palette": false } }, - "active": "1eda716d35acafe8", + "active": "7899dc85e8880db2", "lastOpenFiles": [ "index.md", "DeepImpact.md", diff --git a/docs/Nullframe Discord.pdf b/docs/Nullframe Discord.pdf new file mode 100644 index 0000000..2ff54ba Binary files /dev/null and b/docs/Nullframe Discord.pdf differ diff --git a/docs/index.md b/docs/index.md index f35ad9a..923fea9 100644 --- a/docs/index.md +++ b/docs/index.md @@ -12,3 +12,6 @@ Here you'll find documentation for various tools and projects I've created. Sele If you need help or have questions: - Open an issue on [GitHub](https://github.com/Litruv) - Join the discussion on [Discord](https://discord.gg/b8ctQBaaax) + + +asdfds \ No newline at end of file diff --git a/index.html b/index.html index e4e8115..fb0ad76 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ - Documentation Viewer + Litruv @@ -12,44 +12,10 @@ - + -
@@ -103,17 +69,10 @@
+ - - diff --git a/index.js b/index.js index 6bc11c9..d83c19b 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,5 @@ +let originalDocTitle = document.title; + let markedPromise = new Promise((resolve) => { if (typeof marked !== 'undefined') { resolve(marked); @@ -12,6 +14,18 @@ async function initializeMarked() { const renderer = new marked.Renderer(); const originalLink = renderer.link.bind(renderer); + renderer.code = (code, language) => { + let highlighted; + if (language && hljs.getLanguage(language)) { + highlighted = hljs.highlight(code, { language }).value; + language = language; + } else { + highlighted = hljs.highlightAuto(code).value; + language = ''; + } + return `
${highlighted}
`; + }; + renderer.link = (href, title, text) => { const isExternal = href.startsWith('http') || href.startsWith('https'); const attrs = isExternal ? ' target="_blank" rel="noopener noreferrer"' : ''; @@ -23,12 +37,6 @@ async function initializeMarked() { }; marked.setOptions({ - highlight: function(code, lang) { - if (Prism.languages[lang]) { - return Prism.highlight(code, Prism.languages[lang], lang); - } - return code; - }, breaks: true, gfm: true, renderer: renderer @@ -250,6 +258,9 @@ async function loadDocument(path) { const titleContent = metadata.title || (docEntry && docEntry.title) || path.split('/').pop().replace('.md', ''); + document.title = `${originalDocTitle} / ${titleContent}`; + document.querySelector('.title-text .page-title').textContent = titleContent; + let processedContent = content.replace(/\[\[(.*?)\]\]/g, (match, linkText) => { if (linkText.match(/\.(png|jpg|jpeg|gif|mp4|webm)$/i)) { return match; @@ -277,25 +288,11 @@ async function loadDocument(path) { return `\n![${filename}](${mediaPath})\n\n`; }); - document.title = `Litruv / ${titleContent}`; document.querySelector('.title-text .page-title').textContent = titleContent; - // Update Twitter meta tags dynamically - document.querySelector('meta[name="twitter:title"]').setAttribute('content', titleContent); - document.querySelector('meta[name="twitter:description"]').setAttribute('content', metadata.description || `Documentation for ${titleContent}`); - if (metadata.image) { - const imageUrl = `${window.location.origin}${window.location.pathname}${basePath}/images/${metadata.image}`; - let twitterImageMeta = document.querySelector('meta[name="twitter:image"]'); - if (!twitterImageMeta) { - twitterImageMeta = document.createElement('meta'); - twitterImageMeta.setAttribute('name', 'twitter:image'); - document.head.appendChild(twitterImageMeta); - } - twitterImageMeta.setAttribute('content', imageUrl); - } - documentContent.className = 'markdown-content'; documentContent.innerHTML = marked.parse(finalContent); + hljs.highlightAll(); documentOutline.innerHTML = ''; const headings = documentContent.querySelectorAll('h1, h2, h3, h4, h5, h6'); diff --git a/styles.css b/styles.css index 7b4a949..7112394 100644 --- a/styles.css +++ b/styles.css @@ -421,6 +421,112 @@ social-links a:hover { border-bottom: 1px solid var(--ifm-border-color); } +.markdown-content pre { + background-color: var(--ifm-background-surface-color); + border: 1px solid var(--ifm-border-color); + border-radius: 8px; + padding: 1rem; + margin: 1rem 0; + overflow-x: auto; +} + +.markdown-content pre code { + background: none; + border: none; + padding: 0; + font-size: 0.9rem; + line-height: 1.5; + color: inherit; +} + +/* Override Prism styles to match theme */ +pre[class*="language-"] { + background: var(--ifm-background-surface-color) !important; + margin: 1rem 0 !important; + padding: 1rem !important; + border-radius: 8px !important; +} + +code[class*="language-"] { + background: none !important; + text-shadow: none !important; + font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important; +} + +/* Code block styles */ +.markdown-content pre[class*="language-"] { + background: var(--ifm-background-surface-color) !important; + border: 1px solid var(--ifm-border-color); + margin: 1.5rem 0; + padding: 1rem; + border-radius: 8px; +} + +.markdown-content code[class*="language-"] { + background: none; + padding: 0; + margin: 0; + font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; + font-size: 0.9em; + line-height: 1.5; + text-shadow: none; +} + +/* Discord-like code block styles */ +pre[class*="language-"] { + background-color: #2f3136 !important; + color: #b9bbbe !important; + border: none; + padding: 1rem !important; + border-radius: 5px !important; + overflow-x: auto; + line-height: 1.5; +} + +code[class*="language-"] { + background: none !important; + color: inherit !important; + font-family: 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important; +} + +/* Optionally, if you use Prism's toolbar, adjust its colors similar to Discord */ +div.code-toolbar > .toolbar > .toolbar-item > button { + background: #2f3136; + color: #b9bbbe; + border: none; +} +div.code-toolbar > .toolbar > .toolbar-item > button:hover { + background: #40444b; + color: #dcddde; +} + +/* Toolbar styles */ +div.code-toolbar > .toolbar { + opacity: 0; + top: 0.5em; + right: 0.5em; + transition: opacity 0.3s; +} + +div.code-toolbar:hover > .toolbar { + opacity: 1; +} + +div.code-toolbar > .toolbar > .toolbar-item > button { + background: var(--ifm-background-surface-color); + color: var(--ifm-color-content); + border: 1px solid var(--ifm-border-color); + border-radius: 4px; + padding: 0.4em 0.8em; + font-size: 0.8em; + cursor: pointer; +} + +div.code-toolbar > .toolbar > .toolbar-item > button:hover { + background: var(--ifm-color-primary); + color: white; +} + .error { color: #ff6b6b; padding: 20px;