Publish class method when using separate files
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I would like to publish my documentation to HTML using publish. I am using a package namespace, and classes with methods in separate files.
I am able to publish the class documentation using the syntax:
publish('namespace.ClassName','format','html','outputDir','helpfiles','evalCode', false,'showCode',false);
However, I can't seem to publish the documentation for the class method (which is contained in a separate file). If I call:
publish('namespace.ClassName.methodName','format','html','outputDir','helpfiles','evalCode', false,'showCode',false);
I get:
Error using publish
Unable to find "namespace.ClassName.methodName".
However, this call works correctly:
help namespace.ClassName.methodName
How can I publish the method documentation?
0 commentaires
Réponses (1)
Ishu
le 7 Fév 2024
Hi Bradley,
The "publish" function is typically used to convert scripts that contain markup into formatted documents, such as HTML, LaTeX, or Markdown. It's not directly intended for publishing class method documentation. However, if you want to publish documentation for a class method, you can create a separate script that includes the call to the method and its documentation, and then publish that script.
Create a file publish_method.m :
% PUBLISH_METHOD - This script is used to publish documentation for a specific method
% Create an object of your class
obj = namespace.ClassName();
% Call the method
result = obj.methodName();
% Describe the output or behavior
disp('Method Publish file');
To publish the script run below command:
publish('publish_method','format','html','outputDir','helpfiles','evalCode',false,'showCode',false);
For more information on "publish" refer to the below documentation:
Hope it helps!
0 commentaires
Voir également
Catégories
En savoir plus sur Software Development Tools dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!