formelsammlung.flask_sphinx_docs module

class formelsammlung.flask_sphinx_docs.SphinxDocServer(app=None, **kwargs)[source]

Bases: object

Serve your sphinx docs under /docs/ on your own flask app.

You can invoke it in your app factory:

sds = SphinxDocServer()

def create_app():
    app = Flask(__name__)
    sds.init_app(app)
    return app

or you can include the plugin directly without setting a doc_dir:

app = Flask(__name__)
SphinxDocServer(app)

or with setting a doc_dir:

app = Flask(__name__)
SphinxDocServer(app, doc_dir="../../docs/build/html")
init_app(app, doc_dir=None, index_file='index.html')[source]

Add the /docs/ route to the app object.

Parameters
  • app (Flask) – Flask object to add the route to.

  • doc_dir (Optional[str]) – The base directory holding the sphinx docs to serve. If not set the doc_dir is guessed up to 3 directories above.

  • index_file (str) – The html file containing the base toctree. Default: “index.html”

Return type

None