Skip to content

Commit ff787b2

Browse files
authored
Merge pull request #27 from gamosoft/features/various-fixes
- dependencies pinned to concrete version numbers to avoid issues - when dragging a note with a blank/space in the name, link is now created correctly escaping the text - deleting the only note in a folder will not attempt to delete the parent folder anymore
2 parents a691972 + 3b40d80 commit ff787b2

File tree

4 files changed

+79
-30
lines changed

4 files changed

+79
-30
lines changed

backend/utils.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,11 +225,7 @@ def delete_note(notes_dir: str, note_path: str) -> bool:
225225

226226
full_path.unlink()
227227

228-
# Remove empty parent directories
229-
try:
230-
full_path.parent.rmdir()
231-
except OSError:
232-
pass # Directory not empty, that's fine
228+
# Note: We don't automatically delete empty folders to preserve user's folder structure
233229

234230
return True
235231

docs/index.html

Lines changed: 58 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
<!-- Primary Meta Tags -->
88
<title>NoteDiscovery - Your Self-Hosted Knowledge Base</title>
99
<meta name="title" content="NoteDiscovery - Your Self-Hosted Knowledge Base">
10-
<meta name="description" content="A lightweight, privacy-focused note-taking application. Self-hosted, free, and open source. Write, organize, and discover your notes with markdown support.">
11-
<meta name="keywords" content="note taking, markdown editor, self-hosted, knowledge base, open source, privacy, notes app, docker, second brain, obsidian alternative">
10+
<meta name="description" content="A lightweight, privacy-focused Markdown note-taking application with LaTeX math, Mermaid diagrams, and code highlighting. Self-hosted, free, and open source.">
11+
<meta name="keywords" content="note taking, markdown editor, self-hosted, knowledge base, open source, privacy, notes app, docker, second brain, obsidian alternative, notion, evernote, onenote, latex, mermaid, diagrams, math equations">
1212
<meta name="author" content="Gamosoft">
1313
<meta name="robots" content="index, follow">
1414
<link rel="canonical" href="https://www.notediscovery.com">
@@ -17,7 +17,7 @@
1717
<meta property="og:type" content="website">
1818
<meta property="og:url" content="https://www.notediscovery.com">
1919
<meta property="og:title" content="NoteDiscovery - Your Self-Hosted Knowledge Base">
20-
<meta property="og:description" content="A lightweight, privacy-focused note-taking application. Self-hosted, free, and open source.">
20+
<meta property="og:description" content="A lightweight, privacy-focused Markdown note-taking application with LaTeX math, Mermaid diagrams, and code highlighting. Self-hosted, free, and open source.">
2121
<meta property="og:image" content="https://www.notediscovery.com/og-image.png">
2222
<meta property="og:image:width" content="1200">
2323
<meta property="og:image:height" content="630">
@@ -28,7 +28,7 @@
2828
<meta name="twitter:site" content="@gamosoft">
2929
<meta name="twitter:creator" content="@gamosoft">
3030
<meta name="twitter:title" content="NoteDiscovery - Your Self-Hosted Knowledge Base">
31-
<meta name="twitter:description" content="A lightweight, privacy-focused note-taking application. Self-hosted, free, and open source.">
31+
<meta name="twitter:description" content="A lightweight, privacy-focused note-taking application with LaTeX math, Mermaid diagrams, and code highlighting. Self-hosted, free, and open source.">
3232
<meta name="twitter:image" content="https://www.notediscovery.com/og-image.png">
3333
<meta name="twitter:image:alt" content="NoteDiscovery - Self-hosted note-taking application interface">
3434

@@ -509,7 +509,7 @@ <h1>NoteDiscovery</h1>
509509
<div class="hero">
510510
<div class="hero-content">
511511
<h2>Take Control of Your Notes</h2>
512-
<p>A lightweight, privacy-focused note-taking application that puts you in complete control of your knowledge base. Write, organize, and discover your notes with a beautiful, modern interface—all running on your own server.</p>
512+
<p>A lightweight, privacy-focused note-taking application with powerful features: LaTeX math equations, Mermaid diagrams, code highlighting, and more. Write, organize, and discover your notes with a beautiful, modern interface—all running on your own server.</p>
513513
<a href="https://github.com/gamosoft/NoteDiscovery" class="cta-button">Get Started on GitHub →</a>
514514
</div>
515515
</div>
@@ -550,6 +550,24 @@ <h3>Lightning Fast</h3>
550550
<p>Instant search and navigation. Works offline, always responsive.</p>
551551
</div>
552552

553+
<div class="feature">
554+
<div class="feature-icon">🧮</div>
555+
<h3>LaTeX Math</h3>
556+
<p>Beautiful equation rendering with MathJax. Perfect for scientific notes.</p>
557+
</div>
558+
559+
<div class="feature">
560+
<div class="feature-icon">📊</div>
561+
<h3>Diagrams</h3>
562+
<p>Create flowcharts, mind maps, and diagrams with Mermaid syntax.</p>
563+
</div>
564+
565+
<div class="feature">
566+
<div class="feature-icon">💻</div>
567+
<h3>Code Highlighting</h3>
568+
<p>Syntax highlighting for popular coding languages. Developer-friendly notes.</p>
569+
</div>
570+
553571
<div class="feature">
554572
<div class="feature-icon">📂</div>
555573
<h3>Simple Storage</h3>
@@ -559,7 +577,7 @@ <h3>Simple Storage</h3>
559577
<div class="feature">
560578
<div class="feature-icon">🎨</div>
561579
<h3>Beautiful Themes</h3>
562-
<p>Multiple built-in themes with full customization support.</p>
580+
<p>8 built-in themes with dark/light modes and full customization.</p>
563581
</div>
564582

565583
<div class="feature">
@@ -619,6 +637,38 @@ <h2>Why Choose NoteDiscovery?</h2>
619637
You own your data
620638
</div>
621639
</div>
640+
641+
<div class="benefit-item">
642+
<span class="emoji">🔗</span>
643+
<div class="text">
644+
<strong>Wiki Links</strong>
645+
Connect notes with internal links
646+
</div>
647+
</div>
648+
649+
<div class="benefit-item">
650+
<span class="emoji">📄</span>
651+
<div class="text">
652+
<strong>HTML Export</strong>
653+
Share standalone HTML files
654+
</div>
655+
</div>
656+
657+
<div class="benefit-item">
658+
<span class="emoji">⌨️</span>
659+
<div class="text">
660+
<strong>Keyboard Shortcuts</strong>
661+
Navigate and create with speed
662+
</div>
663+
</div>
664+
665+
<div class="benefit-item">
666+
<span class="emoji">🔐</span>
667+
<div class="text">
668+
<strong>Optional Auth</strong>
669+
Password protection when needed
670+
</div>
671+
</div>
622672
</div>
623673
</div>
624674

@@ -671,10 +721,11 @@ <h2>Ready to Get Started?</h2>
671721
"@context": "https://schema.org",
672722
"@type": "SoftwareApplication",
673723
"name": "NoteDiscovery",
674-
"description": "A lightweight, privacy-focused note-taking application. Self-hosted, free, and open source.",
724+
"description": "A lightweight, Obsidian and Evernote alternative, privacy-focused Markdown note-taking application with LaTeX math, Mermaid diagrams, and code highlighting. Self-hosted, free, and open source.",
675725
"url": "https://www.notediscovery.com",
676726
"applicationCategory": "ProductivityApplication",
677727
"operatingSystem": "Linux, Windows, macOS",
728+
"featureList": "Markdown editor, LaTeX math equations, Mermaid diagrams, Code syntax highlighting, Dark mode, Plugin system, Internal wiki links, HTML export, Full-text search, Self-hosted, Obsidian, Evernote, Notion, Onenote, Second brain",
678729
"offers": {
679730
"@type": "Offer",
680731
"price": "0",

frontend/app.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -734,8 +734,9 @@ function noteApp() {
734734
const notePath = this.draggedNoteForLink;
735735
const noteName = notePath.split('/').pop().replace('.md', '');
736736

737-
// Create markdown link
738-
const link = `[${noteName}](${notePath})`;
737+
// Create markdown link (URL-encode the path to handle spaces and special characters)
738+
const encodedPath = notePath.split('/').map(segment => encodeURIComponent(segment)).join('/');
739+
const link = `[${noteName}](${encodedPath})`;
739740

740741
// Insert at cursor position
741742
const textarea = event.target;
@@ -775,7 +776,8 @@ function noteApp() {
775776
event.preventDefault();
776777

777778
// Remove any anchor from the href (e.g., "note.md#section" -> "note.md")
778-
const notePath = href.split('#')[0];
779+
// Also decode URL encoding (e.g., "note%203.md" -> "note 3.md")
780+
const notePath = decodeURIComponent(href.split('#')[0]);
779781

780782
// Skip if it's just an anchor link
781783
if (!notePath) return;
@@ -2424,11 +2426,11 @@ function noteApp() {
24242426
<meta name="viewport" content="width=device-width, initial-scale=1.0">
24252427
<title>${noteName}</title>
24262428
2427-
<!-- Highlight.js for code syntax highlighting -->
2429+
<!-- Highlight.js for code syntax highlighting (v11.9.0) -->
24282430
${highlightTheme ? `<link rel="stylesheet" href="${highlightTheme}">` : '<!-- No highlight.js theme detected -->'}
24292431
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
24302432
2431-
<!-- MathJax for LaTeX math rendering (same config as preview) -->
2433+
<!-- MathJax for LaTeX math rendering (v3.2.2) -->
24322434
<script>
24332435
MathJax = {
24342436
tex: {
@@ -2452,11 +2454,11 @@ function noteApp() {
24522454
}
24532455
};
24542456
</script>
2455-
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
2457+
<script src="https://cdn.jsdelivr.net/npm/mathjax@3.2.2/es5/tex-mml-chtml.js"></script>
24562458
2457-
<!-- Mermaid.js for diagrams (if used in note) -->
2459+
<!-- Mermaid.js for diagrams (v10.9.0) -->
24582460
<script type="module">
2459-
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs';
2461+
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10.9.0/dist/mermaid.esm.min.mjs';
24602462
const isDark = ${this.getThemeType() === 'dark'};
24612463
mermaid.initialize({
24622464
startOnLoad: false,

frontend/index.html

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
<link rel="icon" type="image/png" sizes="16x16" href="/static/favicon.svg">
1212
<link rel="apple-touch-icon" href="/static/logo.svg">
1313

14-
<!-- Tailwind CSS from CDN -->
15-
<script src="https://cdn.tailwindcss.com"></script>
14+
<!-- Tailwind CSS from CDN (v3.4.17) -->
15+
<script src="https://cdn.tailwindcss.com/3.4.17"></script>
1616

17-
<!-- Alpine.js -->
18-
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
17+
<!-- Alpine.js (v3.14.1) -->
18+
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.14.1/dist/cdn.min.js"></script>
1919

20-
<!-- Marked.js for Markdown parsing -->
21-
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
20+
<!-- Marked.js for Markdown parsing (v12.0.2) -->
21+
<script src="https://cdn.jsdelivr.net/npm/marked@12.0.2/marked.min.js"></script>
2222

2323
<!-- MathJax for LaTeX math rendering -->
2424
<script>
@@ -39,9 +39,9 @@
3939
}
4040
};
4141
</script>
42-
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
42+
<script src="https://cdn.jsdelivr.net/npm/mathjax@3.2.2/es5/tex-mml-chtml.js"></script>
4343

44-
<!-- Highlight.js for code syntax highlighting -->
44+
<!-- Highlight.js for code syntax highlighting (v11.9.0) -->
4545
<link rel="stylesheet" id="highlight-theme" href="">
4646
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
4747
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/csharp.min.js"></script>
@@ -57,9 +57,9 @@
5757
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/css.min.js"></script>
5858
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/http.min.js"></script>
5959

60-
<!-- Mermaid.js for diagram rendering -->
60+
<!-- Mermaid.js for diagram rendering (v10.9.0) -->
6161
<script type="module">
62-
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs';
62+
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10.9.0/dist/mermaid.esm.min.mjs';
6363
// Note: Mermaid is initialized dynamically by app.js renderMermaid() based on current theme
6464
window.mermaid = mermaid;
6565
</script>

0 commit comments

Comments
 (0)