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 either include the plugin directly:

app = Flask(__name__)
SphinxDocServer(app, doc_dir="../../docs/build/html")

or you can invoke it in your app factory:

sds = SphinxDocServer()

def create_app():
    app = Flask(__name__)
    sds.init_app(app, doc_dir="../../docs/build/html"))
    return app
static init_app(app, doc_dir, 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 (str) – The base directory holding the sphinx docs to serve.

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

Return type

None