From 15c7813b3c24ae76a064552fe5620f7796ad96b5 Mon Sep 17 00:00:00 2001 From: scivision Date: Tue, 19 Nov 2024 14:20:09 -0500 Subject: [PATCH] publish Git rev --- private/publish_gen_index_html.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/private/publish_gen_index_html.m b/private/publish_gen_index_html.m index bd2da60..d46f958 100644 --- a/private/publish_gen_index_html.m +++ b/private/publish_gen_index_html.m @@ -13,6 +13,10 @@ function publish_gen_index_html(pkg_name, tagline, outdir) % "+" avoids picking up cwd of same name assert(~isempty(pkg), pkg_name + " is not detected as a Matlab directory or package") +%% Git info +repo = gitrepo(pkg.path); +git_txt = "Git branch / commit: " + repo.CurrentBranch.Name + " " + extractBefore(repo.LastCommit.ID, 8); + %% generate docs readme = fullfile(outdir, "index.html"); @@ -22,7 +26,8 @@ function publish_gen_index_html(pkg_name, tagline, outdir) txt = [" " + pkg_name + " API ", ... "

" + pkg_name + " API

", ... - tagline, ... + "

" + tagline + "

", ... + "

" + git_txt + "

", ... "

API Reference

"]; fid = fopen(readme, 'w'); fprintf(fid, join(txt, "\n"));