Mercurial > octave
changeset 32997:fcf504e687c0 stable
Move anchor location for graphics prop and keyword subheadings (bug #59737)
* doc/interpreter/grammar.txi: Move keyword category anchors to the front of
the same line containing the keyword category subheadings so links show the
heading after being followed. Adjust the text for properties and methods
functions ref links.
* doc/interpreter/genpropdoc.m (printdoc): Put anchor and subheading on same
line followed by prindex for graphics property categories to ensure ref links
take you to the heading location and not the line below the heading.
author | Nicholas R. Jankowski <jankowski.nicholas@gmail.com> |
---|---|
date | Fri, 09 Feb 2024 21:45:34 -0500 |
parents | 7f47ba772a19 |
children | 7ab350607296 bf0b6e629eff |
files | doc/interpreter/genpropdoc.m doc/interpreter/grammar.txi |
diffstat | 2 files changed, 15 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/doc/interpreter/genpropdoc.m Fri Feb 09 18:33:49 2024 +0100 +++ b/doc/interpreter/genpropdoc.m Fri Feb 09 21:45:34 2024 -0500 @@ -3536,11 +3536,12 @@ for ii = 1:numel (categories) fields = sort (allfields(strcmp (allcategories, categories{ii}))); nf = numel (fields); - str = sprintf ("%s\n\n@subsubheading %s", str, categories{ii}); - str = sprintf ("%s\n@anchor{XREF%scategory%s}\n@prindex %s %s\n", str, ... - objname, strrep (categories{ii}, " ", ""), ... + str = sprintf ("%s\n\n@anchor{XREF%scategory%s}", str, ... objname, strrep (categories{ii}, " ", "")); - str = sprintf ("%s\n\n@table @asis", str); + str = sprintf ("%s@subsubheading %s\n", str, categories{ii}); + str = sprintf ("%s@prindex %s %s\n", str, ... + objname, strrep (categories{ii}, " ", "")); + str = sprintf ("%s\n@table @asis", str); for jj = 1:nf field = fields{jj};
--- a/doc/interpreter/grammar.txi Fri Feb 09 18:33:49 2024 +0100 +++ b/doc/interpreter/grammar.txi Fri Feb 09 21:45:34 2024 -0500 @@ -46,7 +46,7 @@ @ref{XREFkwcategoryClassdefStructures,,@w{Classdef Structures}}@: | @ref{XREFkwcategoryExecutionEnvironment,,@w{Execution Environment}}@: -@subsubheading Alphabetical listing: +@subsubheading Alphabetical keyword listing: @ref{XREF__FILE__,,__FILE__}@: | @ref{XREF__LINE__,,__LINE__}@: | @@ -91,22 +91,19 @@ @ref{XREFunwind_protect_cleanup,,unwind_protect_cleanup}@: | @ref{XREFwhile,,while}@: -@subheading Utility Functions: -@anchor{XREFkwcategoryUtilityFunctions} +@anchor{XREFkwcategoryUtilityFunctions}@subheading Utility Functions: The function @code{iskeyword} can be used to quickly check whether an identifier is reserved by Octave. @DOCSTRING(iskeyword) -@subheading Variable Declaration: -@anchor{XREFkwcategoryVariableDeclaration} +@anchor{XREFkwcategoryVariableDeclaration}@subheading Variable Declaration: @DOCSTRING(global) @DOCSTRING(persistent) -@subheading Function Definition: -@anchor{XREFkwcategoryFunctionDefinition} +@anchor{XREFkwcategoryFunctionDefinition}@subheading Function Definition: @DOCSTRING(function) @@ -116,8 +113,7 @@ @DOCSTRING(return) -@subheading Control Statements: -@anchor{XREFkwcategoryControlStructures} +@anchor{XREFkwcategoryControlStructures}@subheading Control Statements: @DOCSTRING(if) @@ -147,8 +143,7 @@ @DOCSTRING(end_unwind_protect) -@subheading Iterating Structures: -@anchor{XREFkwcategoryIteratingStructures} +@anchor{XREFkwcategoryIteratingStructures}@subheading Iterating Structures: @DOCSTRING(for) @@ -170,8 +165,7 @@ @DOCSTRING(continue) -@subheading Classdef Structures: -@anchor{XREFkwcategoryClassdefStructures} +@anchor{XREFkwcategoryClassdefStructures}@subheading Classdef Structures: @DOCSTRING(classdef) @@ -182,7 +176,7 @@ @anchor{XREFkwpropertyproperties} @deftypefn {} {} properties Mark the beginning of a block of properties in a classdef definition. Note -that @ref{XREFproperties, , the function @qcode{"properties"}} is a function +that the @ref{XREFproperties, , function @qcode{"properties"}} is a function that lists the properties of a classdef class or object. @seealso{@ref{XREFendproperties, , endproperties}} @end deftypefn @@ -194,7 +188,7 @@ @anchor{XREFkwpropertymethods} @deftypefn {} {} methods Mark the beginning of a block of methods in a classdef definition. Note that -@ref{XREFmethods, , the function @qcode{"methods"}} is a function that lists +the @ref{XREFmethods, , function @qcode{"methods"}} is a function that lists the methods of a class or object. @seealso{@ref{XREFendmethods, , endmethods}} @end deftypefn @@ -209,8 +203,7 @@ @DOCSTRING(endenumeration) -@subheading Execution Environment: -@anchor{XREFkwcategoryExecutionEnvironment} +@anchor{XREFkwcategoryExecutionEnvironment}@subheading Execution Environment: @DOCSTRING(__FILE__)