Mercurial > octave
diff scripts/miscellaneous/publish.m @ 30379:363fb10055df stable
maint: Style check m-files ahead of 7.1 release.
* Map.m, integral3.m, logspace.m, quad2d.m, quadgk.m, quadl.m, tsearchn.m,
get_first_help_sentence.m, print_usage.m, getframe.m, imformats.m,
javaclasspath.m, condest.m, null.m, ordeig.m, inputParser.m, license.m,
memory.m, methods.m, __publish_html_output__.m, __publish_latex_output__.m,
publish.m, ode15s.m, fminbnd.m, fzero.m, configure_make.m, get_description.m,
get_forge_pkg.m, annotation.m, camlookat.m, legend.m, __gnuplot_legend__.m,
bar.m, colorbar.m, fill3.m, isosurface.m, plotyy.m, polar.m, __bar__.m,
__ezplot__.m, __patch__.m, __pie__.m, __plt__.m, __scatter__.m, smooth3.m,
stemleaf.m, __gnuplot_drawnow__.m, print.m, printd.m, __add_default_menu__.m,
__gnuplot_draw_axes__.m, __gnuplot_print__.m, __print_parse_opts__.m,
struct2hdl.m, profexport.m, profile.m, movfun.m, sprandsym.m, betaincinv.m,
factor.m, nchoosek.m, gallery.m, hadamard.m, iqr.m, ranks.m,
__run_test_suite__.m, test.m, datevec.m, weboptions.m:
Style check m-files ahead of 7.1 release.
author | Rik <rik@octave.org> |
---|---|
date | Fri, 26 Nov 2021 20:53:22 -0800 |
parents | 33d895260fa4 |
children | 796f54d4ddbf |
line wrap: on
line diff
--- a/scripts/miscellaneous/publish.m Fri Nov 26 18:13:08 2021 -0800 +++ b/scripts/miscellaneous/publish.m Fri Nov 26 20:53:22 2021 -0800 @@ -409,6 +409,7 @@ function doc = parse_m_source (doc) + ## PARSE_M_SOURCE First parsing level ## This function extracts the overall structure (paragraphs and code ## sections) given in doc.m_source. @@ -434,6 +435,7 @@ ## Checks line to have N "%" or "#" lines ## followed either by a space or end of string function r = is_publish_markup (cstr, N) + str = char (cstr); r = any (strncmp (str, {"%%%", "##"}, N)); @@ -571,6 +573,7 @@ function p_content = parse_paragraph_content (content) + ## PARSE_PARAGRAPH_CONTENT second parsing level ## ## Parses the content of a paragraph (without potential title) and @@ -715,8 +718,8 @@ function m_source = read_file_to_cellstr (file) + ## READ_FILE_TO_CELLSTR reads a given file line by line into a cellstring - fid = fopen (file, "r"); i = 0; do @@ -729,8 +732,8 @@ function ofile = create_output (doc, options) + ## CREATE_OUTPUT creates the desired output file - formatter = []; switch (options.format) case "html" @@ -778,9 +781,9 @@ function toc_cstr = get_toc (cstr, formatter) + ## GET_TOC extracts the table of contents from a cellstring (e.g., doc.body) ## with each section headline as a cell in a returned cellstring. - toc_cstr = cell (); for i = 1:numel (cstr) if (strcmp (cstr{i}.type, "section")) @@ -792,13 +795,13 @@ function str = format_output (cstr, formatter, options) + ## FORMAT_OUTPUT steps through all blocks (doc.intro or doc.body) in cstr and ## produces a single result string with the source code in the desired output ## format. ## ## formatter has the only knowledge how to enforce the target format ## and produces for each block the necessary target format source string. - str = ""; for i = 1:numel (cstr) switch (cstr{i}.type) @@ -825,6 +828,7 @@ function str = format_text (str, formatter) + ## FORMAT_TEXT formats inline formats in strings. ## These are: links, block/inline math, bold, italic, monospaced, (TM), (R) @@ -957,6 +961,7 @@ function doc = eval_code (doc, options) + ## EVAL_CODE Third level parsing ## ## Generates the output of the script code and takes care of generated @@ -1060,6 +1065,7 @@ function cstr = eval_code_helper (__code__) + ## EVAL_CODE_HELPER evaluates a given string with Octave code in an extra ## temporary context and returns a cellstring with the eval output. @@ -1077,6 +1083,7 @@ function cstr = eval_context (op) + ## EVAL_CONTEXT temporary evaluation context. persistent ctext