oirehT42 downloadsAuto-sort managed shopping-list blocks by checkbox status, configured store keywords, and item name.
Unified Shopping List Sorter is an Obsidian plugin for managed shopping-list blocks. It inserts Markdown task-list blocks into notes and keeps only those blocks sorted by checkbox status, configured store keywords, and item name.
Use the command palette command Unified Shopping List Sorter: Insert shopping list to add a managed block to the current note:
<!-- shopping-list:start {"title":"Shopping list"} -->
## Shopping list
- [ ] Item
<!-- shopping-list:end -->
Only content between those markers is managed. The plugin hides the marker lines in the editor while keeping them in the Markdown source. Normal Markdown task lists elsewhere in the note are ignored.
Use Unified Shopping List Sorter: Sort shopping lists in current note to sort manually. When auto-sort is enabled, the plugin also sorts after editor changes once the configured delay has elapsed.
Store keywords are matched case-insensitively around word and punctuation boundaries. The default keywords are aldi, dm, edeka, lidl, netto, penny, and rewe.
With the default German store keywords, each checkbox-status group is sorted in this order:
aldidmedekalidlnettopennyreweThe comma-separated setting controls which store names are recognised, not a manual priority order. Store groups are ordered alphabetically. Inside a store group, the store keyword is ignored for item-name sorting. If an item mentions several stores, such as Pizza Rewe/Aldi, it is grouped under the alphabetically first matched store, in this case aldi.
For example, this managed block:
<!-- shopping-list:start {"title":"Alltag einkaufen"} -->
## Alltag einkaufen
- [ ] Pesto Rewe
- [x] Waschmittel dm
- [ ] Hafermilch
- [ ] Gurken Edeka
- [ ] Nudeln Rewe
- [ ] Pizza Rewe/Aldi
- [ ] Shampoo dm
- [ ] Kaffee
- [ ] Milch Aldi
- [x] Butter Aldi
- [ ] Duschgel dm
- [ ] Brot Lidl
<!-- shopping-list:end -->
is sorted as:
<!-- shopping-list:start {"title":"Alltag einkaufen"} -->
## Alltag einkaufen
- [ ] Hafermilch
- [ ] Kaffee
- [ ] Milch Aldi
- [ ] Pizza Rewe/Aldi
- [ ] Duschgel dm
- [ ] Shampoo dm
- [ ] Gurken Edeka
- [ ] Brot Lidl
- [ ] Nudeln Rewe
- [ ] Pesto Rewe
- [x] Butter Aldi
- [x] Waschmittel dm
<!-- shopping-list:end -->
Some common German supermarket keyword sets produce these group orders:
aldi, edeka, rewe sorts as untagged, aldi, edeka, rewe.aldi, lidl, netto, penny sorts as untagged, aldi, lidl, netto, penny.dm, edeka, rewe sorts as untagged, dm, edeka, rewe.Settings are saved through Obsidian plugin data (.obsidian/plugins/shopping-list-sorter/data.json). With Obsidian Sync, enable syncing for plugin data/community plugin settings so store keyword changes are carried to other devices in the sync chain.
pnpm install
pnpm test
pnpm build
The Obsidian runtime loads manifest.json, the bundled main.js, and styles.css from a vault plugin folder:
<Vault>/.obsidian/plugins/shopping-list-sorter/