#13040 closed (fixed)
Change in Sphinx rendering of current module
Reported by: | stherrien | Owned by: | stherrien |
---|---|---|---|
Component: | Documentation | Version: | 1.1 |
Severity: | Keywords: | ||
Cc: | shawntherrien@… | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
Description
I would like to add import statements to the documentation under the class to make things easier to find currently the docs offer an index of all the modules and when followed the doc of the class definition doesn't contain the import statements these are very useful in the documentation and I think they should exist where they currently do not. example would be the django file object docs page http://docs.djangoproject.com/en/1.1/ref/files/file/#ref-files-file it currently doesn't show any import statements to show the user where this module exists.
Attachments (3)
Change History (14)
by , 15 years ago
Attachment: | files.diff added |
---|
comment:1 by , 15 years ago
Component: | Uncategorized → Documentation |
---|
comment:2 by , 15 years ago
Has patch: | set |
---|
comment:3 by , 15 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Sphinx provides much better ways to do this. You don't need to manually include an include statement like the one you describe, you need to make the ".. class::" declaration fully qualified, or set the package context so that a classname-only declaration knows the right path.
comment:4 by , 15 years ago
Resolution: | wontfix |
---|---|
Status: | closed → reopened |
Russel,
I think I understand what your looking for I think the second diff will give you what you need for this fix and I would like to go through all of the docs and add these fully qualified class paths.
example instead of this".. class:: File(file_object)" you want this ".. class:: django.core.files.File(file_object)" is that correct?
-shawn
comment:5 by , 15 years ago
Cc: | added |
---|
comment:6 by , 15 years ago
Resolution: | → wontfix |
---|---|
Status: | reopened → closed |
Broadly speaking, yes, but In this specific case, no. Like I said, Django can maintain the current package as context, and in this case, it already is.
.. currentmodule:: django.core.files .. class:: File(file_object)
and
.. class:: django.core.files File(file_object)
are equivalent.
That is, Sphinx already has all the metadata it requires. If the rendering isn't exploiting that metadata, that's a separate issue. There may be places in code where classes aren't fully marked up, in which case, yes -- the ..class decorations need to be corrected.
Closing wontfix because the specific example you have given doesn't require any modification (side note - please generate patches from the root of the source tree, not just of a single file)
If you want to propose changing the Sphinx rendering, or can provide a patch that identifies classes that don't have the right class markup, please reopen.
comment:7 by , 15 years ago
Resolution: | wontfix |
---|---|
Status: | closed → reopened |
Summary: | Would like to add import statments for class documentation where needed → Change in Sphinx rendering of current module |
I purpose changing the Sphinx rendering of current modules I think this is helpful to show the full paths in the docs.
comment:8 by , 15 years ago
Patch needs improvement: | set |
---|---|
Triage Stage: | Unreviewed → Accepted |
Marking accepted, because the specific instance in the files docs is clearly a problem. However, the proposed solution isn't ideal -- the reason add_module_names is currently set to False is because there are many places where the repeated module name doesn't aid readability (for example, in the documentation on testing utilities -- topics/testing.html#topics-testing)
comment:9 by , 15 years ago
Owner: | changed from | to
---|---|
Status: | reopened → new |
comment:10 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
patch for the file object doc page