Uploaded image for project: 'Motor'
  1. Motor
  2. MOTOR-101

Obviously distinguish coroutines from regular methods

    • Type: Icon: New Feature New Feature
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 0.6
    • Affects Version/s: 0.5
    • Component/s: Docs
    • Labels:
      None
    • 4

      From asvetlov:

      Using motor I constantly get a problem: it's not obvious what methods
      are coroutines (should be used with `await`/`yield from` statements)
      and what are regular methods.

      For aiohttp we've solved it by adding `..coroutinemethod:: name()`
      markup (borrowed from asyncio).

      The code for sphinx plugin is here:
      https://github.com/KeepSafe/aiohttp/blob/master/docs/aiohttp_doctools.py

      This line connects the plugin:
      https://github.com/KeepSafe/aiohttp/blob/master/docs/conf.py#L57

      Generated doc looks like
      http://aiohttp.readthedocs.org/en/stable/web_reference.html#aiohttp.web.Request.json

      Motor has more complicated plugin for collecting documentation but
      maybe you would add some markup for coroutines?

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: