I've got the script generating lyx (ctrl-return) style newlines by inserting:

\begin_inset Newline newline
\end_inset

wherever a "\n" is found in the doxygen comments. This seems to work well.

There are still some things to be decided though. In LFUN_MATH_SIZE
the params must contain a \. This should be escaped as \\ in the
comment for doxygen to understand it. The documentation generated at
http://wiki.lyx.org/sourcedoc/svn/namespacelyx.html#5ae63e8160e98b54ad28f142ed40c202fbe9d5809b890010dd6659e548823d36
is lacking the info shown below in the comment copied from
LyXAction.cpp. Obviously because the \ are not escaped as \\, boxygen
can't read the field. I'll edit LyXAction.cpp to include \\ and make a
diff when my script is done.

/*!
 * \var lyx::FuncCode lyx::LFUN_MATH_SIZE
 * \li Action: Changes arbitrarily the size used by math fonts inside a context.
 * \li Notion: Provides an interface to the LaTeX math mode font size commands.
 * \li Syntax: math-size <STYLE>
 * \li Params: <STYLE>: \displaystyle|\textstyle|\scriptstyle|\scriptscriptstyle
 * \li Origin: Alejandro, 15 Aug 1996; ps, 14 Jun 2008
 * \endvar
 */

The other thing is LFUN_MATH_BIGDELIM which in the 'sample' field
contains single, non-escaped \ characters. My instinct would be to say
doxygen wouldn't like this (as with LFUN_MATH_SIZE) but it seems that
since the non-escaped \ characters are inside double quotes, doxygen
reads them fine. I propose to fix my script to find single \ chars
inside double quotes ("") and to treat them as an intended single \
char, not part of an escape sequence. I think it makes sense to keep
my script's interpretation compatible with doxygen's - in which case
changing these \ to \\ isn't a fix (see below in the sample field).

/*!
 * \var lyx::FuncCode lyx::LFUN_MATH_BIGDELIM
 * \li Action: Inserts math fixed size delimiters (e.g. parentheses,
brackets) enclosing expression.
 * \li Syntax: math-bigdelim <LSIZE> <LDELIM> <RSIZE> <RDELIM>
 * \li Params: <L/RSIZE>: bigl/r|Bigl/r|biggl/r|Biggl/r \n
               <L/RDELIM>: TeX code for delimiter. See Delimiter
dialog for delimiters to be used.
 * \li Sample: math-bigdelim "Bigl" "\Downarrow" "Bigr" "\}"
 * \li Origin: Enrico & Georg, 7 May 2006
 * \endvar
 */

Coming to think of it, is there not a way via doxygen, which already
parses LyXAction.cpp, to generate the documentation? If we could use
the same code doxygen uses to parse the comments, just generating a
.lyx file instead of .html as doxygen does, it would mean consistency
between the doxygen output and the .lyx output as the parsers would be
the same. Maybe this is using a sledgehammer to crack a nut though, I
don't know....

Reply via email to