Zim

Comment 8 for bug 303657

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote : Re: [Bug 303657] Re: natural sorting in the page index

On Wed, Mar 23, 2011 at 9:16 AM, milk2cups <email address hidden>wrote:

> On Wed, Mar 23, 2011 at 5:09 AM, Lisa <email address hidden> wrote:
> > Just a question: the natural sorting should be applied even when the
> > numbers are in a different position, like at the beginning of the
> > filename or in the middle?
>
> I suggest you only do the obvious ordering, and do nothing if the
> situation becomes tricky.
> i.e., part1, part2, ..., part10. but do not try too hard to figure out
> the ordering of part1x and part_2aaa.
>

This can be easily achieved by splitting the name in numeric and non-numeric
parts and then sort based on that list.

> Also, I think there're some conventions regarding software version
> numbers, e.g., py3alpha, py3beta, py3rc, etc., you might want to take
> that into consideration as well.
>

I would advise against this as version numbering is highly inconsistent
across software projects. Only thing like a spec in this area is the
numbering of debian package version numbers. Fortunately that is mostly
based on the trick mentioned above: split numeric and non numeric parts +
splitting on some special characters like "-", "." and ":".

-- Jaap