Skip to content

Conversation

@SmirnGreg
Copy link

@SmirnGreg SmirnGreg commented May 13, 2020

Dear @kernc, maintainers,

For issue #110 I have implemented quite a dirty hack that adds the reSt :param x: and :return: directives replacing them with the Google-style docstring.

This does not break any of the tests, but I have not implemented a specific test for it, while it works in my case.

Fixes #110

@kernc
Copy link
Member

kernc commented May 13, 2020

Doesn't seem cumbersome a transliteration, given its brevity so far. However, I'd much prefer it with the following points addressed:

  • the whole transliteration a separate procedure in e.g. _ToMarkdown.sphinx_params(),
  • the procedure returning valid, complete markdown, not Google Args: (permitted to call through _ToMarkdown.google() if needed),
  • the implementation based on re.sub() instead of str.replace() (or maybe even docutils 😱),
  • accounting for other Sphinx keywords (param, type, raises, return, rtype),
  • added a unit test.
Copy link
Member

@kernc kernc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't blame you if the above seems like too much work. It'd be a nice addition, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants