Package: dokuwiki-autodoc
Dokuwiki-AutoDocAutomatically generate documentation of your experiments in DokuWiki! This way, you won't loose track or overview of your progress!This package uses theDokuWikipython package to automatically access DokuWiki and write reports generated fromLiquidtemplates. Plots generated from your measurements are uploaded as well.This package is intended to be run in aJupyter Labenvironment and uses interactive prompts to authenticate against the wiki.UsageTo establish a connection to your wiki, rundoc=AutoDocumentation("https://your.wiki/").with_templates()This will prompt you for your username and password. The call towith_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:withQkitDocumentationBuilder(doc,'sample:yoursample')asbuilder:builder.upload_images()builder.generate_report(QKIT_TEMPLATE)withbuilder.table_builder()astb:tb.add_column("Type",lambdadata:data.measurement['measurement_type'])tb.add_column("Comment",lambda_:"Look! A comment!")This willUpload the plots generated from your measurement by qkitBuild a report from a templateInsert 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 theInclude Plugin.TemplatesTemplates 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 yourqkitmeasurement and its settings to fill out the page, using thedoc_base.txt.liquidtemplate.URL-HandlerThis program defines a URL-Scheme calledqviewkit:qviewkit://UUID?hint=some;hintHere,UUIDis the measurement you are interested in opening, and afterhinta semicolon seperated list of strings
describes where it may be located, should it not be in the index. The hint is optional.Installationpip install dokuwiki-autodocDo note, that this project depends on qkit, but as qkit is not yet on PyPi, you will need to install it manually.TestingYou will need to have qkit installed to test its integration. This not yet done automatically, as qkit is not yet available on PyPi.Certificate IssuesYou 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 theT-TeleSec GlobalRoot Class 2certificate. 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. ClickView 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>Licensedokuwiki-autodocis distributed under the terms of theGPLv2license.