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/").with_templates()

This will prompt you for your username and password. The call to with_templates() is optional, but it loads the default template.

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)
        with builder.table_builder() as tb:
            tb.add_column("Type", lambda data: data.measurement['measurement_type'])
            tb.add_column("Comment", lambda _: "Look! A 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.

URL-Handler

This program defines a URL-Scheme called qviewkit:

qviewkit://UUID?hint=some;hint

Here, UUID is the measurement you are interested in opening, and after hint a semicolon seperated list of strings describes where it may be located, should it not be in the index. The hint is optional.

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

You will need to have qkit installed to test its integration. This not yet done automatically, as qkit is not yet available on PyPi.

Certificate Issues

You may get an SSL Exception when connecting to your server, mentioning self-signed certificates, even though your server may have valid certificates. This has been reported when using Windows.

The reason behind this is, that python uses the system trust store, which, for example, does not include the T-TeleSec GlobalRoot Class 2 certificate. You may need to install them manually.

To do this, use you browser to download the certificates of your wiki. In Firefox, browse to your wiki, click the lock icon in the nav bar > secure connection > further information. Click View Certificates. Navigate to the left-most certificate. This is your Root-CA. There, go to the link to save the certificate as a PEM-File.

Now, run the following command as an administrator:

certutil –addstore –f "Root" <pathtocertificatefile>

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-1.4.0.tar.gz (1.8 MB view details)

Uploaded Source

Built Distribution

dokuwiki_autodoc-1.4.0-py3-none-any.whl (21.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dokuwiki_autodoc-1.4.0.tar.gz
  • Upload date:
  • Size: 1.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.27.2

File hashes

Hashes for dokuwiki_autodoc-1.4.0.tar.gz
Algorithm Hash digest
SHA256 547a5a6100d8d0cbccebc7ade8dfc0cf07b8b917ff883c792e4f4a03e8ecb55b
MD5 f7f72b5a9b82562ccb79c066c6213067
BLAKE2b-256 db827014d9b279b6dea684573b76f03ca5066d2f0054018729598e3033cf23e9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dokuwiki_autodoc-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5e3c3857f9c54b78255b6c26c0955601e2a22078be7408f2a7a16db9b0be1a29
MD5 ac7bcc2ceb9c1a2521180b10e8f0b2f7
BLAKE2b-256 b552e3d062e026fe27a3d9137cce41c52deed4f6287f655e9ae4f92022dbd2b2

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