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

enable format doc #58

Open
sergiokessler opened this issue Oct 26, 2021 · 3 comments
Open

enable format doc #58

sergiokessler opened this issue Oct 26, 2021 · 3 comments
Milestone

Comments

@sergiokessler
Copy link

it would be nice if selfdoc was able to support formatted doc, ala:

"""
Point your browser to {}
""".format(host_url)
@jwg4
Copy link
Owner

jwg4 commented Nov 1, 2021

I'm not sure exactly what set of variables would be able to be expanded in the formatting?

@sergiokessler
Copy link
Author

What I'm looking is to include the actual {request.host_url} variable in the doc (for the examples included)

something like:

@app.route('/ping', methods=['GET'])
@auto.doc()
def ping():
    """PING all day long!

    example: curl {}/ping
    """.format(request.host_url)

    response = {
        'data': [{
            'echo': 'ping!',
            'source': url_for('ping')
        }]
    }
    return jsonify(response)

@jwg4
Copy link
Owner

jwg4 commented Nov 2, 2021

This sounds do-able but I don't know how to do it yet!

I will look into this and try to add this functionality in a future version.

@jwg4 jwg4 modified the milestones: 2.0, 1.4 Nov 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants