From b995899da366828f5f7bd7935422b3068c635b40 Mon Sep 17 00:00:00 2001 From: Ken Deeley Date: Tue, 27 Oct 2026 16:51:14 +0000 Subject: [PATCH 1/4] Normalize empty tokens: "" becomes missing --- tbx/docmaker/+docmaker/GitHub.m | 4 ++-- tbx/docmaker/+docmaker/GitLab.m | 2 +- tbx/docmaker/+docmaker/MarkdownConverter.m | 19 ++++++++++++++++++- tbx/docmaker/+docmaker/converter.m | 6 +++--- 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/tbx/docmaker/+docmaker/GitHub.m b/tbx/docmaker/+docmaker/GitHub.m index 870b1c9..e7683fb 100644 --- a/tbx/docmaker/+docmaker/GitHub.m +++ b/tbx/docmaker/+docmaker/GitHub.m @@ -32,7 +32,7 @@ end obj.Hostname = hostname; - obj.Token_ = token; + obj.Token_ = docmaker.MarkdownConverter.normalizeToken( token ); end % constructor @@ -95,4 +95,4 @@ end % methods -end % classdef \ No newline at end of file +end % classdef diff --git a/tbx/docmaker/+docmaker/GitLab.m b/tbx/docmaker/+docmaker/GitLab.m index c28fd82..6b83669 100644 --- a/tbx/docmaker/+docmaker/GitLab.m +++ b/tbx/docmaker/+docmaker/GitLab.m @@ -32,7 +32,7 @@ end obj.Hostname = hostname; - obj.Token_ = token; + obj.Token_ = docmaker.MarkdownConverter.normalizeToken( token ); end % constructor diff --git a/tbx/docmaker/+docmaker/MarkdownConverter.m b/tbx/docmaker/+docmaker/MarkdownConverter.m index ef2a473..ddfa0d3 100644 --- a/tbx/docmaker/+docmaker/MarkdownConverter.m +++ b/tbx/docmaker/+docmaker/MarkdownConverter.m @@ -10,4 +10,21 @@ xml = md2xml( md ) end -end % classdef \ No newline at end of file + methods ( Static, Access = protected ) + + function token = normalizeToken( token ) + %normalizeToken Normalize an access token + + arguments + token(1, 1) string + end + + if ~ismissing( token ) && strlength( token ) == 0 + token = missing; + end + + end % normalizeToken + + end % methods ( Access = protected ) + +end % classdef diff --git a/tbx/docmaker/+docmaker/converter.m b/tbx/docmaker/+docmaker/converter.m index 36b35cb..424cd86 100644 --- a/tbx/docmaker/+docmaker/converter.m +++ b/tbx/docmaker/+docmaker/converter.m @@ -18,11 +18,11 @@ switch lower( n ) case "github" h = getValue( "GitHub hostname", "api.github.com" ); - t = getValue( "GitHub token", "" ); + t = getValue( "GitHub token", missing ); c = docmaker.GitHub( h, t ); case "gitlab" h = getValue( "GitLab hostname", "www.gitlab.com" ); - t = getValue( "GitLab token", "" ); + t = getValue( "GitLab token", missing ); c = docmaker.GitLab( h, t ); otherwise error( "docmaker:Unhandled", "Unknown converter ""%s"".", n ) @@ -74,4 +74,4 @@ tf = HAS_SECRETS; % retrieve end -end % hasSecrets \ No newline at end of file +end % hasSecrets From 58891b6a4a2e316c4fc1858dc0bde2495c699d12 Mon Sep 17 00:00:00 2001 From: Ken Deeley Date: Tue, 27 Oct 2026 16:52:22 +0000 Subject: [PATCH 2/4] Added test for empty token normalization --- tests/+docmaker/tconverter.m | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests/+docmaker/tconverter.m diff --git a/tests/+docmaker/tconverter.m b/tests/+docmaker/tconverter.m new file mode 100644 index 0000000..7f98b54 --- /dev/null +++ b/tests/+docmaker/tconverter.m @@ -0,0 +1,28 @@ +classdef tconverter < matlab.unittest.TestCase + %TCONVERTER Tests for DocMaker converter configuration. + + methods ( Test ) + + function tEmptyGitHubTokenIsMissing( testCase ) + + converter = docmaker.GitHub( "api.github.com", "" ); + + testCase.verifyClass( converter, "docmaker.GitHub" ) + testCase.verifyTrue( ismissing( converter.Token ), ... + "An empty GitHub token should not authenticate requests." ) + + end % tEmptyGitHubTokenIsMissing + + function tEmptyGitLabTokenIsMissing( testCase ) + + converter = docmaker.GitLab( "gitlab.com", "" ); + + testCase.verifyClass( converter, "docmaker.GitLab" ) + testCase.verifyTrue( ismissing( converter.Token ), ... + "An empty GitLab token should not authenticate requests." ) + + end % tEmptyGitLabTokenIsMissing + + end % methods ( Test ) + +end % classdef From 1cb7f30d0a67444be7bab628f321b2ca7861799c Mon Sep 17 00:00:00 2001 From: Ken Deeley Date: Tue, 27 Oct 2026 16:54:12 +0000 Subject: [PATCH 3/4] Added Name field to metadata --- docmaker.json | 1 + 1 file changed, 1 insertion(+) diff --git a/docmaker.json b/docmaker.json index a40dc0a..0979880 100644 --- a/docmaker.json +++ b/docmaker.json @@ -1,4 +1,5 @@ { + "Name":"MATLAB_DocMaker", "Identifier":"ae82d5d2-45be-4fc5-a01b-70d8bb905ca2", "Summary":"Create MATLAB toolbox documentation from Markdown documents and MATLAB scripts", "Description":"With DocMaker, you can:\n* write documentation in Markdown and convert to HTML for viewing in MATLAB\n* run MATLAB scripts and capture output as images for inclusion in documentation\n* create MATLAB documentation index files from a Markdown table of contents", From 01bb93e7f206c9518035016fc84f2e55a0fbe12b Mon Sep 17 00:00:00 2001 From: Ken Deeley Date: Tue, 27 Oct 2026 17:01:57 +0000 Subject: [PATCH 4/4] Add PackageName to package task --- buildfile.m | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/buildfile.m b/buildfile.m index 40119a6..19d9c93 100644 --- a/buildfile.m +++ b/buildfile.m @@ -83,6 +83,11 @@ function packageTask( ~ ) s.ToolboxName = v.Name; s.ToolboxVersion = v.Version; +% Specify the package name from R2026b +if ~isMATLABReleaseOlderThan( "R2026b" ) + s.PackageName = s.Name; +end % if + if getenv( "GITHUB_ACTIONS" ) == "true" % Check version and tag compatibility for release ref = string( getenv( "GITHUB_REF" ) );