Template:Namespace detect/doc

Template cleverly detects namespaces. See Wikipedia:Template:Namespace_detect/doc to get some idea how.