fortran-lang.org icon indicating copy to clipboard operation
fortran-lang.org copied to clipboard

Sort fpm registry alphabetically

Open awvwgk opened this issue 3 years ago • 3 comments

The fpm registry at packages/fpm is currently sorted chronologically in the order of addition to the registry, a more useful sorting would be alphabetically.

It appears that Liquid is not able to sort a hash map alphabetically (!) by itself, therefore implementing this in Liquid will be ugly.

awvwgk avatar Jan 03 '21 09:01 awvwgk

Perhaps the best option is to structure the index differently, as an array instead of a hash map

LKedward avatar Jan 03 '21 11:01 LKedward

A hash map is the right representation for the registry, I see no need to adapt it due to the shortcomings of a templating language. An easy fix from the fpm-registry side would be sorting the index before committing it, alternatively we have to search for a gem that can add the feature we need for the webpage here.

awvwgk avatar Jan 03 '21 12:01 awvwgk

True, though the index is only a serialisation, converting to an array serialisation does not preclude implementation as a hash map. I'd rather not complicate the build with additional Ruby code so sorting the index would be preferred. It's unfortunate to rely on the ordering of the data for rendering the site but your proposed solution is perhaps the simplest.

LKedward avatar Jan 04 '21 10:01 LKedward

This should be discussed at https://github.com/fortran-lang/fpm-docs/issues/59

awvwgk avatar Aug 19 '22 12:08 awvwgk