77% * https://www.mathworks.com/help/matlab/matlab_prog/marking-up-matlab-comments-for-publishing.html
88%
99% for package code -- assumes no classes and depth == 1
10- function publish_gen_index_html(pkg_name , tagline , outdir )
10+ function publish_gen_index_html(pkg_name , tagline , project_url , outdir )
11+ arguments
12+ pkg_name (1 ,1 ) string
13+ tagline (1 ,1 ) string
14+ project_url (1 ,1 ) string
15+ outdir (1 ,1 ) string
16+ end
1117
1218pkg = what(" +" + pkg_name );
1319% "+" avoids picking up cwd of same name
@@ -28,6 +34,7 @@ function publish_gen_index_html(pkg_name, tagline, outdir)
2834 " <h1>" + pkg_name + " API</h1>" , ...
2935 " <p>" + tagline + " </p>" , ...
3036 " <p>" + git_txt + " </p>" , ...
37+ " <p>Project URL: <a href=" + project_url + " >" + project_url + " </a></p>" , ...
3138 " <h2>API Reference</h2>" ];
3239fid = fopen(readme , ' w' );
3340fprintf(fid , join(txt , " \n" ));
@@ -39,15 +46,13 @@ function publish_gen_index_html(pkg_name, tagline, outdir)
3946doc_fn = publish(pkg_name + " ." + name , evalCode= false , outputDir= outdir );
4047disp(doc_fn )
4148
42- % inject summary into Readme.md
49+ % inject summary for each function into Readme.md
4350summary = split(string(help(pkg_name + " ." + name )), newline );
4451words = split(strip(summary(1 )), " " );
4552
46- % purposefully this will error if no docstring
53+ % error if no docstring
4754fname = words(1 );
48- if (lower(fname ) ~= lower(name ))
49- error(" fname %s does not match name %s" , fname , name )
50- end
55+ assert(lower(fname ) == lower(name ), " fname %s does not match name %s \nis there a docstring at the top of the .m file?" , fname , name )
5156
5257line = " <a href=" + name + " .html>" + fname + " </a> " ;
5358if (length(words ) > 1 )
0 commit comments