You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The :pyobject: option of the literalinclude directive is great for including only a specific definition of a module. Currently (Sphinx 1.8.4), it supports class and function definitions. I suggest to extend this to also support module-level variable definitions.
An example from my personal use case: I use collections.namedtuple in my code for creating simple record-like classes:
Since they don't use a "real" class definition, I cannot show their definition using :pyobject:.
A possible alternative to supporting variable definitions in :pyobject: which might be more flexible would be to support grepping lines using a regex. I could then do
+0 for supporting module level variable: Reasonable. I can accept if somebody sends us a PR.
-1 for adding new option: The directive is already too much complicated. And the notation seems like a program.
The
:pyobject:
option of theliteralinclude
directive is great for including only a specific definition of a module. Currently (Sphinx 1.8.4), it supports class and function definitions. I suggest to extend this to also support module-level variable definitions.An example from my personal use case: I use
collections.namedtuple
in my code for creating simple record-like classes:Since they don't use a "real"
class
definition, I cannot show their definition using:pyobject:
.A possible alternative to supporting variable definitions in
:pyobject:
which might be more flexible would be to support grepping lines using a regex. I could then doThe text was updated successfully, but these errors were encountered: