reifat_daily-notes-sorter/README.md

124 lines
5.6 KiB
Markdown
Raw Permalink Normal View History

2025-11-09 00:02:20 +00:00
# Daily Notes Sorter
An Obsidian plugin that allows you to automatically sort daily notes by date in the file explorer.
**Requires Obsidian 1.1.0 or newer** (see `manifest.json``minAppVersion`).
2025-11-09 00:02:20 +00:00
## Description
2025-11-20 01:43:46 +00:00
Tired of your daily notes jumping out of order? When your note names consist of a date (for example, `15.01.2024`, `01/15/2024`), Obsidians file explorer often cant sort them chronologically. Daily Notes Sorter understands popular regional date formats and keeps your notes exactly where you expect them—newest first or oldest first, on demand.
2025-11-20 01:52:23 +00:00
<p align="center">
<img src="https://github.com/Reifat/daily-notes-sorter/blob/main/resources/src%26after.png" height="300" width="400"/>
</p>
2025-11-20 01:43:46 +00:00
### Demo
Curious how it works in practice? In this short clip, youll see how to add a folder, pick the date format, and toggle the sort to instantly re-order your daily notes:
2025-11-20 01:52:23 +00:00
<p align="center">
<img src="https://github.com/Reifat/daily-notes-sorter/blob/main/resources/demo.gif" height="600" width="800"/>
</p>
2025-11-09 00:02:20 +00:00
## Features
### 📁 Date Sorting
- Automatic sorting of files in specified folders by date
- Support for multiple date formats:
- `YYYY-MM-DD` (ISO format, e.g.: 2024-01-15)
- `DD.MM.YYYY` (European format, e.g.: 15.01.2024)
- `DD.MM.YY` (European short format, e.g.: 15.01.24)
- `MM/DD/YYYY` (US format, e.g.: 01/15/2024)
- For numeric formats, the separator must be a single, uniform character that is not a letter or digit (space, dot, dash, underscore, etc.); only the order matters. Examples: `DD-MM-YYYY`, `DD MM YYYY`, `YYYY.MM.DD`, `MM-DD-YYYY`. Multiple or mixed separators (e.g., `15--01--2024`, `15-01_2024`) will not match.
- If numeric pattern does not match, an optional **textual fallback** is tried: three space-separated tokens at the start of the file name in the **same** day/month/year order as the selected setting (e.g. `2024 Sept. 9`, `15 Aug 2024`). Month names follow a **fixed** locale list in the plugin (English by default), not your OS language, so behavior stays the same when the same vault is opened on different machines.
2025-11-09 00:02:20 +00:00
### 🔄 Sort Direction
- Ascending sort (from old to new)
- Descending sort (from new to old)
- Toggle sort direction via button in file explorer interface
### ⚙️ Flexible Configuration
- Configure individual folders with custom date formats
- Autocomplete folder paths when configuring
- Real-time path validation
- Settings persistence between sessions
### 🔔 Notifications
- Automatic notifications about files that don't match the specified date format
- Files without dates are placed at the beginning (descending) or end (ascending) of the list
## Usage
### Installation
#### Via Community Plugins (Recommended)
1. Open Obsidian Settings
2. Go to **Community plugins**
3. Make sure **Safe mode** is **off**
4. Click **Browse** and search for "Daily notes sorter"
5. Click **Install** and then **Enable**
2025-11-14 23:44:18 +00:00
#### Manual Installation (without working with the repository)
1. Download the latest release from the Releases page:
- `https://github.com/Reifat/daily-notes-sorter/releases/latest`
2. In the release assets, download and unzip “Source code (zip)”.
3. From the unpacked archive, move `scripts/install/env-example/install-config.env` into the root of the plugin folder (next to `README.md`).
4. Open `install-config.env` and set:
- `DEST_DIR` — absolute path to your vaults plugin folder, e.g. `/path/to/YourVault/.obsidian/plugins/daily-notes-sorter`
- `RELEASE_TAG` — the release tag you want to install (e.g. `1.0.1`)
2025-11-14 23:44:18 +00:00
5. Run the installer for your platform:
- macOS: `bash scripts/install/install.sh` (make executable if needed: `chmod +x scripts/install/install.sh scripts/install/install.command`)
- Windows: `scripts\install\install.bat`
- macOS (double-click): `scripts/install/install.command`
Notes:
- On macOS, if blocked by Gatekeeper, run: `xattr -r -d com.apple.quarantine scripts/install`
- Windows `.bat` files do not require execution permissions; ensure the file isnt blocked in Properties if SmartScreen warns.
2025-11-09 00:02:20 +00:00
### Configuration
1. Open plugin settings (Settings → Daily notes sorter settings)
2. Click "Add item" to add a new folder
3. Enter folder path (you can use autocomplete)
4. Select date format from dropdown
5. Click "Apply settings" to apply changes
### Using in File Explorer
1. After configuring folders, sorting is applied automatically
2. A button for toggling sort direction will appear in the file explorer header
3. Click the button to toggle between ascending and descending sort
> **For developers:** Technical documentation, including plugin architecture, technical details, development instructions, and implementation details, can be found in [`src/README.md`](src/README.md).
## Known Limitations
1. **Date format at the beginning of file name:** The plugin only searches for dates at the beginning of file names. If the date is in the middle or end of the name, it will not be recognized.
2. **Files only:** The plugin sorts only files (TFile), folders remain in their places.
3. **FileExplorer dependency:** The plugin requires the built-in "Files" (FileExplorer) plugin to be enabled.
4. **One format per folder:** Each folder can have only one date format. If a folder contains files with different date formats, they may be sorted incorrectly.
## Future Improvements
- Support for additional date formats
- Search for date anywhere in file name
- Sort folders by date
- Group files by months/years
- Export/import settings
## License
MIT
## Author
Nick (GitHub: [@Reifat](https://github.com/Reifat))
## Support
If you found a bug or have a suggestion for improvement, please create an issue in the project repository.