Versatile synthesis of molybdenum sulfide from confined spaces for efficient hydrogen evolution