[1.7.x] Fixed #17238 -- Added source code links to docs using sphinx.ext.viewcode.

Thanks santiagobasulto for the suggestion.

Backport of 9ed4a8c6b1 from master