A few months ago, the C++ docs always showed the source which was super useful.
Now when I look up a function I have to go through a bunch of tedious steps and then eventually about 30 seconds later it’ll find the source in Visual Studio. It makes it really tedious to analyze how things are put together.
We have an internal discussion going about this very topic. We removed it because the source is readily available and we were worried it would become confusing with the source and example code on the same page. I think we may end up adding it back unless we find a better solution that addresses all concerns (in fact, we may have already added it back for the next release). We would rather err on the side of giving everyone what they want than holding back to avoid potential confusion.
A thought that just came across my mind, thinking about this.
As far as I know, you guys use specific formatting rules for header comments so the documentation tool can more or less extract them automatically.
Would it be possible to implement the following:
Define a “token” keyword. Lets say we choose “$CodeSnippet$” and “$/CodeSnippet$”
Use them in pairs throughout the source code in a commented form.
Extend/make a tool that extracts the content between the token tags and include it into the documentation.
Being comments, they would be ignored by the compiler.
If used sensibly, it shouldnt clutter up the source code too much.
You could also use a “flag” in the function header comments format to indicate that the function code is to be included in the documentation in its entirety…
PS: I could easily make such a tool, just not (easily) in C++
+1 for putting source code back into docs, it’s so much easier than searching through the source/github.
If it’s a question of readability, no problem having the source code hidden until manually expanded.
Oh, I just noticed that… there is not source anymore, huh… that was super fast tool, on my computer, opening class using VS right click takes a few minutes. +1 for putting it back
I’m 99.9% sure the docs are auto generated based on the comments in the code using some tool like DOXYGEN. There’s a flag to include source in the docs along with the docs on what the parameters do, etc… They must have flipped that switch off recently. It shouldn’t be an issue to reenable it.