The sidebar is heavily customized on many Wikimedia projects using the very special "MediaWiki:Sidebar" message.
For the user's manual, which is way more complex than anybody would expect it to be, see
https://www.mediawiki.org/wiki/Manual:Interface/Sidebar
Hope it helps!