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
It looks like there isn't any documentation on the constants that we define for commands, states, polarities and other string-based properties. What must be changed to make them appear in the rendered docs?
I can't say that the particular example is an icon of clarity, but it illustrates the point 😆 It seems pretty straightforward; the colons are the key, right?
Sphinx allows you to document constants, class properties... by using #:. As pointed by @ddemidov this is used in the source code.
By the way, the tables are not supposed to be used externally, so they do not need special documentation apart as standard code comments. My bad : I should have prefixed their name with an underscore, which would have made them omitted from the generated documentation.
@WasabiFan These variables are Python dictionaries, so colons are used to separate the key and its associated value. Another point is that the excerpt you made is not from the source, since the declaration of NOTE_FREQUENCIES does not appear in this form. This is the result of the elaboration of the table by the _make_scales internal function. So I don't understand how you get it, apart by printing the value in Python shell.
These variables are Python dictionaries, so colons are used to separate the key and its associated value.
I was just joking; I found it funny that I followed his link to a wall of text in the docs. The view that I screenshotted was from the generated documentation, which is showing up because of the lack of underscore (ah, Python...). The documentation string is rendered below it on the page. The colons that I was referring to were the ones that made up the docstring: #: This is documentation.
Sorry for the misunderstanding :-( I was surprised by such a question coming from someone like you !!
BTW it's strange that the form of the declaration shown in the documentation is not the source one, but the evaluated version. I was not aware of this behaviour WRT documentation generation.
Regarding the "_" now, I will update the source to make the declarations "private" so that they don't add noise any more to the generated documentation. I will demote their comments to standard ones since they will no more be extracted by the generator then.
Activity
ddemidov commentedon Feb 9, 2017
I think python does not support auto-documentation for constants, so we need to document those explicitly.
ddemidov commentedon Feb 17, 2017
It seems @EricPobot found a way to document class-scope constants: code, results.
WasabiFan commentedon Feb 17, 2017
I can't say that the particular example is an icon of clarity, but it illustrates the point 😆 It seems pretty straightforward; the colons are the key, right?
ddemidov commentedon Feb 17, 2017
Yes: http://stackoverflow.com/questions/20227051/how-to-document-a-module-constant-in-python
EricPobot commentedon Feb 17, 2017
Sphinx allows you to document constants, class properties... by using
#:. As pointed by @ddemidov this is used in the source code.By the way, the tables are not supposed to be used externally, so they do not need special documentation apart as standard code comments. My bad : I should have prefixed their name with an underscore, which would have made them omitted from the generated documentation.
@WasabiFan These variables are Python dictionaries, so colons are used to separate the key and its associated value. Another point is that the excerpt you made is not from the source, since the declaration of NOTE_FREQUENCIES does not appear in this form. This is the result of the elaboration of the table by the _make_scales internal function. So I don't understand how you get it, apart by printing the value in Python shell.
WasabiFan commentedon Feb 17, 2017
I was just joking; I found it funny that I followed his link to a wall of text in the docs. The view that I screenshotted was from the generated documentation, which is showing up because of the lack of underscore (ah, Python...). The documentation string is rendered below it on the page. The colons that I was referring to were the ones that made up the docstring:
#: This is documentation.ericpascual commentedon Feb 17, 2017
Sorry for the misunderstanding :-( I was surprised by such a question coming from someone like you !!
BTW it's strange that the form of the declaration shown in the documentation is not the source one, but the evaluated version. I was not aware of this behaviour WRT documentation generation.
Regarding the "_" now, I will update the source to make the declarations "private" so that they don't add noise any more to the generated documentation. I will demote their comments to standard ones since they will no more be extracted by the generator then.
Document class-scope constants
Document class-scope constants (#306)