Skip to main content

MkDocs plugin to integrate HTML reports into your site.

Project description

MkDocs Iframe Plugin

ci documentation pypi version

MkDocs plugin to integrate HTML reports into your site. This is a modified version of mkdocs-coverage.

Installation

With pip:

pip install mkdocs-iframe

With pipx:

python -m pip install --user pipx
pipx install mkdocs-iframe

Usage

You first need generate your html test reports. For example, using pytest-cov and pytest-html:

pytest --cov --html=htmltest/index.html tests
coverage html

will generate two report directories htmlcov and htmltest.

Now update your MkDocs config:

# mkdocs.yml

nav:
  - Coverage report: cov.md  # Needs to match page from below
  - Test report: test.md  # Needs to match page from below

plugins:
  - iframe:
      reports:
        - name: cov
          path: htmlcov  # default f"html{name}"
          root: index.html  # default
          page: cov.md  # f"{name}.md"
        - name: test
          path: htmltest  # default f"html{name}"
          root: index.html  # default
          page: test.md  # f"{name}.md"

Give the default settings, you could also use the following, simpler config:

# mkdocs.yml

nav:
  - Coverage report: cov.md
  - Test report: test.md

plugins:
  - iframe:
      reports:
        - cov
        - test

Now serve your docs and go to http://localhost:8000/cov/ or http://localhost:8000/test/ to see your test report.

coverage index test index

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

mkdocs_iframe-0.1.0.tar.gz (42.2 kB view hashes)

Uploaded Source

Built Distribution

mkdocs_iframe-0.1.0-py3-none-any.whl (6.1 kB view hashes)

Uploaded Python 3

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