Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Odd rendering of \throw paragraphs #34

Closed
gennaroprota opened this issue Nov 5, 2020 · 6 comments
Closed

Odd rendering of \throw paragraphs #34

gennaroprota opened this issue Nov 5, 2020 · 6 comments

Comments

@gennaroprota
Copy link

Hi,

the following markup:

//!     \throw
//!         A \c std::invalid_argument if any of the characters in \c s
//!         is not a decimal digit (i.e. one of \c 0123456789).

is being rendered as follows in my documentation:

DocsForgeOutputScreenshot

That has two oddities:

  1. The initial "A" appears as code

  2. An extra hyphen appears between the "A" and the rest

I suspect the glitches are due to Doxygen, though, because this is Doxygen's output, instead:

DoxygenOutputScreenshot

There, although there's no extra hyphen, the "A" is rendered as a parameter name (!).

@erez-o
Copy link
Owner

erez-o commented Nov 5, 2020

Yes, it's doxygen.

Doxygen's xml output in this case is:

<parameterlist kind="exception">
  <parameteritem>
    <parameternamelist>
      <parametername>A</parametername>
    </parameternamelist>
    <parameterdescription>
    <para>
    <computeroutput>std::invalid_argument</computeroutput>
    if any of the characters in
    <computeroutput>s</computeroutput>
    is not a decimal digit (i.e. one of
    <computeroutput>0123456789</computeroutput>
    ).
    </para>
    </parameterdescription>
  </parameteritem>
</parameterlist>

It thinks A is <parametername>A</parametername>. The hyphen in docsforge is added automatically after a parameter name.

Just a suggestion - can't a \par exception achieve your desired behavior?

@gennaroprota
Copy link
Author

Yes, indeed, \par Exceptions seems the best solution. Thanks for the suggestion, and for looking into this.

@gennaroprota
Copy link
Author

gennaroprota commented Nov 5, 2020

Addendum: that's actually the expected behavior (if you know what to expect :-)). Because the \throw command has a mandatory argument, which is supposed to be the type of exceptions emitted. If e.g. you follow "\throw" with "A \c std::invalid_argument", then "A" is taken as the type of exceptions, and formatted as code. In a sense, this is "logical", because \throw wouldn't be any different from \par, otherwise. In fact, I'd say that, given this hard-coded logic, it's probably better to just use \par, which is more flexible.

Sorry for the bogus issue report.

@gennaroprota
Copy link
Author

Addendum to the addendum :-): is the colon after "Exceptions" (the paragraph title) intentional? It seems odd at the end of a title.

@erez-o
Copy link
Owner

erez-o commented Nov 6, 2020

I agree, adding a colon is inconsistent with other paragraphs, and since it's a <dt> element anyway, there's no need for it.

I'll fix it, thanks.

Closing, if you notice in the future that it still exists, please reopen.

@erez-o erez-o closed this as completed Nov 6, 2020
@erez-o
Copy link
Owner

erez-o commented Nov 10, 2020

Fixed inconsistent colons for various titles like "Exceptions" on version 3.4.17.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants