How can I generate HTML documentation from help/doc output?
조회 수: 48 (최근 30일)
이전 댓글 표시
How can I automatically generate reference HTML documentation for my toolbox (mostly classdef classes)? I'm looking for something like what the doc command produces, pulling help text and class properties, methods, etc. from the source files directly, but outputing a set of HTML files I can host on my web-site as a reference manual.
I'm aware of M2HTML (does not handle classdef) and Sphinx+sphinxcontrib.matlab (multiple issues with classdef files), but nothing that handles the MathWorks recommended style of class documentation directly. I've even tried the undocumented help2html, but don't know how to get it to include links.
What does everyone else do? Write your documentation twice? Once in the source files for use with help and doc, and then again, manually reproducing everything for your online reference documentation?
댓글 수: 0
답변 (2개)
Ray Zimmerman
2023년 9월 15일
댓글 수: 2
Grzegorz Lippe
2023년 11월 24일
Where can I find help for this package?
I tried it, but it only produced an emtpy index.html template.
Yash Sharma
2023년 9월 13일
Hi Ray,
I understand that you want to create HTML documentation for your toolbox that mostly have “classdef” classes.
You can use the publish button that is there on the publish tab in MATLAB or you can use the following code to generate HTML documentation.
% Specify the file or files to include in the documentation
fileToPublish = 'MyClass.m';
% Specify the output format and directory
outputFormat = 'html';
outputDir = 'output/docs';
% Generate the documentation
publish(fileToPublish, 'format', outputFormat, 'outputDir', outputDir);
Please find links to below documentation which I believe will help you for further reference.
- Publish: https://www.mathworks.com/help/matlab/ref/publish.html
- Display Custom Documentation for toolbox: https://www.mathworks.com/help/matlab/matlab_prog/display-custom-documentation.html
참고 항목
카테고리
Help Center 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!