Sorting Tables
By default, table rows are not sorted.
However, if a table contains sorting hints, then psv will automatically sort the rows in the table.
The table above will be sorted by type and then by weight, in descending order.
Sorting Hints
The addition of a ^ or v character to a column's ruler will cause that column to be included when sorting the table.
| Pattern | Description |
|---|---|
| ^ | sort in ascending order (smallest values first) |
| v | sort in descending order (largest values first) |
| 0 .. 7 | specify which columns should be compared first |
Multiple columns may be marked for sorting.
If the columns should not be compared from left-to-right, an additional priority may be added to the ^ or v character.
Valid priorities are limited to the numbers 0 .. 7, where the columns with priority 1 will be compared first, followed by priority 2, etc., and finally columns with priority 0 (default) .
Note that priority 0 is automatically implied and will not be included in generated tables.
Columns with numerical (. alignment hint) or version (.. alignment hint) alignment will also be sorted according to their numerical values.
Supported Numerical Formats (introductory overview)
| Example | Description |
|---|---|
| 1234 | decimal integers |
| -1234 | signed numbers |
| 12.34 | decimal floating point numbers |
| 12.34e2 | decimal exponentiation |
| +12.34e-2 | signed exponents |
| 0x0a10 | hexadecimal integers |
| v1.2.3 | semver version numbers |
- sort the table of phyical constants by their value
semver versions can also be sorted: