cfunction scope and roles

Dmitriy Morozov avatarDmitriy Morozov created an issue

It would great if the cfunction directive was aware of its scope. I.e. if cfunction was declared inside of a ctype (as its child), then it should automatically prepend the name of that type to its id. Similar for the references (via func role) within that type. It should not, however, prepend the type name within the visible name in the output. I.e. I'm hoping for the behavior similar to the method behavior for Python documention.

So for example if one wrote:

.. ctype:: class A

   Some description of type A.

   .. cfunction:: f()

      Description of f.

  .. cfunction:: g()

      Calls :func:`f`.

Another reference to :func:`A::f`.

then ideally it would generate the same ids as if one wrote

.. ctype:: class A

   Some description of type A.

   .. cfunction:: A::f()

      Description of f.

  .. cfunction:: A::g()

      Calls :func:`A::f`.

Another reference to :func:`A::f`.

but without the confusing A:: within the class itself.

Comments (1)

  1. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.