#!/usr/bin/env python3 """build.py -- the starshipos-f18.com XWiki pages, made from the "StarshipOS.com" design canvas. site/com/build.py canvas/{Main,Inquiries,TryIt}.dc.html -> {Main,Inquiries,TryIt}.WebHome.xwiki The canvas is the source: its artboards are copied into canvas/ as they are, and this turns each into one {{html}} block (which needs a page author with script rights). What changes on the way: - the accent hole becomes its default colour, and the canvas's links become the wiki's pages (Main.dc.html -> /bin/view/Main/, ...) and the real domains (starshipos.org -> starshipos-f18.org); - the two images become attachments of Main.WebHome (badge.jpg, captain-bob.jpg -- web-size copies of the canvas's uploads); - Try it: the drawn console becomes the real one, an iframe of try.starshipos-f18.com; - the inquiry form posts to the .org's PublicInquiry, which files it under Inquiries there (admin-only, site/org/inquiries); the announcements form, which has no server, sends by e-mail; install.sh puts the pages and the images on the wiki. """ import os import re import sys sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")) import colorlock # noqa: E402 the design's colours over the wiki's high-contrast theme ACCENT = "#F5891F" FONTS = ('\n' '') ORG = "https://starshipos-f18.org/" PAGES = ["Main", "Inquiries", "TryIt"] IMAGES = {"/_blob/5b564d54d98e02ad600c913a9a1888f2": "badge.jpg", "/_blob/5483451f292782a8b366e437181c4bcf": "captain-bob.jpg"} CONSOLE = '''
If the console does not connect, every machine is in use: try again in a few minutes.
''' def body(src): m = re.search(r"