13
13
mdContents = arrayfun(@(x ) replace(x ," ```" ," &&&E" ), mdContents );
14
14
15
15
mdContents = formCBs(mdContents );
16
-
16
+
17
17
mdContents = arrayfun(@(x ) replace(x ,' &&&S' ,' ```{matlab}' ), mdContents );
18
18
mdContents = arrayfun(@(x ) replace(x ,' &&&E' ,' ```' ), mdContents );
19
-
19
+
20
20
mdContents = join(mdContents ,newline );
21
-
22
- if ~isfolder(' tempF ' )
23
- mkdir(' tempF ' );
21
+
22
+ if ~isfolder(' built ' )
23
+ mkdir(' built ' );
24
24
end
25
-
25
+
26
26
[~ ,a ,b ]=fileparts(fileName );
27
- f = fopen(fullfile(' tempF ' ,fileList(i ).name),' wb' ,' ieee-le' ,' UTF-8' );
27
+ f = fopen(fullfile(' built ' ,fileList(i ).name),' wb' ,' ieee-le' ,' UTF-8' );
28
28
fwrite(f ,mdContents ,' char' );
29
29
fclose(f );
30
30
close all force ;
55
55
tempStr = arrayfun(@(x ) regexprep(x ," ^plotly *\( *data *\)" ," pf=plotly(data,struct('writeFile',false))" ), tempStr );
56
56
tempStr = arrayfun(@(x ) regexprep(x ," ^plotly *\( *data *, *struct *\(" ," pf=plotly(data,struct('writeFile',false," ), tempStr );
57
57
tempStr = arrayfun(@(x ) regexprep(x ," p *= *plotlyfig *\( *gcf *" ," p=plotlyfig(gcf,'writeFile',false,'open',false" ), tempStr );
58
-
58
+
59
59
ss = strfind(tempStr ,' plotly(' ,' ForceCellOutput' ,true );
60
60
ss = find(cellfun(@(x ) ~isempty(x ), ss , ' UniformOutput' , true ), 1 );
61
61
62
62
ss2 = strfind(tempStr ,' p.plotly' ,' ForceCellOutput' ,true );
63
63
ss2 = find(cellfun(@(x ) ~isempty(x ), ss2 , ' UniformOutput' , true ), 1 );
64
-
64
+
65
65
if isempty(ss ) && ~isempty(ss2 )
66
66
insTxt = " json = m2json(struct('data',{p.data},'layout',p.layout,'frames',{p.frames})); fprintf('%s\n',json); close all force;" ;
67
67
else
68
68
insTxt = " json = m2json(struct('data',{pf.data},'layout',pf.layout,'frames',{pf.frames})); fprintf('%s\n',json); close all force;" ;
69
69
end
70
-
70
+
71
71
ss= [ss ,ss2 ];
72
-
72
+
73
73
if ~isempty(ss )
74
74
for j = 1 : length(ss )
75
75
if j > 1
132
132
res = [' <font color="red">...ERROR...<br>' ,ME .message ,' </font>' ];
133
133
end
134
134
end
135
- end
135
+ end
0 commit comments