Skip to content

Commit

Permalink
Dev: fix gendoc(), add vp_fcn callback
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Roslovets committed Nov 19, 2019
1 parent 57aa909 commit cebac25
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
23 changes: 14 additions & 9 deletions ToolboxDev.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
properties
ext % Toolbox Extender
vp % project version
vp_fcn % get version callback function
end

methods
Expand All @@ -29,16 +30,20 @@

function vp = gvp(obj)
% Get project version
ppath = obj.ext.getppath();
if isfile(ppath)
if obj.ext.type == "toolbox"
vp = matlab.addons.toolbox.toolboxVersion(ppath);
if ~isempty(obj.vp_fcn)
vp = obj.vp_fcn();
else
ppath = obj.ext.getppath();
if isfile(ppath)
if obj.ext.type == "toolbox"
vp = matlab.addons.toolbox.toolboxVersion(ppath);
else
txt = obj.ext.readtxt(ppath);
vp = char(regexp(txt, '(?<=(<param.version>))(.*?)(?=(</param.version>))', 'match'));
end
else
txt = obj.ext.readtxt(ppath);
vp = char(regexp(txt, '(?<=(<param.version>))(.*?)(?=(</param.version>))', 'match'));
vp = '';
end
else
vp = '';
end
obj.vp = vp;
end
Expand Down Expand Up @@ -135,7 +140,7 @@ function gendoc(obj, format, docdir, options)
if format == "md"
obj.mlx2md(fs.path(i), respath, options.AddCredentials);
else
matlab.internal.liveeditor.openAndConvert(fs.path(i), respath);
matlab.internal.liveeditor.openAndConvert(char(fs.path(i)), char(respath));
end
end
end
Expand Down
3 changes: 2 additions & 1 deletion ToolboxExtender.prj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
- how to easily store toolbox data (i.e. user preferences) not in the curent folder but in some convinient location
Toolbox Extender address those issues extending built-in MATLAB capabilities of toolbox creating.</param.description>
<param.screenshot>${PROJECT_ROOT}\ToolboxExtender-icon.png</param.screenshot>
<param.version>2.2.0</param.version>
<param.version>2.2.1</param.version>
<param.output>${PROJECT_ROOT}\Toolbox Extender.mltbx</param.output>
<param.products.name />
<param.products.id />
Expand Down Expand Up @@ -103,6 +103,7 @@ installweb.m</param.exclude.filters>
<file>${PROJECT_ROOT}\resources</file>
<file>${PROJECT_ROOT}\scripts</file>
<file>${PROJECT_ROOT}\ToolboxConfig.xml</file>
<file>${PROJECT_ROOT}\ToolboxDev.asv</file>
<file>${PROJECT_ROOT}\ToolboxDev.m</file>
<file>${PROJECT_ROOT}\ToolboxExtender-icon.png</file>
<file>${PROJECT_ROOT}\ToolboxExtender.m</file>
Expand Down

0 comments on commit cebac25

Please sign in to comment.