alexandru-dinu / obsidian-sortable

Table sorting plugin for https://obsidian.md
MIT License
233 stars 8 forks source link

Implement parsers for various data types + auto-detect data type #18

Open alexandru-dinu opened 3 years ago

alexandru-dinu commented 3 years ago

From https://meta.wikimedia.org/wiki/Help:Sorting:

The way items are sorted depends on the data type of the first rows. To determine the data type, the first 5 non-blank rows below the header are tested after loading the page and the most appropriate format is chosen. Mismatches are possible. The sort order of a column can be forced [using data-sort-type="..."].

jquery.tablesorter.js defines the following parsers:

then it tries to detect parser for column.

This may be the most straightforward way of dealing with multiple data types and ensure minimal tinkering on user's part.