The best way to add images to the code documentation

The most correct way to add documentation to the code is to place it next to the code. In this case, if the code changes, it is highly likely that the developer will not forget to update the documentation. And if the documentation is somewhere separate, it is often forgotten to update it.

To implement this concept, doxygen and other similar systems were invented, using which the documentation is human-readable comments directly in the the code.

But unfortunately, doxygen does not allow you to insert images in the documentation. At least in a simple way. And I often have to implement geometric algorithms and one picture can replace a hundred words. And sometimes you can't do without pictures at all.

Please tell me what ways you use to provide your code documentation with images?

Author: Nick Volynkin, 2017-01-09

1 answers

Add a link to the image. I use markdown for documentation, then convert it to pdf via mdpdf (npm package, very easy to use and install). In pdf, <image stc='...' /> is converted to an image. Maybe there is something similar in doxygen (see @Uhv's comment). But <image stc='...' /> can be added directly to the function/class comments.

 0
Author: Mikhail Ionkin, 2019-12-25 06:32:44