Files
gobsidian/README.md

174 lines
5.2 KiB
Markdown
Raw Normal View History

2025-08-25 08:48:52 +01:00
# Gobsidian
A modern, responsive web interface for viewing and editing Obsidian markdown notes, built with Go and TailwindCSS.
## Features
- **Responsive Design**: Works seamlessly on desktop and mobile devices
- **Dark Theme**: Beautiful dark interface optimized for extended use
- **Multiple Image Storage Modes**: Flexible image storage options to match Obsidian's behavior
- **File Management**: Upload, download, edit, and delete files and notes
- **Syntax Highlighting**: Code blocks with syntax highlighting for multiple languages
- **Search Functionality**: Quick search through your notes
- **Settings Management**: Web-based configuration interface
- **Markdown Rendering**: Full markdown support with Obsidian-style features
## Image Storage Modes
1. **Root Directory**: Store images directly in the notes root directory
2. **Specific Folder**: Store all images in a designated folder
3. **Same as Note**: Store images in the same directory as the note
4. **Subfolder of Note**: Store images in a subfolder within the note's directory
## Installation
1. Clone the repository:
```bash
git clone https://github.com/yourusername/gobsidian.git
cd gobsidian
```
2. Install dependencies:
```bash
go mod download
```
3. Run the application:
```bash
go run cmd/main.go
```
4. Open your browser and navigate to `http://localhost:8080`
## Configuration
On first run, Gobsidian will create a `settings.ini` file with default configurations. You can modify these settings through the web interface at `/settings` or by editing the file directly.
### Default Configuration
```ini
[FLASK]
HOST = 0.0.0.0
PORT = 8080
SECRET_KEY = change-this-secret-key
DEBUG = false
MAX_CONTENT_LENGTH = 16
[MD_NOTES_APP]
APP_NAME = Gobsidian
NOTES_DIR = notes
NOTES_DIR_HIDE_SIDEPANE = attached, images
NOTES_DIR_SKIP = secret, private
IMAGES_HIDE = false
IMAGE_STORAGE_MODE = 1
IMAGE_STORAGE_PATH = images
IMAGE_SUBFOLDER_NAME = attached
ALLOWED_IMAGE_EXTENSIONS = jpg, jpeg, png, webp, gif
ALLOWED_FILE_EXTENSIONS = txt, pdf, html, json, yaml, yml, conf, csv, cmd, bat, sh
```
## Usage
### Viewing Notes
- Navigate through your notes using the sidebar tree structure
- Click on any `.md` file to view its rendered content
- Images and links are automatically processed and displayed
### Creating Notes
- Click "New Note" or use Ctrl+N
- Enter a title and content using Markdown syntax
- Save with Ctrl+S or click the Save button
### Editing Notes
- Click the "Edit" button on any note
- Use the built-in editor with toolbar for common Markdown formatting
- Auto-save functionality and keyboard shortcuts available
### File Management
- Upload files by dragging and dropping or using the upload button
- Download any file by clicking the download icon
- Delete files and folders with confirmation dialogs
### Settings
- Access settings via the gear icon in the sidebar
- Configure image storage modes, file extensions, and directories
- Changes take effect immediately or after restart as indicated
## Development
### Project Structure
```
gobsidian/
├── cmd/
│ └── main.go # Application entry point
├── internal/
│ ├── config/ # Configuration management
│ ├── handlers/ # HTTP route handlers
│ ├── markdown/ # Markdown rendering
│ ├── models/ # Data models
│ ├── server/ # HTTP server setup
│ └── utils/ # Utility functions
├── web/
│ ├── static/ # CSS, JS, and static assets
│ └── templates/ # HTML templates
├── notes/ # Default notes directory
├── go.mod # Go module definition
└── settings.ini # Configuration file
```
### Building
To build a standalone binary:
```bash
go build -o gobsidian cmd/main.go
```
### Docker
To run with Docker:
```bash
docker build -t gobsidian .
docker run -p 8080:8080 -v /path/to/your/notes:/app/notes gobsidian
```
## Contributing
1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Add tests if applicable
5. Submit a pull request
## License
This project is licensed under the MIT License - see the LICENSE file for details.
## Acknowledgments
- Inspired by Obsidian's excellent note-taking capabilities
- Built with Go, Gin, TailwindCSS, and highlight.js
- Thanks to the open source community for the excellent libraries used
## Comparison with Python Flask Version
This Go implementation provides the same functionality as the original Python Flask version with the following improvements:
- **Better Performance**: Go's compiled nature and efficient concurrency
- **Single Binary**: No need for Python interpreter or virtual environments
- **Lower Memory Usage**: More efficient resource utilization
- **Modern UI**: Updated with TailwindCSS for better responsiveness
- **Enhanced Mobile Support**: Better touch interface and responsive design
## Future Enhancements
- [ ] Real-time collaborative editing
- [ ] Plugin system for extensions
- [ ] Full-text search with indexing
- [ ] Note linking and backlinks
- [ ] Export functionality (PDF, HTML)
- [ ] Themes and customization options
- [ ] REST API for external integrations