运行Web应用程序的Flask中的Sphinx文档 [英] Sphinx documentation inside a Flask running web application

查看:217
本文介绍了运行Web应用程序的Flask中的Sphinx文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在本地构建了静态Sphinx文档(使用 make html )。



我现在希望将Sphinx文件集成到我的webapp中,并且使用Flask运行。从Flask正在运行的应用程序中,我只是想包含一个指向Sphinx文档的超链接,它将作为应用程序的帮助文件。

/sphinx-doc.org/web/quickstart.htmlrel =noreferrer> Websupport 似乎是遵循的方式,但我不清楚应该如何将Flask框架与Sphinx文件连接起来。 p>

感谢您的帮助,

问候

解决方案

您可以使用Web服务器处理它,就像处理Flask中的 / static 目录一样。例如,如果您使用Apache作为生产Web服务器,则可以添加

  Alias / documentation / location / of / sphinx / html 
< Directory / location / of / sphinx / html>
顺序拒绝,允许
允许所有
< / Directory>

到您的Apache站点配置,那么您可以直接链接到 http ://yoursite.com/documentation 来访问Sphinx文件,完全避免使用Flask。


I've locally built static Sphinx documentations (using make html).

I wish now to integrate the Sphinx files into my webapp that runs with Flask. From the Flask running application, I simply mean to include an hyperlink towards the Sphinx documentation, that will serve as help for the application.

Websupport seems the way to follow, but it's not clear to me how I should bridge the Flask framework to the Sphinx files.

Thanks for any help,

Regards

解决方案

You could just handle it with your web server, the same way you handle the /static directory in Flask. For example if you used Apache as your production web server, you might add

Alias /documentation /location/of/sphinx/html
<Directory /location/of/sphinx/html>
    Order deny,allow
    Allow from all
</Directory>

to your Apache site configuration, so then you could just link directly to http://yoursite.com/documentation to access the Sphinx files, avoiding Flask altogether.

这篇关于运行Web应用程序的Flask中的Sphinx文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆