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

Flatten documentation hierarchy #90

Merged
merged 4 commits into from Jan 27, 2018
Merged

Conversation

mrocklin
Copy link
Collaborator

Fixes #89

@mrocklin
Copy link
Collaborator Author

Some additional things that would be nice to fix (but I'm not sure how):

  1. Flatten the API docs to require fewer clicks to get to a function of interest. Currently the API page has a single option that you have to click on. This seems silly, but is perhaps necessary for the machinery we're using now?
  2. Remove scrollbars from code blocks

-------

Many of the normal Numpy operations work on :obj:`COO` objects just like on :obj:`numpy.ndarray` objects.
This includes arithmentic, :obj:`numpy.ufunc` operations, or functions like tensordot and transpose.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arithmentic -> arithmetic

Contributing to sparse
======================
Contributing
============
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably has a link to the GitHub page that might need to be changed.

@@ -1,4 +1,4 @@
sparse
Sparse
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might also have a GitHub page link.

Copy link
Collaborator

@hameerabbasi hameerabbasi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some feedback. Also see my comments over in #89.

@hameerabbasi
Copy link
Collaborator

1 can be fixed by moving generated/sparse.rst to api.rst, and redoing the headings. 2, I'm not so sure about.

Copy link
Collaborator

@hameerabbasi hameerabbasi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment.

docs/conf.py Outdated
@@ -19,6 +19,7 @@
#
import os
import sys
import sparse
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be moved below the sys.path.insert, otherwise it won't work. RTD runs Sphinx from the docs directory.

@hameerabbasi
Copy link
Collaborator

This gets a +1 from me, but you should still do #90 (comment) if possible.

@mrocklin
Copy link
Collaborator Author

Thoughts on how to change the title of the page and TOC line from sparse to API? I can change the file, but presumably that file gets auto-generated and so the change would be lost.

@hameerabbasi
Copy link
Collaborator

hameerabbasi commented Jan 26, 2018

I apologize in advance for stating things you may already know here.

Actually, it doesn't. It only gets auto-generated if it's deleted. If it's not deleted, the change sticks. That's a feature so we can modify auto-generated pages.

Also, it only gets auto-generated if there's an autosummary directive somewhere upstream. We would be changing the main autosummary directive from the modules page to the sparse page.

I would suggest the following:

  • Delete api.rst
  • Move generated/sparse.rst -> api.rst
  • Change the heading.
  • Add a toctree directive of generated like the current api.rst.
  • Add :ref: roles in the flattened document. (see below for tl;dr).
  • Modify generated/sparse.COO.rst to match the new labels.

You can also do this for inter-links:

.. _my-label:

Some section heading
----------------------


# Somewhere else, maybe even in another file entirely!
:ref:`my-label` # Automatic title for link text!
:ref:`A link <my-label>` # Custom link text

You may need to delete your build directory, otherwise it doesn't fully update the TOC on every page, and you will only see a fraction of the warnings (such as the ones that should have happened for missing cross-links when you changed the documentation structure). RTD does this for us.

If this is all too much for you, I can take over and push a commit or two. If not, it's a great learning experience!

@hameerabbasi
Copy link
Collaborator

If you want to put the COO and DOK classes on the main API page, copy over their contents and get rid of the classes part in sparse.rst

@hameerabbasi
Copy link
Collaborator

Alternatively, you could just not move them and rename sparse.rst to api.rst and do the changes there. In this case, you don't need a :toctree: directive.

@mrocklin
Copy link
Collaborator Author

Rebased on master. Merging this soon if there are no objections.

@hameerabbasi
Copy link
Collaborator

Minor comment... The original api.rst should be deleted.

@hameerabbasi
Copy link
Collaborator

And there's still the problem of missing/broken cross references in generated/sparse.COO.rst. :-) I can do that if you have issues.

@mrocklin
Copy link
Collaborator Author

And there's still the problem of missing/broken cross references in generated/sparse.COO.rst. :-) I can do that if you have issues.

If you wanted to handle that that would be welcome. It might also be useful to have the autosummary references come before the autoclass and large docstring. That way people can more easily see the options they have on this page.

@hameerabbasi
Copy link
Collaborator

True. I'm a bit busy today, I might not be responsive. I'll handle it tomorrow, if you're okay with that.

@mrocklin
Copy link
Collaborator Author

No rush on my end. I wanted to get this in to avoid having to rebase further and handle conflicts with other PRs that touch documentation. But if you're busy then those are unlikely to arise anyway :)

@hameerabbasi hameerabbasi merged commit 60238af into pydata:master Jan 27, 2018
hameerabbasi pushed a commit to hameerabbasi/sparse that referenced this pull request Feb 27, 2018
* Flatten documentation hierarchy

* mrocklin -> pydata, also fix version

* remove user manual

* flatten api docs

* Fix inter-links.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants