Skip to main content

Automatically generate documentation in Dokuwiki

Project description

Dokuwiki-AutoDoc

PyPI - Version PyPI - Python Version

Automatically generate documentation of your experiments in DokuWiki! This way, you won't loose track or overview of your progress!

This package uses the DokuWiki python package to automatically access DokuWiki and write reports generated from Liquid templates. Plots generated from your measurements are uploaded as well.

This package is intended to be run in a Jupyter Lab environment and uses interactive prompts to authenticate against the wiki.

Usage

To establish a connection to your wiki, run

doc = AutoDocumentation("https://your.wiki/")

This will prompt you for your username and password.

Next, to generate a report from a measurement in qkit, run the following directly after your measurement:

with QkitDocumentationBuilder(doc, 'sample:yoursample') as builder:
        builder.upload_images()
        builder.generate_report(QKIT_TEMPLATE)
        builder.generate_table_entry(["Type", "Comment"], lambda data: [
            data['measurement']['measurement_type'], 
            input("Comment: ")
        ])

This will

  • Upload the plots generated from your measurement by qkit
  • Build a report from a template
  • Insert a reference to this measurement into an overview table (UUID, Date) with additional columns as defined (Type, Comment).

For safety reasons, the table page is only amended. This means, that only the last table of the page can be extended. Therefore, it may be warranted to include multiple sub-pages on a sample page. This can be done with the Include Plugin.

Templates

Templates for your reports are defined using the Liquid templating language. As DokuWiki uses curly braces for images and square brackets for links, Liquid is configured to use '{[' and ']}' (respectively '{%' '%}') instead. An Example may look like

{% extends "doc_base.txt.liquid" %}
{% block title %} My Title {% endblock %}
{% block content %}
More content
{% endblock%}

which takes data from your qkit measurement and its settings to fill out the page, using the doc_base.txt.liquid template.

Installation

pip install dokuwiki-autodoc

Do note, that this project depends on qkit, but as qkit is not yet on PyPi, you will need to install it manually.

Testing

Run a temporary dokuwiki instance on your local machine at http://localhost. Change the password and username in the mocked sys.stdin.

In order to test qkit interoperability, you will need to change the SAMPLE to one in your data directory.

License

dokuwiki-autodoc is distributed under the terms of the GPLv2 license.

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

dokuwiki_autodoc-0.0.8.tar.gz (770.0 kB view details)

Uploaded Source

Built Distribution

dokuwiki_autodoc-0.0.8-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file dokuwiki_autodoc-0.0.8.tar.gz.

File metadata

  • Download URL: dokuwiki_autodoc-0.0.8.tar.gz
  • Upload date:
  • Size: 770.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for dokuwiki_autodoc-0.0.8.tar.gz
Algorithm Hash digest
SHA256 b3b71bee367ad7457b0d7d79d674210570d07b942a6ca6f09ddb317b2cf8b1a9
MD5 b8560ebb852847484062613a2e614da8
BLAKE2b-256 2fb28ce21ec8147f61d69b83141caef369141b44560c2ebb1b19dc33ebb13f8a

See more details on using hashes here.

File details

Details for the file dokuwiki_autodoc-0.0.8-py3-none-any.whl.

File metadata

File hashes

Hashes for dokuwiki_autodoc-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 98fc1cc0db11a03939d657318dcbfddc6429810bf830664c4df54626ec9f68db
MD5 4a0761d8a873fb5d239491f9fecd10dd
BLAKE2b-256 e13af39ff6a9e99a77a8d1b1d19b9a120fe4f346e23c6de0785cde60810700b2

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