sponsor Vim development Vim logo Vim Book Ad

Doxygen-via-Doxygen : Generate Doxygen documentation

 script karma  Rating 1/1, Downloaded by 853  Comments, bugs, improvements  Vim wiki

created by
Niels Aan de Brugh
 
script type
utility
 
description
This script allows one to easily generate Doxygen documentation for C and C++ functions. Java could work, I haven\\'t tested.

There are many of these scripts available, but I\\'ve found most are commonly severely restricted by the fact that they parse the C/C++ code themselves. Parsing C++ is hard. Very hard even. I wouldn\\'t consider parsing code myself, and especially not in VimScript.

So the trick is this: use Doxygen itself to parse the code, and then parse that output instead. Doxygen can output to XML, which is easily processed further. In this case by applying an XSL transformation. VimScript is used to glue all this together, e.g. move to the correct line number, hightlight/remove the old tag.

As a result this script has the following nice features:
- Parses C++ code correctly, regardless of layout, interspersed comments, etc. If Doxygen cannot parse it there\\'s little need to add a Doxygen tag. See www.doxygen.org for further details if you think you\\'ve found a bug.
- Re-uses old Doxygen tags, i.e. generates new tags dropping old items and inserting new ones.

The maintenance bottleneck is the XSLT file, which should be kept up-to-date to the XML Doxygen outputs. Also, not all markup is kept intact. It is not my intention to make the XSLT file complete, I\\'m very pragmatic in that sense and I\\'ll only add what\\'s actually needed (at the moment: bold, italics, typewriter, (un)ordered lists).

At the moment I\\'m looking for developers proficient with both Vim and XSLT who want to give this a spin. This is *alpha* software. I\\'m releasing it purely in the spirit of Bazaar development. I have not thoroughly tested this script yet. Since I\\'m more than likely to use my own creation I\\'ll probably fix bugs and update new versions.

For all other users: feel free to download and use this. In my humble opinion it\\'ll serve you at least as good as the scripts already out there. But some hacking may be required.

Sources are licensed under the liberal MIT license.
 
install details
Extract the tarball somewhere where .vim files will be read at startup. Edit make_doxygen_tag.vim and edit (at least) the location of the XSLT file.

You need a XSLT processor and Doxygen!

As an XSLT processor I\\'d recommend libxml2\\'s xsltproc: www.libxml.org
You need a recent version of Doxygen (tested with 1.5.5).
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
make_doxytag.tar.gz 0.1 2008-02-27 6.0 Niels Aan de Brugh Initial upload
ip used for rating: 54.160.133.33

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github