Skip to main content

A small documentation server for PyMiner

Project description

PyMiner Documentation Server

This is a simple documentation server, mainly for PyMiner.

PyMiner文档服务器

这是一个简单的文档服务器,使用传统的后端渲染技术,主要采用了以下框架:

  1. WSGI服务器:waitress
  2. 后端服务器:flask
  3. Markdown:markdown
  4. 样式预处理器:sass

目前非常不完善,只是一个临时的小服务器,欢迎各位一起完善。

接口

目前主要考虑两个接口:

创建服务器:server = Server(base_path)

启动服务器:server.run()

打开特定页面:server.show(path: str)。 这将直接调用webbrowser.open打开一个网页。

这个特定页面的路径应该是基于服务器的根路径base_path的相对路径,例如:

import os

from pyminer_algorithms_document_server.server import Server

if __name__ == '__main__':
    server = Server(os.path.join(os.path.dirname(__file__), 'base'))
    server.run()
    server.show('lib1/func1.md')
    from time import sleep

    sleep(10)

应当注意的是,服务器跑在dameon线程中,当主程序退出时,子线程也会随之退出。

致谢

感谢nwljy提供的初版代码!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page