Doc comment notation is not a language concern. You could simply start writing Markdown with image references and if your documentation generator supports it and can resolve these refs, they'll be included. A different approach is to use a literate programming tool like NoWEB in which case the code is included as part of the documentation, and extracted separately.