Visual Studio: can I add links to comment blocks

I program software where I very often have to make graphical illustrations to explain the behavior of the code, for example. geometrically illustrate how the shortest distance is from one of the sides of a triangle to the point of falling into this triangle.

In the comments, it becomes tedious to use and invent ascii representations, so I wondered if it is possible to embed drawings (drawings created in drawing programs) in a project / solution and refer to them in block comments.

+5
source share
2 answers

Yes, you can. Photos do not even need to be included in the project. VS will automatically create an interactive link from any URL located anywhere in the comment. I recommend that you place the URL inside the standard <see> comment. Our VSdocman also supports the <img> tag, which will show the image directly in the generated documentation.

Here is an example that uses both methods. In both cases, you can click the link directly in the code editor, and the image will show.

/// <summary> /// Click <see href="file:///C:\Pictures\Desert.jpg">here</see> to See the picture. /// </summary> /// <remarks>Here is the embedded picture: /// <img src="file:///C:\Pictures\Desert.jpg"/> /// </remarks> public void Method1() { } 
+2
source

The ImageComments extension for VS 2010/2012 allows you to display images among code.

+2
source

Source: https://habr.com/ru/post/1205808/


All Articles