Skip to main content

Flask extension to integrate discourse content generated to docs to your website.

Project description

canonicalwebteam.discourse_docs

Flask extension to integrate discourse content generated to docs to your website.

Install

Install the project with pip: pip install canonicalwebteam.discourse_docs

You can add the extension on your project:

from canonicalwebteam.discourse_docs import DiscourseDocs, DiscourseAPI

app = Flask("myapp")

DISCOURSE_BASE_URL = "https://forum.example.com/"
DOCS_INDEX_TOPIC = 321
DOCS_CATEGORY_ID = 21
DOCS_URL_PREFIX = '/docs'
DOCS_TEMPLATE_PATH = "docs/document.html"

discourse_api = DiscourseAPI(
    base_url=DISCOURSE_BASE_URL
)

discourse_parser = DocParser(
    discourse_api,
    DOCS_CATEGORY_ID,
    discourse_index_id,
    url_prefix
)

DiscourseDocs(
    parser=discourse_parser,
    index_topic_id=DOCS_INDEX_TOPIC,
    document_template=DOCS_TEMPLATE_PATH,  # Optional
    url_prefix=DOCS_URL_PREFIX,  # Optional
).init_app(app)

Once this is added you will need to add the file document.html to your template folder.

Project details


Download files

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

Files for canonicalwebteam.discourse-docs, version 0.11.1
Filename, size File type Python version Upload date Hashes
Filename, size canonicalwebteam.discourse_docs-0.11.1-py3-none-any.whl (18.8 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size canonicalwebteam.discourse_docs-0.11.1.tar.gz (13.2 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page