Skip to content

Commit 15c7813

Browse files
committed
publish Git rev
1 parent 8892148 commit 15c7813

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

private/publish_gen_index_html.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ function publish_gen_index_html(pkg_name, tagline, outdir)
1313
% "+" avoids picking up cwd of same name
1414
assert(~isempty(pkg), pkg_name + " is not detected as a Matlab directory or package")
1515

16+
%% Git info
17+
repo = gitrepo(pkg.path);
18+
git_txt = "Git branch / commit: " + repo.CurrentBranch.Name + " " + extractBefore(repo.LastCommit.ID, 8);
19+
1620
%% generate docs
1721
readme = fullfile(outdir, "index.html");
1822

@@ -22,7 +26,8 @@ function publish_gen_index_html(pkg_name, tagline, outdir)
2226

2327
txt = ["<!DOCTYPE html> <head> <title>" + pkg_name + " API</title> <body>", ...
2428
"<h1>" + pkg_name + " API</h1>", ...
25-
tagline, ...
29+
"<p>" + tagline + "</p>", ...
30+
"<p>" + git_txt + "</p>", ...
2631
"<h2>API Reference</h2>"];
2732
fid = fopen(readme, 'w');
2833
fprintf(fid, join(txt, "\n"));

0 commit comments

Comments
 (0)