Closed cvergari closed 2 years ago
You are not doing anything wrong. This is by design. MATLAB documentation also works this way.
You can only write a docstring for the property itself.
Fair enough, thanks for the prompt answer!
However...why does get_x() ... how is this displayed?
appear in the example of matlabbuilder's documentation? Indeed, how is this displayed?
get_x
is not a property getter, that would have been get.x()
.
Ok so just to be clear the input function in this documentation and the compiled output do not correspond, right? In that case the example function could be updated to be consistent with the output, because this is exactly what I was trying to achieve, and it sounds like it is not possible:
properties
x % a property
end
function x = get.x(obj)
% how is this displayed?
x = obj.x
end
Thanks for the clarification!
Thanks for making me aware of this. The first is actually a bad example, I should clean that up. The second URL is from the original author - and not under my control.
Thanks to you for maintaining this excellent package! So at the moment, there is no way to document a class property because according to Matlab's design, one should add comment lines above the property definition. This renders in Matlab's help viewer:
classdef MyHandleClass < handle
properties
x
% y - This is a long documentation for y
% It should appear both in Matlab's help and in the HTML docs
% But only the first line appears
y % another info in y
end
methods
function x = get.x(obj)
% how is this displayed
x = obj.x
end
end
end
Matlab's help, when clicking on the property's name:
However, neither the long comment for y
nor the comment for x
appear in matlabbuilder's output.
Thanks. That feature was also requested in #125 :) . I think this could be next issue to do!
I am struggling with the documentation of get.property, which do not render correctly. Here is a minimal example from matlabdomain docs:
index.rst:
And MyHandleClass.m:
Renders like this:
So get.x is not rendered. I gather from the builder's documentation that "how is this displayed?" should show.
I found two ways to make this comment show: one was to remove "get." from the method, and remove "x" from the property list. Of course this would break the Matlab code, but it's just for testing. The second way is to leave "x" among the properties, and substitute "get.x(obj)" with "xy(obj)".
Which yields:
So I have a feeling that the property definition and the methods shadow each other.
Anyway: am I doing something wrong? I would like for both the property definition and the description of the getter method to appear in the documentation.