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

issue #10820 Snippet in same file to share docs #10826

Merged
merged 1 commit into from Apr 28, 2024

Conversation

albert-github
Copy link
Collaborator

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.

Example: example.tar.gz

(see also #10700 and #10702)

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.
@doxygen doxygen merged commit 25644ec into doxygen:master Apr 28, 2024
6 of 8 checks passed
@albert-github albert-github added the fixed but not released Bug is fixed in github, but still needs to make its way to an official release label Apr 28, 2024
@albert-github albert-github deleted the feature/issue_10820 branch April 28, 2024 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fixed but not released Bug is fixed in github, but still needs to make its way to an official release Fortran Python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants