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
Snippet in same file to share docs #10820
Comments
You wrote:
Doxygen can have the code snippets in the same file and address these in the same way as it would do with do with snippets in a separate file, so can you show what you did:
Furthermore in your snippet you use the commands
I would have expected that the following would work:
though this gives (in the current master version (1.11.0 (78422d3)):
and in the 1.10.0 version:
(Normally one would not use A workaround is currently:
|
you example works (previously I didn't know """ [common_param_a]
@param a This is a common parameter that appears in many functions.
[common_param_a]"""
## @brief This is a function.
# @snippetdoc this common_param_a
# @param b This is another parameter.
def function1(a, b):
pass |
When having e.g.: ``` ## \file # [common_param_a] # @param a This is a common parameter that appears in many functions. # [common_param_a] ## @brief This is a function. # # @snippetdoc example.py common_param_a # @param b This is another parameter. def function1(a, b): pass ``` or analogous in Fortran: ``` !> \file ! [ftn_common_param_a] ! @param a This is a common parameter that appears in many functions. ! [ftn_common_param_a] !> @brief This is a function. !> !> @snippetdoc this ftn_common_param_a !> @param b This is another parameter. subroutine ftn_function1(a, b) INTEGER a INTEGER b end subroutine ``` we get warnings like: ``` example.py:4: warning: '\param' command is not allowed in section title, ending section title. ``` and in Fortran the `!` appears in the output Whilst in C++ the analogous example: ``` /// \file /** @brief This is a function. * @snippet{doc} this cpp2_common_param_a * @param b This is another parameter. */ void cpp2_function1(int a, int b){} /* [cpp2_common_param_a] * @param a This is a common parameter that appears in many functions. * [cpp2_common_param_a] */ ``` works OK, due to the rule ``` <DocBlock>"\\ilinebr "{B}*"*"/[^/] { QCString indent; indent.fill(' ',computeIndent(yytext+8,yyextra->column)); yyextra->docBlock << "\\ilinebr " << indent; } ``` added analogous rules for python and Fortran.
I've just pushed a proposed patch, pull request #10826 |
issue #10820 Snippet in same file to share docs
Code has been integrated in master on GitHub (please don't close the issue as this will be done at the moment of an official release). |
Hi, I need to share docs between functions and params.
As I know, writing the snippet in seperator example file and using @snippetdoc to include the file and snippet will works. But it will be more clear if I can write the snippet in the same file . In most case, I only use the snippet in same file.
Below is a short example. Currently it not works.
The text was updated successfully, but these errors were encountered: