thegetty / quire

A multi-package repository for the Quire multiformat publishing framework
https://quire.getty.edu/
BSD 3-Clause "New" or "Revised" License
89 stars 10 forks source link

updates default sort #927

Open bulbil opened 3 months ago

bulbil commented 3 months ago

Thank you for contributing to Quire! Please complete the form below to submit your pull request for review.

For the Title of this pull request, please use the format "Type/Issue-#: Brief description." For Type, the options are Fix, Feature, Docs, or Chore. Issue-# is only needed if this pull request addresses an existing issue.

Before submitting your PR, make sure that you can run the following commands: quire preview, quire build, quire pdf, and quire epub. If any of those core quire commands throw errors/yield unexpected behavior, we will NOT review the PR!

Checklist

Please put an X within the brackets that apply [X].

Is this pull request related to an open issue? If so, what is the issue number?

Please briefly describe the goal of this pull request and how it may impact Quire's functionality.

Developing locally I found that when order is not set or has many duplicate values, default sort was not stable.

I think Hugo's default sort fallbacks and the way it uses weight is significantly different from the current behavior. I created a useCustomSort config key to implement a more flexible TOC sort based on title string.

At the very least, I propose you getAllSorted first in order to ensure that order is not different between builds when order is missing.

Please describe the changes you made, and call out any details you think are particularly relevant for the Quire team to note in their review.

Does this pull request necessitate changes to Quire's documentation?

Include screenshots of before/after if applicable.

Additional Comments

bulbil commented 3 months ago

@anderspollack here's that super minor update I mentioned earlier today to do with sort -- not having been part of the conversations, not sure how helpful this is or what desired behavior is.

I just thought having order be inconsistent between builds wasn't ideal. I have a more elaborate custom sort but thought that would require more discussion.

As a sidenote, I have an idea about how to have search-index.json not include HTML from the parsed MD, be happy to chat about that. It's not the most elegant thing and it doesn't seem like a pressing concern -- but in case you are interested I'd be happy to write something up.

bulbil commented 3 months ago

@mphstudios apologies, I realized I had updated linting in my Quire project but not in this branch.