Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle multiple C{type} in an epytext docstring #7

Open
AWhetter opened this issue Jul 8, 2020 · 8 comments
Open

Handle multiple C{type} in an epytext docstring #7

AWhetter opened this issue Jul 8, 2020 · 8 comments
Labels
enhancement New feature or request

Comments

@AWhetter
Copy link
Collaborator

AWhetter commented Jul 8, 2020

Reading the following docstring

"""
Blah

:Parameters:
    arg1 :C{string} or C{int}
        Does something
"""

results in the following Google docstring

"""Blah

Args:
    arg1 (string} or C{int): Does something
"""

It looks like something is greedily looking for C{} but it needs to be more conservative.

@AWhetter AWhetter added the bug Something isn't working label Jul 8, 2020
@cbillingham
Copy link
Owner

Damn, I didn't even know this was a thing we supported. I thought we only stripped backticks ` I'll do some digging.

@AWhetter
Copy link
Collaborator Author

Maybe we don't and it's a fluke that it works this way. I'm pretty sure it's made up syntax. I've never been able to find anything else using it.
I remember us talking about implementing support for it but I don't remember deciding one way or the other. I'd be happy saying we don't support it, but then it feels like we should be keeping the outer C{ and } instead of stripping it?

@cbillingham
Copy link
Owner

cbillingham commented Jul 15, 2020

Hmmm I'm actually not able to reproduce this.

Here's what I get when I tested. It reads as the RestParser and writing with GoogleWriter produces:

"""Blah

Args:
    arg1 (C{string} or C{int}): Does something
"""

I wonder if your version is custom and has this added as an additional feature? I vaguely remember maybe you or Andy adding this in? I wonder if we decided to not include that in the open source release?

@AWhetter
Copy link
Collaborator Author

I can't reproduce either, even on the original docstring that I saw the issue on... So I'm happy to close this

I did however find that the C{type} syntax comes from epytext (http://epydoc.sourceforge.net/manual-epytext.html#basic-inline-markup).

@cbillingham
Copy link
Owner

Huh funky. I'm cool to support converting that syntax as a feature request if you think its useful.

@AWhetter
Copy link
Collaborator Author

It's part of epytext and it's used a lot in our codebases. It would be useful for docconvert to support their conversion.

@AWhetter AWhetter reopened this Jul 23, 2020
@AWhetter AWhetter added enhancement New feature or request and removed bug Something isn't working labels Jul 23, 2020
@AWhetter
Copy link
Collaborator Author

I've reopened this is as the feature request to convert I{text} to *text*, B{text} to **text**, C{type} to ``type``, and M{text} to :math:`text` .
We could also consider stripping C{} totally in type fields.

@cbillingham
Copy link
Owner

Probably way way too late for you to benefit from this, but finally added support for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants