How to generate documentation from stored procedures?
I can't for the life of me understand why this question received a flag for being off-topic. I think it is interesting and very relevant for the working DBA.

Unfortunately, as far as I can ascertain, it is impossible to do this automatically. You can run two commands

SELECT ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_SCHEMA = 'yourdb' AND ROUTINE_TYPE = 'PROCEDURE' AND ROUTINE_NAME = "procedurename";


and 

SHOW PROCEDURE STATUS; -- will give you all procedures available.

SHOW CREATE PROCEDURE procedure_name; -- will give you details about a given procedure.


A good discussion of the topic is available here which shows the problems associated with the various commands.

Extending slightly the example given for the sample alluser() procedure as shown in the link above. I added comments with # and --.

DELIMITER //

CREATE PROCEDURE alluser()

# a proc to show all users
BEGIN
   SELECT *  -- selecting from the users' table
   FROM users;
END //
DELIMITER ;


What I found was that the comments are NOT returned using either SHOW PROCEDURE STATUS or SHOW CREATE PROCEDURE alluser; NOR the SQL statement above returns the comments. 

[EDIT - I have further found that comments are not returned with SELECT * FROM Information_Schema.Routines.

I searched the system and found the field ROUTINE_COMMENT in INFORMATION_SCHEMA.ROUTINES - but it didn't return the comments either. What this field is for, I don't quite know - maybe it's not implemented yet?

I would respectfully suggest your best bet is to document as you go - put "full documentation for the procedure" as part of your testing and UAT framework.