Sampled Instrument Player with static and monolithic design. All instruments are built-in.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

156 lines
5.3 KiB

#! /usr/bin/env python3
# -*- coding: utf-8 -*-
This documentation is licensed under Creative Commons-BY-SA-4.0.
Please read the provided documentation/LICENSE file or visit
The documentation is built statically and does not belong to the normal build process with configure and make
Its updating is part of the development process, not packaging and running.
The correct out/ dir is already part of git.
.adoc is asciidoctor, not simple asciidoc.
#We still split between template and non-template, eventhough this is not the case in Agordejo.
#However, this enables an easier diff across projects to keep track of changes that we need to do manually here
#TODO: Unify in the future by creating calfbox and NSM client as documentation "modules"
#Make the readme
import sys
from config import METADATA
import subprocess
from os import getcwd
import os.path
assert os.path.exists(os.path.join(getcwd(), __file__)), (getcwd(), __file__)
import datetime
import base64
with open("readme.template", "r") as r:
template_readme =
template_readme = template_readme.replace("<date>",
template_readme = template_readme.replace("<name>", METADATA["name"])
template_readme = template_readme.replace("<version>", METADATA["version"])
template_readme = template_readme.replace("<shortname>", METADATA["shortName"])
template_readme = template_readme.replace("<description>", METADATA["description"])
template_readme = template_readme.replace("<author>", METADATA["author"])
with open ("../../", "w") as w:
print ("Built /")
#Documentation index
with open("index.adoc.template", "r") as r:
template_index =
template_index = template_index.replace("<name>", METADATA["name"])
template_index = template_index.replace("<shortname>", METADATA["shortName"])
template_index = template_index.replace("<version>", METADATA["version"])
template_index = template_index.replace("<author>", METADATA["author"])
with open ("../../documentation/index.adoc", "w") as w:
#print ("Built /documentation/index.adoc. You still need to run /documentation/ manually")
#print ("Built /documentation/index.adoc")
for language in METADATA["supportedLanguages"].keys():
language = language.lower()
with open(f"{language}.adoc.template", "r") as r:
template =
continue #language not yet supported as manual
for key, value in METADATA.items(): #all strings
if type(value) is str:
template = template.replace(f"<{key}>", value)
if language == "english":
template = template.replace("<english-only-description>", "== Introduction\n\n" + METADATA["description"])
with open (f"../../documentation/{language}.part.adoc", "r") as clientPart:
template = template.replace("<manual>",
with open (f"../../documentation/{language}.adoc", "w") as w:
#Create manpage
#Needs help2man
manpage_template = f"""
{METADATA["name"]} - {METADATA["tagline"]}
[Reporting bugs]
{METADATA["name"]} {METADATA["version"]} - Copyright {METADATA["year"]}
Start {METADATA["shortName"]} through NSM, e.g. through Agordejo. This will take care of all
settings and save directories.
Other modes of operations, mostly for testing, are:
Run without session management and save in /tmp.
{METADATA["shortName"]} --save /tmp
Run without audio and midi. Skips all JACK checks. Used to just look at the GUI, e.g. to make screenshots
{METADATA["shortName"]} --mute
[see also]
The full documentation for {METADATA["name"]} is maintained as a multi-lingual html site to your systems doc-dir.
For example:
xdg-open file:///usr/share/doc/{METADATA["shortName"]}/index.html
The documentation can also be found online{METADATA["shortName"]}
with open ("../../documentation/manpageinclude.h2m", "w") as w:
command = f"help2man ../../{METADATA['shortName']} --no-info --include ../../documentation/manpageinclude.h2m > ../../documentation/{METADATA['shortName']}.1", capture_output=True, text=True, shell=True)
#Convert 32x32 and 128x128 icons to base64 utf8 strings for jack metadata
txt_icon_32_base64_utf8 = os.path.join("../../engine/resources/", "icon_32_base64_utf8.txt")
with open (txt_icon_32_base64_utf8, "w") as icon32txt:
with open("../../desktop/images/32x32.png", "rb") as icon32png:
txt_icon_128_base64_utf8 = os.path.join("../../engine/resources/", "icon_128_base64_utf8.txt")
with open (txt_icon_128_base64_utf8, "w") as icon128txt:
with open("../../desktop/images/128x128.png", "rb") as icon128png:
#Done. Tell the world:
#print ("Built /documentation. You still need to run /documentation/ manually")
print ("Built template part of documentation.")