Skip to content

Commit

Permalink
Prepare release 0.21.0 (#229)
Browse files Browse the repository at this point in the history
  • Loading branch information
joeced authored Dec 16, 2023
1 parent 8da65a6 commit 93ab51e
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 11 deletions.
6 changes: 5 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
sphinxcontrib-matlabdomain-0.X.Y (2023-MM-DD)
sphinxcontrib-matlabdomain-0.21.0 (2023-12-16)
==============================================

* Allow ``matlab_src_dir`` to be a relative path of the ``conf.py`` file. See
`PR 224`_ and `PR 225`_.
* Fixed `Issue 220`. Parsing of property docstring could throw warning if there
were blank lines between comments.
* Fixed `Issue 221`. Using builtin's in class folder defintion for methods
Expand All @@ -10,6 +12,8 @@ sphinxcontrib-matlabdomain-0.X.Y (2023-MM-DD)
.. _Issue 220: https://github.com/sphinx-contrib/matlabdomain/issues/220
.. _Issue 221: https://github.com/sphinx-contrib/matlabdomain/issues/221
.. _Issue 225: https://github.com/sphinx-contrib/matlabdomain/issues/225
.. _PR 224: https://github.com/sphinx-contrib/matlabdomain/pull/224
.. _PR 225: https://github.com/sphinx-contrib/matlabdomain/pull/225


sphinxcontrib-matlabdomain-0.20.2 (2023-09-15)
Expand Down
6 changes: 3 additions & 3 deletions CITATION.bib
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ @software{jorgen_cederberg_2023_7747374
Marc-Henri Bleu-Laine and
Nikolaas N. Oosterhof and
ptitrex},
title = {sphinx-contrib/matlabdomain: 0.20.1},
month = sep,
title = {sphinx-contrib/matlabdomain: 0.21.0},
month = dec,
year = 2023,
publisher = {Zenodo},
version = {0.20.1},
version = {0.21.0},
doi = {10.5281/zenodo.7746009},
url = {https://github.com/sphinx-contrib/matlabdomain}
}
7 changes: 4 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@ Additional Configuration

``matlab_src_dir``
In order for the Sphinx MATLAB domain to auto-document MATLAB source code,
set the config value of ``matlab_src_dir`` to an absolute path. Currently
only one MATLAB path can be specified, but that folder and all the subfolders
in that tree will be searched.
set the config value of ``matlab_src_dir`` to an absolute path or a path
relative to the ``conf.py`` file. Currently only one MATLAB path can be
specified, but that folder and all the subfolders in that tree will be
searched.

``matlab_short_links``
Shorten all class, package and functions to the minimum length. This assumes
Expand Down
7 changes: 3 additions & 4 deletions sphinxcontrib/mat_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,12 @@ def analyze(app):
)
return

# Interpret `matlab_src_dir` relative to the sphinx source directory.
basedir = os.path.normpath(
os.path.join(app.env.srcdir, app.env.config.matlab_src_dir)
)
# Interpret `matlab_src_dir` relative to the `conf.py` file.
basedir = os.path.normpath(os.path.join(app.confdir, app.env.config.matlab_src_dir))
MatObject.basedir = basedir # set MatObject base directory
MatObject.sphinx_env = app.env # pass env to MatObject cls
MatObject.sphinx_app = app # pass app to MatObject cls

entities_table.clear()

# Set the root object and get root members.
Expand Down
15 changes: 15 additions & 0 deletions tests/test_autodoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,21 @@ def test_root(make_app, rootdir):
)


@pytest.mark.skipif(sys.version_info < (3, 6), reason="requires python3.6 or higher")
def test_root_relative_matlab_src_dir(make_app, rootdir):
srcdir = rootdir / "roots" / "test_autodoc"
confdict = {"matlab_src_dir": "."}
app = make_app(srcdir=srcdir, confoverrides=confdict)
app.builder.build_all()

content = pickle.loads((app.doctreedir / "index_root.doctree").read_bytes())
assert len(content) == 1
assert (
content[0].astext()
== "root\n\n\n\nclass BaseClass\n\nA class in the very root of the directory\n\nBaseClass Methods:\n\nBaseClass - the constructor, whose description extends\n\nto the next line\n\nDoBase - another BaseClass method\n\nSee Also\n\ntarget.ClassExample, baseFunction, ClassExample\n\nConstructor Summary\n\n\n\n\n\nBaseClass(obj, args)\n\nThe constructor\n\nMethod Summary\n\n\n\n\n\nDoBase()\n\nDo the Base thing\n\n\n\nbaseFunction(x)\n\nReturn the base of x\n\nSee Also:\n\ntarget.submodule.ClassMeow\ntarget.package.ClassBar\nClassMeow\npackage.ClassBar"
)


@pytest.mark.skipif(sys.version_info < (3, 6), reason="requires python3.6 or higher")
def test_root_show_default_value(make_app, rootdir):
srcdir = rootdir / "roots" / "test_autodoc"
Expand Down

0 comments on commit 93ab51e

Please sign in to comment.