On Tue, Oct 20, 2020 at 1:38 PM <doxygen-users-requ...@lists.sourceforge.net> wrote:
> > Date: Tue, 20 Oct 2020 13:09:03 +0000 > From: Felix Kerger <felix.ker...@king.com> > Subject: [Doxygen-users] Doxygen and Python DocString > > Hello all, > I want to double check that I am not missing something. > > At least some projects (including some I am working with) document > function/method parameters using > :param {ParamenterName}: Description of the parameter > to document parameters. Doxygen seems to only accept @param, which is more > JavaDoc then Python Docstring. > > Below is a more precise example. > > def example_working(parameter, parameter_with_default=False): > """ > Use this method to show how python and doxygen work together > @param parameter This parameter is amazing > @param parameter_with_default This parameter is even better > """ > pass > > def example_not_working(parameter, parameter_with_default=False): > """ > Use this method to show how python and doxygen work together > :param parameter: This parameter is amazing > :param parameter_with_default: This parameter is even better > """ > pass > > Is there a way for doxygen to understand the :param: marker? > Should I submit this as an issue or is it out of scope for doxygen? > Doxygen has a hook for running a user specified preprocessor. You could create a preprocessor to reformat the Python DocStrings into Doxygen DocStrings. Simple example in Perl (not tested): while (<>) # read from file named by an argument or from stdin if no argumant { s/^:param ([^:]):/@param $1/; print; } This might not be enough. You may have to add code to detect beginning and end of DocString blocks and only apply the substitution within DocString blocks. Perl's ... operator is very helpful for doing that.
_______________________________________________ Doxygen-users mailing list Doxygen-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/doxygen-users