Skip to content

Beautify some docs properties #5118

Closed

Description

@cbrnr

There are some things in the auto-generated docs website that could be improved.

  1. Sometimes, the listed attributes are enclosed in double backticks (e.g. https://martinos.org/mne/dev/generated/mne.preprocessing.Xdawn.html#mne.preprocessing.Xdawn, https://martinos.org/mne/dev/generated/mne.decoding.CSP.html#mne.decoding.CSP). These double backticks get rendered in the docs, which is probably not what we want.
  2. If there is a references section, each listed reference is preceded by (1, 2) which should point to all occurrences in the text. However, the 2 entry is there even though a reference is only mentioned once in the text, and thus the link doesn't work.
  3. I wonder if it's correct to use double backticks when referring to arguments in the description (see e.g. the CSP docs, where the reg parameter is referred to in the description). In the type description of the parameters, these are usually rendered italic, so maybe we should enclose only with single backticks to be consistent.

Activity

  1. cbrnr commented on Apr 11, 2018

    @cbrnr
    ContributorAuthor

    Yep, they're narrower. I guess you would argue for restoring the wider layout, right?

  2. larsoner commented on Apr 11, 2018

    @larsoner
    Member

    Yes, any other choice would require a discussion :)

  3. larsoner commented on Apr 11, 2018

    @larsoner
    Member

    Sometimes, the listed attributes are enclosed in double backticks

    This is because variable names that end with _ are interpreted by Sphinx as links and generate warnings. sklearn has this, too:

    https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/linear_model/ridge.py#L608

    We should look to see if somehow they prevent these from being interpreted as links. Or maybe it's already fixed by latest numpydoc...?

  4. larsoner commented on Apr 11, 2018

    @larsoner
    Member

    I wonder if it's correct to use double backticks when referring to arguments in the description (see e.g. the CSP docs, where the reg parameter is referred to in the description). In the type description of the parameters, these are usually rendered italic, so maybe we should enclose only with single backticks to be consistent.

    In SciPy they use single backticks, which IIRC means "generate a link", but I've never seen it actually do so. It renders them in italics.

    Using double-backtics renders as code, which I think is better than italics.

  5. cbrnr commented on Apr 11, 2018

    @cbrnr
    ContributorAuthor

    Re double backticks, the sklearn example you've linked to doesn't use them. I've removed them in #5114 and the docs render fine I think: https://7698-1301584-gh.circle-artifacts.com/0/html/generated/mne.preprocessing.ICA.html#mne.preprocessing.ICA
    So this could already be fixed?

    Re double vs. single backticks, whatever we use is fine, but we should be consistent. I tend to prefer single (italic), because that's also how the description of a parameter (after the colon) is rendered. I'd use double backticks (code) only for real code snippets and not if only referring to the name of a parameter.

  6. larsoner commented on Apr 11, 2018

    @larsoner
    Member

    Re double vs. single backticks, whatever we use is fine, but we should be consistent.

    Double is the standard we have tried to follow so far

  7. larsoner commented on Apr 11, 2018

    @larsoner
    Member

    So this could already be fixed?

    Yes it's in #5120

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

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions