Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

MkDocs Plugin: Evaluation Function Documentation Loader

Mkdocs plugin for fetching additional .md files registered in a db before render. Specifically from a web request which returns all the available evaluation functions endpoints.

This plugin was specifially developped for the LambdaFeedback platform.

NOTE: There is currently no safety checking to make sure downloaded markdown files are valid and able to be rendered, they are simply copied over directly from the evaluation function endpoint

Configuration

Enable plugin in the mkdocs.yml file:

plugins:
  - evaldocsloader:
     functions_announce_endpoint: "http://127.0.0.1:5050/testingfunctions"
     api_key: !ENV [API_KEY, "disable"]
     dev_section: ["Developers", "Evaluation Functions"]
     user_section: ["Teachers, "Evaluation Functions"]

functions_announce_endpoint: Endpoint from which a list of evaluation functions be fetched

api_key Key to be passed onto the headers of the request ade to the functions announcing endpoint, used to authenticate the request.

dev_section and user_section: Paths under which the fetched documentation files should be included, for the developer and teacher-facing files respectively. Thes can be arbirarily long. In this example, developer documentation would be appended to content under the "Developers" section in the "Evaluation Functions" subsection.

Behaviour

This plugin hooks into three events:

on_config: After the config is loaded, a list of evaluation functions is fetched the endpoint specified in functions_announce_endpoint. Documentation files are fetched from each of the urls returned, and saved to a temporary directory. Successfully downloaded files are then registered to the nav config, under the sections specified in dev_section and user_section.

on_files: Downloaded files are appended onto the end of the main mkdocs.structure.files.Files object

on_post_build: The created temporary directory is cleaned up

For all events, if a plugin-breaking error occurs, it will be caught and evaluation function documentation fetching is aborted.

Dev Notes

Package can be installed locally using

pip install -e .

I've included a small flask api for testing, it's not relevant to the actual plugin - just for development.

Sources/References

Plugin for loading external markdown files: https://github.com/fire1ce/mkdocs-embed-external-markdown

Template for plugins: https://github.com/byrnereese/mkdocs-plugin-template

File Selection: https://github.com/supcik/mkdocs-select-files

Dealing with new files: https://github.com/oprypin/mkdocs-gen-files/blob/master/mkdocs_gen_files/plugin.py

Metadata

Release files for evaldocsloader 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for evaldocsloader 0.1.6
File Size Uploaded Provenance
evaldocsloader-0.1.6.tar.gz 5.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for evaldocsloader 0.1.6
File Interpreter ABI Platform
evaldocsloader-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 11.5 kB

Release files / evaldocsloader-0.1.6.tar.gz

Download URL evaldocsloader-0.1.6.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a85f8ce3727ebb84c13d9b246365b862d0d8cb51f65f22986d73ecf4b114af0d
BLAKE2b-256 checksum
How to use checksums
8dba47097acfdc96683cf645e2158b7d219725489eb83cfafc1ba5d4245603b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / evaldocsloader-0.1.6-py3-none-any.whl

Download URL evaldocsloader-0.1.6-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
59b745a7af78c5bda0fe1ed70872beb940875bc57a3b9141f86587f71a21d101
BLAKE2b-256 checksum
How to use checksums
0101a60dd2d005b0e3fa280a999a8579a0aa3bc0f89e744c92a79c1b0a2ef1fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Security for evaldocsloader 0.1.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page