Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
ab85624
Added LaTeX support via MathJax
k-deeley May 28, 2026
2f5442d
Added 26a to CI
k-deeley May 28, 2026
67cc506
Added GitLab support
k-deeley May 29, 2026
7c5f934
Updated test
k-deeley May 29, 2026
c4744b8
Updated help
k-deeley May 29, 2026
53e0873
Task infrastructure
k-deeley May 29, 2026
c61ad2f
Renamed JS file
k-deeley May 29, 2026
638a4ff
Updated custom task
k-deeley May 29, 2026
9b5e249
Removed \[, \] and \(, \) from MathJax configuration
k-deeley Jun 2, 2026
a9dc745
Added Interpreter option to docconvert
k-deeley Jun 2, 2026
2a667cf
Added rights
k-deeley Jun 2, 2026
ee30895
Added Interpreter option to DocMakerTask
k-deeley Jun 2, 2026
d8b80bf
Removed MathRenderer option
k-deeley Jun 9, 2026
b2d54d2
Merge branch '23-create-a-custom-buidltool-task-that-can-be-used-out-…
k-deeley Jun 9, 2026
230bdfe
Refactored task
k-deeley Jun 9, 2026
8cd5f1e
Added tests and doc for DocMakerTask
k-deeley Jun 9, 2026
cae7d29
Filter for new build task tests
k-deeley Jun 9, 2026
fd628c1
Swapped JS script order to fix inline rendering
k-deeley Jun 9, 2026
51c0b23
String/char compatibility
k-deeley Jun 9, 2026
f0814cf
Debug
k-deeley Jun 9, 2026
cc292a2
Filtering teardown in CI
k-deeley Jun 9, 2026
15c291a
Typo in env variable
k-deeley Jun 9, 2026
89d7bde
Included task outputs automatically
k-deeley Jun 10, 2026
cac3cad
Spacing on indexing
k-deeley Jun 23, 2026
68c4bff
Unrelated typo - reference to old function name
k-deeley Jul 16, 2026
934dc90
Renamed rights file
k-deeley Jul 16, 2026
4ffb73f
Copying MathJax rights in docconvert
k-deeley Jul 16, 2026
b5394c8
Added tex-mml-chtml.js license to docmakerdoc/license.md
k-deeley Jul 16, 2026
407d569
MathJax is the project name
djmsampson Jul 16, 2026
27d35d6
Updated docconvert help text for Interpreter
djmsampson Jul 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docmaker-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
matrix:
platform: [ubuntu-latest, windows-latest]
matlab-version: [R2022b, R2023b, R2024b, R2025b]
matlab-version: [R2022b, R2023b, R2024b, R2025b, R2026a]
runs-on: ${{ matrix.platform }}
continue-on-error: false
steps:
Expand Down
43 changes: 11 additions & 32 deletions buildfile.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,26 @@
test = fullfile( prj, "tests" );

% Clean task
plan( "clean" ) = matlab.buildtool.tasks.CleanTask;
plan("clean") = matlab.buildtool.tasks.CleanTask;

% Check task
plan( "check" ).Inputs = api;
plan("check").Inputs = api;

% Test task
plan( "test" ) = matlab.buildtool.tasks.TestTask( test, ...
plan("test") = matlab.buildtool.tasks.TestTask( test, ...
"SourceFiles", tbx, "Strict", true );
plan( "test" ).Inputs = [api test];
plan( "test" ).Dependencies = "check";
plan("test").Inputs = [api test];
plan("test").Dependencies = "check";

% Documentation task
plan( "doc" ).Inputs = doc;
plan( "doc" ).Outputs = [ ...
fullfile( doc, "**", "*.html" ), fullfile( doc, "*.xml" ), ...
fullfile( doc, "resources" ), fullfile( doc, "helpsearch-v*" )];
plan("doc") = DocMakerTask( fullfile( doc, "**", "*.md" ), ...
"Theme", "light", ...
"FigureSize", [600, 400], ...
"FigureTheme", "light" );

% Package task
plan( "package" ).Inputs = tbx;
plan( "package" ).Dependencies = ["test", "doc"];
plan("package").Inputs = tbx;
plan("package").Dependencies = ["test", "doc"];

% Default task
plan.DefaultTasks = "package";
Expand Down Expand Up @@ -72,27 +72,6 @@ function checkTask( c )

end % checkTask

function docTask( c )
% Generate documentation

% Documentation folder
doc = c.Task.Inputs.Path;

% Convert Markdown to HTML
md = fullfile( doc, "**", "*.md" );
html = docconvert( md, "Theme", "light" );
fprintf( 1, "** Converted Markdown doc to HTML\n" )

% Run code and insert output
docrun( html, "Theme", "light", "FigureSize", [600 400] )
fprintf( 1, "** Inserted MATLAB output into doc\n" )

% Index documentation
docindex( doc )
fprintf( 1, "** Indexed doc\n" )

end % docTask

function packageTask( ~ )
% Package toolbox

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="DocMakerTask.md" type="File"/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="tex-mml-chtml.rights" type="File"/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="tex-mml-chtml.js" type="File"/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="mathjax-config.js" type="File"/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info>
<Category UUID="FileClassCategory">
<Label UUID="design"/>
</Category>
</Info>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="mustBeTheme.m" type="File"/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info>
<Category UUID="FileClassCategory">
<Label UUID="design"/>
</Category>
</Info>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="superfolder.m" type="File"/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info>
<Category UUID="FileClassCategory">
<Label UUID="design"/>
</Category>
</Info>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="getDefaultFigureSize.m" type="File"/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info>
<Category UUID="FileClassCategory">
<Label UUID="design"/>
</Category>
</Info>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="docmakerroot.m" type="File"/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info>
<Category UUID="FileClassCategory">
<Label UUID="design"/>
</Category>
</Info>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="DocMakerTask.m" type="File"/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info>
<Category UUID="FileClassCategory">
<Label UUID="test"/>
</Category>
</Info>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="tDocMakerTask.m" type="File"/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="LaTeXExample.md" type="File"/>
7 changes: 7 additions & 0 deletions tbx/docmaker/+docmaker/getDefaultFigureSize.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
function s = getDefaultFigureSize()
%getDefaultFigureSize Default figure size

p = get( 0, "DefaultFigurePosition" ); % [x y w h]
s = p(3:4); % [w h]

end % getDefaultFigureSize
10 changes: 10 additions & 0 deletions tbx/docmaker/+docmaker/mustBeTheme.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
function mustBeTheme( theme )
%mustBeTheme Validation function for optional named argument Theme

themes = ["none","light","dark","auto"];
assert( ( ischar( theme ) && ismember( theme, themes ) ) || ...
( isstring( theme ) && isscalar( theme ) && ismember( theme, themes ) ) || ...
( isa( theme, "matlab.graphics.theme.GraphicsTheme" ) && isscalar( theme ) ), ...
"Theme must be ""none"", ""light"", ""dark"", ""auto"", or a GraphicsTheme." )

end % mustBeTheme
44 changes: 44 additions & 0 deletions tbx/docmaker/+docmaker/superfolder.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
function s = superfolder( varargin )
%superfolder Common ancestor folder
%
% s = superfolder(p1,p2,...) returns the common ancestor of the folders
% p1, p2, ... The folders must exist. If there is no common ancestor
% then superfolder returns [].

% Copyright 2024-2026 The MathWorks, Inc.

% Check inputs
narginchk( 1, Inf )
dd = string( varargin );

% Canonicalize using dir
for ii = 1:numel( dd )
d = dd(ii);
assert( isfolder( d ), "docmaker:NotFound", "Folder ""%s"" not found.", d )
sd = dir( d );
dd(ii) = sd(1).folder; % first entry is "."
end

% Loop, split, compare
s = dd(1); % initialize
for ii = 2:numel( dd )
d = dd(ii);
ts = split( s, filesep ); % split
td = split( d, filesep ); % split
n = min( numel( ts ), numel( td ) ); % comparable length
tf = ts(1:n) == td(1:n); % compare
i = find( tf == false, 1, "first" ); % first non-match
if i == 1 % immediate non-match
s = [];
return
elseif isempty( i ) % full match
s = join( ts(1:n), filesep );
else % partial match
s = join( ts(1:i-1), filesep );
end
end

% Return matching datatype
if iscellstr( varargin ), s = char( s ); end %#ok<ISCLSTR>

end % superfolder
2 changes: 1 addition & 1 deletion tbx/docmaker/Contents.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
% MATLAB DocMaker
% Version 0.7 (R2025b) 07-Feb-2026
% Version 0.8 (R2026a) 28-May-2026
%
% docconvert - convert Markdown documents to HTML
% docrun - run MATLAB code in HTML documents and insert output
Expand Down
Loading
Loading