-
-
Notifications
You must be signed in to change notification settings - Fork 201
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
Add various specifiers to functions and variables #628
Conversation
Fixes part 1 of breathe-doc#600
Example to check the rendering: struct A {
static void fStatic();
inline void fInline();
friend void fFriend();
virtual void fPureVirtual() = 0;
virtual void fVirtual();
explicit A();
constexpr void fConstexpr();
public:
static int vStatic;
mutable int vMutable;
};
// doc
extern void fExtern();
// doc
thread_local int vThreadLocal; .. doxygenstruct:: A
:members:
:undoc-members:
.. doxygenfunction:: fExtern
.. doxygenvariable:: vThreadLocal |
(The linting errors seems to be unrelated to the PR but due to a new mypy version.) |
These errors newly occur in CICD, likely a new mypy version was pulled in recently. Ignore the entire file as it's just configuration settings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great, thanks @jakobandersen !
Is there a way to not output an inline specifier? My code is highly templated C++, where the functions are all implemented inline, although without the explicit specifier. All of these function templates are marked as inline in the documentation and it's ugly and I would prefer they were not shown. I presume Doxygen is passing on these specifier to breathe. If there's a workaround using doxygen, I'd be happy to try that. |
I don't think Breathe has options to do that, and I don't know about Doxygen. Theoretically, if there are all templates, the |
Sorry if I wasn't explicit enough. I write code like: template<typename T>
void foo(T&) {} This function will end up being marked as inline in the HTML documentation generated by Sphinx. That's what I was hoping to avoid. |
I've raised an issue on the doxygen project, where, I believe, the problem lies: I think this issue can be closed. For anybody who is looking for a quick workaround, I was able to add a little jquery script in custom.js to hide the inline specifier from the HTML. In conf.py:
In _static/custom.js, I added the following: $(document).ready(function() {
$("em.property > span.pre:contains('inline')").hide();
}); This works for the readthedocs theme. Other themes may use different selectors. That's beyond my sphinx knowledge. |
I'm not exactly sure what the rationale for why Doxygen marks it |
Jakob, thanks very much for the advice. The spacing in declarations is not always great, so I hope that the above issue makes it easier to make the spacing look nice. I should probably talk to the readthedocs theme people about this. |
Oh, right, I just tried locally and I don't see any spacing and wrapping issues with that PR + sphinx_rtd_theme! |
Convert various specifiers on functions and variables.
Fixes (part 1 of) #600.