在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):sphinx-contrib/matlabdomain开源软件地址(OpenSource Url):https://github.com/sphinx-contrib/matlabdomain开源编程语言(OpenSource Language):Python 81.2%开源软件介绍(OpenSource Introduction):
sphinxcontrib-matlabdomain -- Sphinx domain for auto-documenting MATLABThis extension provides a Sphinx domain for automatically generating doumentation from MATLAB source files. It is modelled after the Python autodoc. The extension allows you to have your documentation and source files together and use the powerful Sphinx documentation tool. All your MATLAB file help text can be automatically included in the your documentation and output as for instance HTML. The extension works really well with sphinx.ext.napoleon. Recent Changes. UsageThe Python package must be installed with: pip install -U sphinxcontrib-matlabdomain In general, the usage is the same as for documenting Python code. The package requires Python >= 3.6 and Sphinx >= 4.0.0. For a Python 2 compatible version the package must be installed with: pip install sphinxcontrib-matlabdomain==0.11.8 ConfigurationIn your Sphinx extensions = ['sphinxcontrib.matlab', 'sphinx.ext.autodoc'] Additional Configuration
For convenience the primary domain
can be set to Roles and DirectivesPlease see Sphinx Domains and sphinx.ext.autodoc for documentation on the use of roles and directives. MATLAB code can be documented using the following roles and directives:
Several options are available for auto-directives.
There are also several config values that can be set in
Note The module roles and directives create a psuedo namespace for MATLAB objects, similar to a package. They represent the path to the folder containing the MATLAB object. If no module is specified then Sphinx will assume that the object is a built-in. Example: given the following MATLAB source in folder classdef MyHandleClass < handle & my.super.Class % a handle class % % :param x: a variable %% some comments properties x % a property % Multiple lines before a % property can also be used y end methods function h = MyHandleClass(x) h.x = x end function x = get.x(obj) % how is this displayed? x = obj.x end end methods (Static) function w = my_static_function(z) % A static function in :class:`MyHandleClass`. % % :param z: input z % :returns: w w = z end end end Use the following to document: Test Data ========= This is the test data module. .. automodule:: test_data :mod:`test_data` is a really cool module. My Handle Class --------------- This is the handle class definition. .. autoclass:: MyHandleClass :show-inheritance: :members: Module IndexSince version 0.10.0 the MATLAB Module Index should be linked to with: `MATLAB Module Index <mat-modindex.html>`_ Older versions, used the Python Module Index, which was linked to with: :ref:`modindex` Documenting Python and MATLAB sources togetherSince version 0.10.0 MATLAB and Python sources can be (auto-)documented in the same Sphinx documentation. For this to work, do not set the primary domain. Instead use the .. automodule:: func .. autofunction:: func.main .. mat:automodule:: matsrc .. mat:autofunction:: matsrc.func Online DemoThe test docs in the repository are online here: http://bwanamarko.alwaysdata.net/matlabdomain/ Note Sphinx style markup are used to document parameters, types, returns and exceptions. There must be a blank comment line before and after the parameter descriptions. Currently property docstrings are only collected if they are on the same line following the property definition. Getter and setter methods are documented like methods currently, but the dot is replaced by an underscore. Default values for properties are represented as unicode strings, therefore strings will be double quoted. Users |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论