Skip to content

Methods without a docstring do not get rendered #64

Closed

Description

@ofek

Setup

mkdocstrings version 0.10.0
Python 3.8.1
Windows 10

Description

This

::: datadog_checks.base.stubs.datadog_agent.DatadogAgentStub

renders this

https://github.com/DataDog/integrations-core/blob/hack-a-doc/datadog_checks_base/datadog_checks/base/stubs/datadog_agent.py#L6

as nothing:

<h6 class=hidden-toc href=#datadog_checks.base.stubs.datadog_agent.DatadogAgentStub id=datadog_checks.base.stubs.datadog_agent.DatadogAgentStub style="visibility: hidden; width: 0; height: 0;"> <a class=headerlink href=#datadog_checks.base.stubs.datadog_agent.DatadogAgentStub title="Permanent link"></a></h6>

If I add a class docstring then I get the text but the anchor is still hidden (and no members of course b/c no docstrings).

I'd expect the linked code to look something like we have here (with https://github.com/tomchristie/mkautodoc):

https://datadoghq.dev/integrations-core/base/api/#datadog-agent

Activity

  1. ofek commented on Mar 28, 2020

    @ofek
    ContributorAuthor

    Hmm, I guess that's 2 issues actually

  2. pawamoy commented on Mar 29, 2020

    @pawamoy
    Member

    Try using these two options:

    ::: datadog_checks.base.stubs.datadog_agent.DatadogAgentStub
        rendering:
          show_root_heading: yes
          show_if_no_docstring: yes

    You can set these as default in mkdocs.yml:

    plugins:
      - mkdocstrings:
          handlers:
            python:
              rendering:
                show_root_heading: yes
                show_if_no_docstring: yes

    All the options: https://pawamoy.github.io/mkdocstrings/reference/handlers/python/#mkdocstrings.handlers.python.PythonRenderer.DEFAULT_CONFIG

  3. ofek commented on Mar 29, 2020

    @ofek
    ContributorAuthor

    Ah nice! 🙇

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