Skip to content

General options¤

show_bases¤

Show the base classes of a class.

in mkdocs.yml (global configuration)
plugins:
- mkdocstrings:
    handlers:
      matlab:
        options:
          show_bases: true
or in docs/some_page.md (local configuration)
::: matlab_callable
    options:
        show_bases: false
myClass.m
classdef myClass < myParent
    % Docstring of myClass.
end
Preview
::: myClass
    options:
        show_bases: true

myClass ¤

Bases: myParent

Docstring of myClass.

::: myClass
    options:
        show_bases: false

myClass ¤

Docstring of myClass.

show_inheritance_diagram¤

Show the inheritance diagram of a class using Mermaid.

With this option enabled, an inheritance diagram (as a flowchart) will be displayed after a class signature. Each node will act as a cross-reference and will bring you to the relevant class' documentation when clicking on it.

It should work out of the box with Material for MkDocs, but it is recommended to follow the setup guide for optimal support in Material for Mkdocs. For other themes, you must either setup mkdocs-mermaid2, or include Mermaid's Javascript code manually:

mkdocs.yml
extra_javascript:
- https://unpkg.com/[email protected]/dist/mermaid.min.js
in mkdocs.yml (global configuration)
plugins:
- mkdocstrings:
    handlers:
      matlab:
        options:
          show_inheritance_diagram: true
or in docs/some_page.md (local configuration)
::: matlab_callable
    options:
        show_inheritance_diagram: false
Source files
myClass.m
classdef myClass < myParent
    % Docstring of myClass.
end
myParent.m
classdef (Abstract) myParent < handle & double
    % An abstract class that defines the interface for a parent class
end
Preview
flowchart TB
   double[double]
   myClass[myClass]
   myParent[myParent]
   handle[handle]
   double --> myParent
   myParent --> myClass
   handle --> myParent

Docstring of myClass.

show_source¤

Show the source code of this object.

in mkdocs.yml (global configuration)
plugins:
- mkdocstrings:
    handlers:
      matlab:
        options:
          show_source: true
or in docs/some_page.md (local configuration)
::: matlab_callable
    options:
      show_source: false
myfunction.m
function myfunction(x)
    % Example function
    arguments
        x myClass % An instance of myClass
    end
end
Preview
::: myfunction
    options:
        show_source: true

myfunction(x) ¤

Example function

Parameters:

Name Type Description Default
x myClass

An instance of myClass

required
Source code in docs/snippets/myfunction.m
1
2
3
4
5
6
function myfunction(x)
    % Example function
    arguments
        x myClass % An instance of myClass
    end
end
::: myfunction
    options:
        show_source: false

myfunction(x) ¤

Example function

Parameters:

Name Type Description Default
x myClass

An instance of myClass

required