jwg4 / flask-selfdoc

Flask-selfdoc automatically creates an online documentation for your flask application.
MIT License
18 stars 4 forks source link

enable format doc #58

Open sergiokessler opened 2 years ago

sergiokessler commented 2 years ago

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

"""
Point your browser to {}
""".format(host_url)
jwg4 commented 2 years ago

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

sergiokessler commented 2 years ago

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 commented 2 years ago

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.