Skip to main content

Mkdocs plugin for fetching additional .md files based on a fetched list, specifically designed to work with the LambdaFeedback architecture.

Project description

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

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

evaldocsloader-0.1.6.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

evaldocsloader-0.1.6-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file evaldocsloader-0.1.6.tar.gz.

File metadata

  • Download URL: evaldocsloader-0.1.6.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for evaldocsloader-0.1.6.tar.gz
Algorithm Hash digest
SHA256 a85f8ce3727ebb84c13d9b246365b862d0d8cb51f65f22986d73ecf4b114af0d
MD5 804fe629fc392459cbd613a51c2bd436
BLAKE2b-256 8dba47097acfdc96683cf645e2158b7d219725489eb83cfafc1ba5d4245603b5

See more details on using hashes here.

File details

Details for the file evaldocsloader-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: evaldocsloader-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for evaldocsloader-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 59b745a7af78c5bda0fe1ed70872beb940875bc57a3b9141f86587f71a21d101
MD5 a1c5e4c12f444b22677793380ec2f966
BLAKE2b-256 0101a60dd2d005b0e3fa280a999a8579a0aa3bc0f89e744c92a79c1b0a2ef1fc

See more details on using hashes here.

Supported by

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