-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wish: ordering of example gallery (and sphinx table of contents) #37
Comments
On Sunday, June 07, 2015 02:12:08 AM jnothman wrote:
|
This is something I would really like to see in a future update. Being able to have specific examples first would be fantastic. I saw the proposed alphabetical sort, and was wondering if a better solution might be extracted from an optional part of the python filename. |
This is something I would really like to see in a future update. Being
able to have specific examples first would be fantastic. I saw the
proposed alphabetical sort, and was wondering if a better solution
might be extracted from an optional part of the python filename.
It would indeed be useful to have a variety of options, including
alphabetical sorting, and more explicit way.
+1 for a pull request.
|
I reckon there are two different orderings that you can implement:
In my mind
|
This one has passed through some discussion and changes within the I'm still unsure how to expose this feature to the user.
|
That sounds brittle, though an option.
Well, at least have a few options, such as lines of code and alphabetic, |
curious if there is any new development on this idea. a few folks here are interested in implementing sphinx-gallery for their projects but want to know if they can choose the ordering of images in the gallery |
What I'd like to do is explicitly list the ordering in the |
No progress on this, PR more than welcome! Just to be clear I think we are talking about within section ordering, i.e. bullet point I would be fine with a custom function that can be specified in conf.py. I would say we should implement the functions that users are most likely to use:
I don't think this is a good use case of the ordering functionality. You can already control which example are being run through |
I'd be +1 for letting devs provide a function that accepts a list of filenames, and outputs a list representing the order they should be displayed in a gallery. |
I would be in favour of a sorting key, similarly to the |
That assumes the filename is enough/appropriate information to build a sort
key from...
…On 9 March 2017 at 09:36, Loïc Estève ***@***.***> wrote:
I would be in favour of a sorting key, similarly to the key argument you
can pass to sorted.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#37 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAEz66Hz3FW6evCuz7eR4eSRWLkYc846ks5rjy2FgaJpZM4E6u39>
.
|
Yes that is the assumption, do you have a use case where the filename is not enough ? |
Another ping on this issue as it's coming up in a matplotlib discussion. What if there were a |
I suppose the filename can always be a key to a lookup of priority
…On 24 Apr 2017 10:26 am, "Chris Holdgraf" ***@***.***> wrote:
Another ping on this issue as it's coming up in a matplotlib discussion.
What if there were a gallery_order keyword in the SG configuration? This
could be a function that will be passed a list of strings corresponding to
the gallery folders, and must output a list of strings where set(lista)
== set(listb) and len(lista) == len(listb).
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#37 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAEz62xc70d-yQm6_r24y3AsLHyE24rpks5ry-wogaJpZM4E6u39>
.
|
I guess you are talking about between folders ordering, i.e. A rough sketch of what I had in mind: class ExplicitOrderKey(object):
def __init__(self, ordered_list):
self.ordered_list = ordered_list
def __call__(self, item):
return self.ordered_list.index(item)
key = ExplicitOrderKey(['b', 'c', 'a'])
sorted(['a', 'b', 'c'], key=key) You could have a better error message in case an item is not in A PR is more than welcome. |
ok cool - I can try to get to this once I get the current PR merged in matplotlib (trying to merge things earlier than later, and then improve stuff iteratively later on). It would definitely be a benefit for MPL, I think. |
This ticket should be closed. |
Closed via #234 |
A nice to have is the ability to specify an ordering for example directories and examples within them. While this is trivial to do by prefixing with numbers, this breaks any existing URLs. Perhaps we can conceive of a way to specify order.
The text was updated successfully, but these errors were encountered: