Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
add docs version and update prompt version
- Loading branch information
|
|
@@ -79,4 +79,4 @@ include $(MAKEFILE_PATH) |
|
|
|
|
|
# Add the git commit id to a file for use when printing out the version |
|
|
../module/gitversion.c: ../.git/HEAD ../.git/index |
|
|
echo "const char *git_version = \"$(shell git describe --always --dirty | tr '[a-z]' '[A-Z]')\";" > $@ |
|
|
echo "const char *git_version = \"$(shell cut -d '-' -f 1 <<< $(shell git describe --tags)) $(shell git describe --always --dirty | tr '[a-z]' '[A-Z]')\";" > $@ |
|
|
@@ -189,7 +189,7 @@ bool screen_refresh_live() { |
|
|
output.has_value = false; |
|
|
} |
|
|
else if (show_welcome_message) { |
|
|
strcpy(s, TELETYPE_VERSION ": "); |
|
|
strcpy(s, "Teletype "); |
|
|
strcat(s, git_version); |
|
|
show_welcome_message = false; |
|
|
} |
|
|
|
|
|
@@ -6,6 +6,7 @@ |
|
|
import jinja2 |
|
|
import pypandoc |
|
|
import pytoml as toml |
|
|
import subprocess |
|
|
|
|
|
from common import list_ops, list_mods |
|
|
|
|
|
@@ -18,6 +19,7 @@ |
|
|
DOCS_DIR = ROOT_DIR / "docs" |
|
|
OP_DOCS_DIR = DOCS_DIR / "ops" |
|
|
FONTS_DIR = ROOT_DIR / "utils" / "fonts" |
|
|
VERSION_STR = subprocess.check_output(['git', 'describe', '--tags']).decode("utf-8").split('-')[0] + ' ' + subprocess.check_output(['git', 'describe', '--always', '--dirty']).decode("utf-8")[:-1].upper() |
|
|
|
|
|
env = jinja2.Environment( |
|
|
autoescape=False, |
|
|
@@ -163,6 +165,7 @@ def main(): |
|
|
if ext == ".md": |
|
|
p.write_text(output) |
|
|
elif ext == ".html": |
|
|
output = "# Teletype " + VERSION_STR + " Documentation\n\n" + output |
|
|
pypandoc.convert_text( |
|
|
output, |
|
|
format=input_format, |
|
|
@@ -175,8 +178,9 @@ def main(): |
|
|
"--css=" + str(TEMPLATE_DIR / "docs.css"), |
|
|
"--template=" + str(TEMPLATE_DIR / "template.html5")]) |
|
|
elif ext == ".pdf" or ext == ".tex": |
|
|
preamble_title = "Teletype " + VERSION_STR + " Documentation" |
|
|
latex_preamble = env.get_template("latex_preamble.jinja2.md") |
|
|
latex = latex_preamble.render(fonts_dir=FONTS_DIR) + "\n\n" |
|
|
latex = latex_preamble.render(title=preamble_title, fonts_dir=FONTS_DIR) + "\n\n" |
|
|
latex += output |
|
|
pypandoc.convert_text( |
|
|
latex, |
|
|
|
|
|
@@ -1,5 +1,5 @@ |
|
|
--- |
|
|
title: Teletype Documentation |
|
|
title: {{title}} |
|
|
documentclass: report |
|
|
geometry: margin=1in |
|
|
links-as-notes: true |
|
|
|