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 # Optionnal in case need to limit to a category
DOCS_URL_PREFIX = '/docs'
DOCS_TEMPLATE_PATH = "docs/document.html"

discourse_api = DiscourseAPI(
    base_url=DISCOURSE_BASE_URL
)

discourse_parser = DocParser(
    api=discourse_api,
    category_id=DOCS_CATEGORY_ID,
    index_topic_id=DOCS_INDEX_TOPIC,
    url_prefix=DOCS_URL_PREFIX,
)

discourse_docs = DiscourseDocs(
    parser=discourse_parser,
    document_template=DOCS_TEMPLATE_PATH,  # Optional
    url_prefix=DOCS_URL_PREFIX,  # Optional
    blueprint_name=discourse_docs, # Optional
)

discourse_docs.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.

Source Distribution

canonicalwebteam.discourse_docs-0.12.0.tar.gz (13.0 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file canonicalwebteam.discourse_docs-0.12.0.tar.gz.

File metadata

  • Download URL: canonicalwebteam.discourse_docs-0.12.0.tar.gz
  • Upload date:
  • Size: 13.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.3.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

File hashes

Hashes for canonicalwebteam.discourse_docs-0.12.0.tar.gz
Algorithm Hash digest
SHA256 2f897e8ad5d012d39f33e08c3944e02c18c3814ab296dd95ff6c00c2454029ad
MD5 eddd6fb4ad0a38d7b40e992f48305203
BLAKE2b-256 fc0d4937446b2e826340a1cb3fa19cd8ff7f8229fcf9239eb1da300f37a18891

See more details on using hashes here.

File details

Details for the file canonicalwebteam.discourse_docs-0.12.0-py3-none-any.whl.

File metadata

  • Download URL: canonicalwebteam.discourse_docs-0.12.0-py3-none-any.whl
  • Upload date:
  • Size: 19.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.3.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

File hashes

Hashes for canonicalwebteam.discourse_docs-0.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d18061bd920426b160a788ee2be30031222513ab2b9bfe1ca7cbf146c12884f8
MD5 52ebce13bc1b34b26b82b13d023935b3
BLAKE2b-256 969b7f7078f3116da232901f9bcf32347a070536fa428354dfbab89435fdf46b

See more details on using hashes here.

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