Skip to content

Document string constants #299

Closed
Closed

Description

@WasabiFan

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?

Activity

  1. ddemidov commented on Feb 9, 2017

    @ddemidov
    Member

    I think python does not support auto-documentation for constants, so we need to document those explicitly.

  2. modified the milestone: 0.8.2 on Feb 13, 2017
  3. ddemidov commented on Feb 17, 2017

    @ddemidov
    Member

    It seems @EricPobot found a way to document class-scope constants: code, results.

  4. WasabiFan commented on Feb 17, 2017

    @WasabiFan
    MemberAuthor

    image

    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?

  5. ddemidov commented on Feb 17, 2017

    @ddemidov
    Member
  6. EricPobot commented on Feb 17, 2017

    @EricPobot
    Contributor

    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.

  7. WasabiFan commented on Feb 17, 2017

    @WasabiFan
    MemberAuthor

    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.

  8. ericpascual commented on Feb 17, 2017

    @ericpascual

    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.

  9. added a commit that references this issue on Feb 17, 2017
  10. added a commit that references this issue on Feb 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions