Describe the bug
Currently, the automatic documentation script for the MATLAB/Octave functions takes the top lines from the source file (i.e., '*.m') to produce the PURPOSE and DESCRIPTION sections of the documentation. For the PURPOSE section, the system uses only the very first line of comment, which may not be complete and runs into more line. Then, the system uses all subsequent comment lines for the DESCRIPTION section. This does not work (for most of the MATLAB/Octave section) because the PURPOSE Section is described in multiple lines.
To Reproduce
Steps to reproduce the behavior:
- Go to https://mole-docs.readthedocs.io/en/main/api/matlab_octave/api.html#grad
- Click on the 'grad' function
- The errors are highlighted in the attached files.
Expected behavior
See the attached images
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
All platforms
Additional context
Deepanshu is currently working on this issue, and we are going to propose two solutions for review. Either allowing multiple comment lines for the PURPOSE section or using a different format to help the automatic generation of the sections.

Describe the bug
Currently, the automatic documentation script for the MATLAB/Octave functions takes the top lines from the source file (i.e., '*.m') to produce the PURPOSE and DESCRIPTION sections of the documentation. For the PURPOSE section, the system uses only the very first line of comment, which may not be complete and runs into more line. Then, the system uses all subsequent comment lines for the DESCRIPTION section. This does not work (for most of the MATLAB/Octave section) because the PURPOSE Section is described in multiple lines.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
See the attached images
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
All platforms
Additional context
Deepanshu is currently working on this issue, and we are going to propose two solutions for review. Either allowing multiple comment lines for the PURPOSE section or using a different format to help the automatic generation of the sections.