Skip to content
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

Sort functions in doc index frames #543

Closed
wants to merge 1 commit into from

Conversation

derek121
Copy link
Contributor

The list of functions per module in the left-hand frame in the HTML docs (e.g., http://www.erlang.org/doc/man/string.html) have been sorted by their order within the associated XML doc file, which is not always alphabetically. This makes quickly finding a function within a module's function index list slower than it would be if sorted, as a full visual scan of the functions needs to be done to attempt to locate any specific function. Or, if the viewer doesn't realize that the list is not sorted, possibly missing a function that does appear in the list.

In some cases the reason for the misordering is that related functions are grouped together in the XML doc (e.g., string:chr/2 and string:rchr/2), as that makes sense when reading the body of the documentation. In other cases, there's no clear reason for the misordering.

Regardless, an index list of functions, such as this, which is sorted for most modules, but not always, is confusing. This change sorts the function index list per module alphabetically, while leaving alone the body of the page. In cases where module callbacks are included in the documentation (e.g., http://www.erlang.org/doc/man/application.html), those functions (e.g., Module:start/2) still remain at the bottom of the index list.

Changed to sort the list of functions for each module in the lefthand
frame of doc pages, for easier and more reliable browsing.
@OTP-Maintainer
Copy link

Patch has passed first testings and has been assigned to be reviewed


I am a script, I am not human


@OTP-Maintainer
Copy link

Patch has passed first testings and has been assigned to be reviewed


I am a script, I am not human


@derek121
Copy link
Contributor Author

To elaborate on this issue:

  • Building the docs is done as directed at INSTALL.md:
    • make docs
    • make install-docs (not necessary to install to see the resulting .html)
  • A sample doc source file that results in an unordered contents frame (as mentioned above): lib/kernel/doc/src/application.xml
  • The resulting doc HTML from the make docs step: lib/kernel/doc/html/application.html

Using the modified db_html.xsl file from this PR:

  • touch lib/kernel/doc/src/application.xml (to force make to rebuild it)
  • make docs

Screenshot of the current contents frame for application. Note that it's mostly, but not completely, alphabetized:
image

Screenshot of the file built with the modified db_html.xsl from this PR:
image

Please let me know if there are any questions or issues with this PR.

@psyeugenic psyeugenic added team:PS Assigned to OTP team PS enhancement labels Apr 18, 2016
@lthor
Copy link
Contributor

lthor commented Jun 13, 2016

Thanks for the contribution, I've rebased it to the master branch and it will be released in OTP 19.

@lthor lthor closed this Jun 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement team:PS Assigned to OTP team PS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants