Skip to content

use pre tag for docstring - #114

Closed
TennyZhuang wants to merge 1 commit into
mitmproxy:masterfrom
TennyZhuang:master
Closed

TennyZhuang wants to merge 1 commit into
mitmproxy:masterfrom
TennyZhuang:master

Conversation

@TennyZhuang

Copy link
Copy Markdown

The docstring of python is formatted, convert it to HTML directly will lose the format information.

It's more reasonable to use a <pre> tag

@BurntSushi

Copy link
Copy Markdown
Contributor

Could you please show before/after screenshots/demos of this change?

@TennyZhuang

Copy link
Copy Markdown
Author

before
3ba71638-f474-44a2-b09c-881c2fa13b70

after
84137a4a-5d3f-494f-84dc-a231578efc64

@TennyZhuang

Copy link
Copy Markdown
Author

source code

@api_blueprint.route('/accept', methods=['POST'])
@auth.login_required
def accept():
    """
    :route: /api/accept
    :method: POST
    :data id: id of message
    :return:
     {
        "message": "Success"
     }
    """
    pass

@peterjc

peterjc commented Sep 7, 2017

Copy link
Copy Markdown

What markup language are you using in your docstring? Currently pdoc only supports markdown, and it does not look like markdown to me - it looks more like reStrcuturedText (RST), but not quite.

@cortesi

cortesi commented Jun 3, 2018

Copy link
Copy Markdown
Member

Hi there! This PR conflicts with master. I'll close this for now as part of our general cleanup. Please feel free to rebase this and to resubmit. Pdoc now has a new dev team, and we'll make sure your PR is actioned promptly.

I can see the problem that you're trying to address here. We've had other PRs for light-weight doc format variations like Google style, and this might be another one of those. I don't think unilaterally pre-formatting everything that contains newlines is the right approach, though.

@cortesi cortesi closed this Jun 3, 2018
@cortesi cortesi mentioned this pull request Jun 3, 2018
@cortesi

cortesi commented Jun 3, 2018

Copy link
Copy Markdown
Member

Please see #153 for a unified discussion ticket about docstring flavors.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants