ex_doc icon indicating copy to clipboard operation
ex_doc copied to clipboard

Module list should be consistent

Open alexrp opened this issue 13 years ago • 7 comments

Right now, e.g. GenServer.Behaviour shows up with its full module name in the module list. This is of course because there's no GenServer parent module, but the behavior is rather confusing to someone not in the know; it gives the impression that other modules don't have submodules (e.g. Kernel.SpecialForms isn't in the list). With the current behavior, submodules also aren't very discoverable in general.

I see two ways to deal with this:

  • List all modules in the list with their full name. This makes modules a lot more discoverable when just browsing through the list and adds no confusion. It does have the potential to be overwhelming when there are lots of modules and lots of hierarchies, however.
  • Consistently put modules under their parent module. This would mean that e.g. GenServer would either not be clickable or would just show a page saying "nothing here". This doesn't really solve the discoverability issue, though.

Thoughts? Any other ideas?

alexrp avatar Dec 07 '12 05:12 alexrp

Hey @alexrp, that's a very good point.

For Elixir, I would be more inclined to go with the second option. I think listing all modules by full name would increase the size of the list and probably hurt discoverability because you would get too much noise.

On the other hand, for other projects (that are not Elixir), the nesting will probably be unnecessary since you would likely have just one root module.

That said, maybe we should go with 1) because it would at least be consistent across the board.

/cc @rafaelfranca

josevalim avatar Dec 07 '12 07:12 josevalim

Anyone have further thoughts on this issue? I made a feature branch that lists the whole module name (without nesting) to see what it would look like: jwarwick/ex_doc@87b6e1f3172255631fd61d059ec8e66b91ee4adc

For the Elixir source, it looks okay. The Mix.Tasks.* list gets a bit long though.

jwarwick avatar Aug 16 '13 20:08 jwarwick

It is your call @jwarwick :)

josevalim avatar Aug 16 '13 20:08 josevalim

Ha! Not sure I'm up for this level of pressure :cold_sweat:

I'll stare at a bit more, maybe try indenting the children and see if that helps with the noise.

jwarwick avatar Aug 16 '13 20:08 jwarwick

Hahaha, don't worry @jwarwick! we can always experiment with some approaches too and then rollback if we are not comfortable with it. Just to have something to compare, I have pushed elixir docs using your changes to the master docs, so people can compare the two versions directly:

http://elixir-lang.org/docs/master/ (new) http://elixir-lang.org/docs/stable/ (old)

I will send an e-mail to the mailing list too and get some feedback!

josevalim avatar Aug 16 '13 20:08 josevalim

And for what is worthy, I prefer the new format, much easier to discover and see which modules are available. There is some noise but it is easy to scroll through it. :smile:

josevalim avatar Aug 16 '13 21:08 josevalim

@jwarwick I think we should go ahead and merge your changes. Would you please send a pull request or merge into master? :)

josevalim avatar Aug 18 '13 06:08 josevalim