diff --git a/slides/markmaker.py b/slides/markmaker.py index e529d198..a98b21f0 100755 --- a/slides/markmaker.py +++ b/slides/markmaker.py @@ -74,6 +74,13 @@ def generatefromyaml(manifest, filename): logging.warning("'exclude' is empty.") exclude = ",".join('"{}"'.format(c) for c in exclude) + # Insert build info. This is super hackish. + + markdown = markdown.replace( + ".debug[", + ".debug[{}\n\nThese sides have been built from commit: {}\n\n".format(dirtyfiles, commit), + 1) + html = open("workshop.html").read() html = html.replace("@@MARKDOWN@@", markdown) html = html.replace("@@EXCLUDE@@", exclude) @@ -146,8 +153,7 @@ try: if "BRANCH" in os.environ: branch = os.environ["BRANCH"] else: - branch = subprocess.check_output(["git", "status", "--short", "--branch"]) - branch = branch[3:].split("...")[0] + branch = subprocess.check_output(["git", "rev-parse", "--abbrev-ref", "HEAD"]) base = subprocess.check_output(["git", "rev-parse", "--show-prefix"]) base = base.strip().strip("/") urltemplate = ("{repo}/tree/{branch}/{base}/{filename}" @@ -155,6 +161,16 @@ try: except: logging.exception("Could not generate repository URL; generating local URLs instead.") urltemplate = "file://{pwd}/{filename}".format(pwd=os.environ["PWD"], filename="{}") +try: + commit = subprocess.check_output(["git", "rev-parse", "--short", "HEAD"]) +except: + logging.exception("Could not figure out HEAD commit.") + commit = "??????" +try: + dirtyfiles = subprocess.check_output(["git", "status", "--porcelain"]) +except: + logging.exception("Could not figure out repository cleanliness.") + dirtyfiles = "?? git status --porcelain failed" def makelink(filename): if os.path.isfile(filename): diff --git a/slides/workshop.css b/slides/workshop.css index 6a4edbbb..05da7720 100644 --- a/slides/workshop.css +++ b/slides/workshop.css @@ -34,12 +34,19 @@ div.remark-slide-number { bottom: 0px; font-family: monospace; color: white; + background-color: black; + opacity: 0; } .debug a { color: white; } .debug:hover { - background-color: black; + opacity: 1; +} +div.debug { + vertical-align: initial; + text-align: initial; + font-size: initial; } body { font-family: 'Droid Serif'; }