Skip to main content

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.

Metadata

Release files for dokuwiki-autodoc 1.6.2

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

Source distribution (sdist)

Source distribution for dokuwiki-autodoc 1.6.2
File Size Uploaded
dokuwiki_autodoc-1.6.2.tar.gz 1.8 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for dokuwiki-autodoc 1.6.2
File Interpreter ABI Platform
dokuwiki_autodoc-1.6.2-py3-none-any.whl Python 3 none any Details

Total release size: 1.8 MB

Release files / dokuwiki_autodoc-1.6.2.tar.gz

Download URL dokuwiki_autodoc-1.6.2.tar.gz
Size 1.8 MB
Tags Source
SHA-256 checksum
How to use checksums
2a372c1eab782047caf64a075eeaa51e900c0c73dc7df2a509cdb1594ced9ca7
BLAKE2b-256 checksum
How to use checksums
2961a8f19382e9cbb6a6d40418835ec5b8d83a4124724fe16d62437080128fc8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.27.2

Release files / dokuwiki_autodoc-1.6.2-py3-none-any.whl

Download URL dokuwiki_autodoc-1.6.2-py3-none-any.whl
Size 20.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
49846ca31d7c569a5ed1dd09b318b159857f6565b59e9a78a54cf537e2671490
BLAKE2b-256 checksum
How to use checksums
5a81f05da1a0070b8e79aa5e8a873d1c99a304c9e51d93372ddb475da55c1be8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.27.2

Release history Release notifications | RSS feed

This release

1.6.2 This release

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.0.8

2 release files

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