A local-first markdown note-taking application built with SvelteKit and Tailwind CSS. Create, edit, and organize your markdown documents with a clean, intuitive interface featuring a file explorer, tabbed editing, and real-time preview.
- File Explorer Sidebar: Navigate through your markdown files and folders
- Recent Files: Quick access to recently opened files at the top of the sidebar
- Pinned Files: Pin frequently used files for easy access
- Context Menu Operations: Right-click to create, rename, or delete files and folders
- Drag-to-Resize Sidebar: Adjust the sidebar width to your preference (200px - 500px)
- Persistent Folder State: Expanded folders remain open when toggling the sidebar
- Tabbed Interface: Open multiple documents simultaneously
- Split View: Toggle between editor and preview modes
- Customizable Formatting Toolbar: Quick access to markdown formatting with customizable button selection
- Syntax Highlighting: Markdown syntax highlighting in the editor
- Line Wrapping: No horizontal scrolling - text wraps naturally
- Unsaved Changes Indicator: Visual indicator (●) shows unsaved changes in tabs
- Export Functionality: Export documents to HTML or PDF formats with preserved formatting
- Editor Line Wrapping: Toggle line wrapping in the markdown editor
- Dark Mode Support: Toggle between light and dark themes
- System Theme Detection: Automatically follow your system's theme preference
- Customizable Settings: Adjust editor font size, font family, and behavior options
Ctrl+B
(Windows/Linux) orCmd+B
(Mac): Toggle sidebarCtrl+S
(Windows/Linux) orCmd+S
(Mac): Save current fileCtrl+Shift+E
(Windows/Linux) orCmd+Shift+E
(Mac): Toggle editor/preview modeCtrl+P
(Windows/Linux) orCmd+P
(Mac): Export to HTML/PDF
- Root Directory: Choose your notes folder location
- Editor Preferences: Customize font size and font family
- Interface Options: Configure toolbar visibility, customize toolbar buttons, file tree spacing, and recent files count
- Editor Settings: Enable or disable line wrapping in the markdown editor
- Auto-save: Optional automatic saving with configurable delay
- Behavior Options: Configure confirmation dialogs and other preferences
- Node.js 18 or higher
- npm or yarn package manager
-
Clone the repository
git clone https://github.com/faulander/markdown-notes.git cd markdown-notes
-
Install dependencies
npm install
-
Start the development server
npm run dev
-
Open your browser Navigate to
http://localhost:5173
npm run build
npm run preview
For easy deployment with Docker:
-
Quick setup with Docker
./docker-setup.sh
-
Manual Docker setup
docker-compose up -d
-
Access the application Navigate to
http://localhost:3000
Your notes will be stored in the ./notes
directory, and settings are persisted in a Docker volume. See DOCKER.md for detailed Docker documentation.
-
Set Your Notes Directory
- Click the gear icon (⚙️) in the sidebar to open Settings
- Click "Browse" next to "Root Directory"
- Select your preferred folder for storing markdown files
- Click "Save"
-
Create Your First Note
- Right-click in the file explorer (or on a folder)
- Select "Add Document"
- Enter a filename (
.md
extension is added automatically) - Start writing!
- New File: Right-click in the sidebar → "Add Document"
- New Folder: Right-click in the sidebar → "Add Folder"
- Files are automatically saved with
.md
extension
- Open File: Click on any
.md
file in the sidebar - Recent Files: Access recently opened files from the top of the sidebar
- Pin Files: Hover over files in the tree and click the pin icon for quick access
- Delete: Right-click on file/folder → "Delete"
- Navigate: Click folder arrows to expand/collapse directories
- Quick Access: Recently opened files appear at the top of the sidebar
- Configurable Count: Set how many recent files to show (0-10) in Settings
- Auto-Navigation: Clicking a recent file automatically expands the tree to show its location
- Order Preservation: Recent files maintain their chronological order when accessed
- The editor provides syntax highlighting for markdown
- Customizable Formatting Toolbar: Quick access to markdown formatting functions
- Text automatically wraps - no horizontal scrolling
- Unsaved changes are indicated with an orange dot (●) in the tab
The formatting toolbar can be fully customized through Settings:
Available Toolbar Buttons:
- Headings: H1, H2, H3 buttons for different heading levels
- Text Formatting: Bold, italic, strikethrough, inline code
- Code Blocks: Insert code blocks with syntax highlighting
- Lists: Bullet lists and numbered lists
- Links: Insert markdown links
- Quotes: Blockquote formatting
- Tables: Insert formatted tables (advanced)
- Horizontal Rule: Insert divider lines (advanced)
How to Customize:
- Open Settings (⚙️ icon in sidebar)
- Navigate to "Interface" section
- Ensure "Show editor toolbar" is enabled
- Select/deselect specific toolbar buttons you want to display
- Click "Save" to apply changes
Default Configuration:
- Most commonly used buttons are enabled by default (headings, bold, italic, code, links, lists, quotes)
- Advanced features like tables and horizontal rules are disabled by default but can be enabled as needed
- Toggle between edit and preview modes with
Ctrl+Shift+E
- Preview renders your markdown in real-time with GitHub-like styling
- Supports all standard markdown features including tables, strikethrough, and task lists
- Syntax Highlighting: Code blocks support syntax highlighting for 190+ programming languages
- Supported Languages: JavaScript, Python, TypeScript, Java, C#, C++, C, PHP, Ruby, Go, Rust, Kotlin, Swift, SQL, Bash, JSON, YAML, XML, HTML, CSS, and many more
- Multiple Files: Open multiple documents in tabs
- Switch Tabs: Click on tab headers to switch between files
- Close Tabs: Click the × button on each tab
- Unsaved Indicators: Orange dot shows unsaved changes
Export your markdown documents to HTML or PDF formats:
- Quick Export: Press
Ctrl+P
(Windows/Linux) orCmd+P
(Mac) to open the export dialog - Format Selection: Choose between HTML (.html) or PDF (.pdf) formats
- Preserved Formatting: All markdown formatting, syntax highlighting, and styling are preserved
- Automatic Download: Files are automatically downloaded to your default download location
Export Features:
- HTML Export: Creates a standalone HTML file with embedded CSS and syntax highlighting
- PDF Export: Generates a high-quality PDF with proper formatting and print optimization
- GitHub-like Styling: Exported documents maintain the same clean, readable styling as the preview
- Syntax Highlighting: Code blocks retain their syntax highlighting in exported documents
Control how long lines are displayed in the markdown editor:
- Quick Toggle: Click the "Wrap: ON/OFF" button in the footer to instantly toggle line wrapping
- Settings Control: Access the line wrapping setting in the Settings modal under Interface options
- Real-time Editor Updates: Changes are applied immediately to the editor
- Persistent Setting: Your line wrapping preference is saved and remembered across sessions
How it works:
- Wrap: ON - Long lines wrap to the next line within the editor window (default, no horizontal scrolling)
- Wrap: OFF - Long lines extend horizontally, requiring horizontal scrolling to see the full line
- Light Mode: Default clean interface
- Dark Mode: Easy on the eyes for low-light environments
- System Theme: Automatically matches your OS theme preference
- Font Size: Adjust from 8px to 24px
- Font Family: Choose your preferred monospace font
- Toolbar Visibility: Show/hide the formatting toolbar
- Toolbar Customization: Select which formatting buttons to display (headings, bold, italic, code, links, lists, quotes, strikethrough, tables, horizontal rules)
- Recent Files Count: Configure how many recent files to display (0-10)
- File Tree Spacing: Choose between compact, normal, or comfortable spacing
- Auto-save: Enable automatic saving with customizable delay
- Framework: SvelteKit with Svelte 5
- Styling: Tailwind CSS
- Editor: CodeMirror 6
- Markdown: marked.js for rendering with GitHub Flavored Markdown support
- Syntax Highlighting: highlight.js with support for 190+ programming languages
- File Watching: chokidar for real-time updates
- Build Tool: Vite
src/
├── routes/
│ ├── +page.svelte # Main application component
│ └── api/ # Server-side API routes
│ ├── files/ # File CRUD operations
│ ├── browse-folder/ # Directory browsing
│ └── cwd/ # Current working directory
├── lib/
│ ├── components/ # Reusable Svelte components
│ │ ├── FileTree.svelte # File explorer tree
│ │ ├── MarkdownEditor.svelte # CodeMirror editor
│ │ ├── SettingsModal.svelte # Settings interface
│ │ └── FolderPicker.svelte # Directory picker
│ ├── stores/ # Svelte stores
│ │ └── settings.js # Settings management
│ ├── theme.js # Theme management
│ └── fileWatcher.js # File system monitoring
├── app.css # Global styles
└── app.html # HTML template
-
Fork the repository
git clone https://github.com/faulander/mdnotes.git cd mdnotes
-
Install dependencies
npm install
-
Set up development environment
# Install recommended VS Code extensions # - Svelte for VS Code # - Tailwind CSS IntelliSense # - Prettier - Code formatter
-
Start development server
npm run dev
-
Run tests (if available)
npm test
npm run dev
- Start development servernpm run build
- Build for productionnpm run preview
- Preview production buildnpm run lint
- Run ESLintnpm run format
- Format code with Prettier
The application uses several API endpoints for file operations:
GET /api/files
- List files and directoriesPOST /api/files
- Create, update, or delete filesGET /api/browse-folder
- Browse directories for folder pickerGET /api/cwd
- Get current working directory
- Renders the file explorer sidebar
- Handles file/folder operations
- Manages expanded/collapsed state
- Supports context menus
- CodeMirror 6 integration
- Syntax highlighting
- Line wrapping
- Dark mode support
- User preferences interface
- Theme selection
- Directory picker integration
- Settings persistence
The application uses Svelte 5's runes for state management:
$state()
- Reactive state variables$effect()
- Side effects and reactive updates$props()
- Component properties
Settings are persisted to localStorage and managed through a custom store.
We welcome contributions! Please follow these guidelines:
- Check existing issues to see if your feature/bug is already being worked on
- Create an issue to discuss major changes before implementing
- Fork the repository and create a feature branch
-
Fork and clone
git clone https://github.com/faulander/mdnotes.git cd mdnotes git checkout -b feature/your-feature-name
-
Set up development environment
npm install npm run dev
-
Make your changes
- Follow the existing code style
- Add tests if applicable
- Update documentation if needed
-
Test your changes
npm run lint npm run build
-
Commit your changes
git add . git commit -m "feat: add your feature description"
-
Push and create PR
git push origin feature/your-feature-name
- JavaScript/Svelte: Use ESLint and Prettier configurations
- CSS: Use Tailwind CSS utilities, avoid custom CSS when possible
- Naming: Use descriptive variable and function names
- Comments: Add comments for complex logic
- File Structure: Keep components focused and reusable
Use conventional commits:
feat:
- New featuresfix:
- Bug fixesdocs:
- Documentation changesstyle:
- Code style changesrefactor:
- Code refactoringtest:
- Test additions/changeschore:
- Maintenance tasks
- Update documentation if you've changed functionality
- Add tests for new features
- Ensure all tests pass and code lints successfully
- Update the README if needed
- Create detailed PR description explaining your changes
When reporting bugs, please include:
- Operating system and version
- Node.js version
- Browser and version
- Steps to reproduce
- Expected vs actual behavior
- Screenshots if applicable
For new features:
- Explain the use case
- Describe the proposed solution
- Consider alternative approaches
- Discuss implementation complexity
MIT License - see LICENSE file for details.
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: This README and inline code comments
- Search functionality across all notes
- Tag system for organizing notes
- Export to PDF/HTML
- Plugin system for extensions
- Mobile responsive design
- Collaboration features
- Cloud sync options
- Local file system only (no cloud sync)
- No search functionality
- No collaborative editing
- Desktop-focused UI (not mobile optimized)
See CHANGELOG.md for detailed version history and changes.