Skip to content

Commit

Permalink
Improve the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Josef-Friedrich committed Jan 27, 2024
1 parent 874996a commit 05e22fe
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 23 deletions.
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.viewcode",
"sphinxcontrib.jquery",
]
templates_path: list[str] = ["_templates"]
source_suffix = ".rst"
Expand Down
10 changes: 10 additions & 0 deletions docs/other-submodules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ mscxyz.cli module

.. automodule:: mscxyz.cli

mscxyz.export module
^^^^^^^^^^^^^^^^^^^^

.. automodule:: mscxyz.export

mscxyz.fields module
^^^^^^^^^^^^^^^^^^^^

.. automodule:: mscxyz.fields

mscxyz.rename module
^^^^^^^^^^^^^^^^^^^^

Expand Down
46 changes: 23 additions & 23 deletions mscxyz/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ class Vbox:
.. code-block:: xml
<Staff id="1">
<VBox>
<Vbox>
<height>10</height>
<Text>
<style>Title</style>
Expand All @@ -410,7 +410,7 @@ class Vbox:
<style>Composer</style>
<text>Composer</text>
</Text>
</VBox>
</Vbox>
</Staff>
Expand All @@ -419,7 +419,7 @@ class Vbox:
.. code-block:: xml
<Staff id="1">
<VBox>
<Vbox>
<height>10</height>
<boxAutoSize>0</boxAutoSize>
<eid>4294967418</eid>
Expand All @@ -433,7 +433,7 @@ class Vbox:
<style>composer</style>
<text>Composer</text>
</Text>
</VBox>
</Vbox>
</Staff>
"""

Expand All @@ -455,9 +455,9 @@ def __init__(self, score: "Score") -> None:
self.xml_root = score.xml_root
xpath = '/museScore/Score/Staff[@id="1"]'

vbox = self.score.xml.xpath(xpath + "/VBox")
vbox = self.score.xml.xpath(xpath + "/Vbox")
if vbox is None:
vbox, _ = self.score.xml.create_sub_element("VBox", "height", "10")
vbox, _ = self.score.xml.create_sub_element("Vbox", "height", "10")

self.score.xml.xpath_safe(xpath).insert(0, vbox)
self.vbox = vbox
Expand Down Expand Up @@ -566,7 +566,7 @@ def title(self) -> str | None:
.. code-block:: xml
<Staff id="1">
<VBox>
<Vbox>
<height>10</height>
<boxAutoSize>0</boxAutoSize>
<eid>4294967418</eid>
Expand All @@ -575,7 +575,7 @@ def title(self) -> str | None:
<style>title</style>
<text>Mondscheinsonate</text>
</Text>
</VBox>
</Vbox>
</Staff>
"""
return self.__get_text("title")
Expand All @@ -592,7 +592,7 @@ def subtitle(self) -> str | None:
.. code-block:: xml
<Staff id="1">
<VBox>
<Vbox>
<height>10</height>
<boxAutoSize>0</boxAutoSize>
<eid>4294967418</eid>
Expand All @@ -601,7 +601,7 @@ def subtitle(self) -> str | None:
<style>subtitle</style>
<text>1. Satz</text>
</Text>
</VBox>
</Vbox>
</Staff>
"""
return self.__get_text("subtitle")
Expand All @@ -618,7 +618,7 @@ def composer(self) -> str | None:
.. code-block:: xml
<Staff id="1">
<VBox>
<Vbox>
<height>10</height>
<boxAutoSize>0</boxAutoSize>
<eid>4294967418</eid>
Expand All @@ -627,7 +627,7 @@ def composer(self) -> str | None:
<style>composer</style>
<text>Ludwig van Beethoven</text>
</Text>
</VBox>
</Vbox>
</Staff>
"""
return self.__get_text("composer")
Expand All @@ -644,7 +644,7 @@ def lyricist(self) -> str | None:
.. code-block:: xml
<Staff id="1">
<VBox>
<Vbox>
<height>10</height>
<boxAutoSize>0</boxAutoSize>
<eid>4294967418</eid>
Expand All @@ -653,7 +653,7 @@ def lyricist(self) -> str | None:
<style>lyricist</style>
<text>Johann Wolfgang von Goethe</text>
</Text>
</VBox>
</Vbox>
</Staff>
"""
return self.__get_text("lyricist")
Expand Down Expand Up @@ -728,7 +728,7 @@ def reload(self, save: bool = False) -> Meta:
:return: The reloaded Meta object.
:see: :meth:`mscxyz.score.Score.reload`
:see: :meth:`mscxyz.Score.reload`
"""
return self.score.reload(save).meta

Expand All @@ -741,9 +741,9 @@ def __pick_value(self, *values: str | None) -> str | None:
@property
def title(self) -> str | None:
"""
Get and set the value of :attr:`VBox.title` and :attr:`Metatag.work_title` all at once.
Get and set the value of :attr:`Vbox.title` and :attr:`Metatag.work_title` all at once.
If the attributes have different values, then the attribute :attr:`VBox.title` is preferred.
If the attributes have different values, then the attribute :attr:`Vbox.title` is preferred.
"""
return self.__pick_value(self.vbox.title, self.metatag.work_title)

Expand All @@ -754,9 +754,9 @@ def title(self, value: str | None) -> None:
@property
def subtitle(self) -> str | None:
"""
Get and set the value of :attr:`VBox.subtitle`, :attr:`Metatag.subtitle` and :attr:`Metatag.movement_title` all at once.
Get and set the value of :attr:`Vbox.subtitle`, :attr:`Metatag.subtitle` and :attr:`Metatag.movement_title` all at once.
If the attributes have different values, then the attribute :attr:`VBox.subtitle` is preferred.
If the attributes have different values, then the attribute :attr:`Vbox.subtitle` is preferred.
"""
return self.__pick_value(
self.vbox.subtitle, self.metatag.subtitle, self.metatag.movement_title
Expand All @@ -769,9 +769,9 @@ def subtitle(self, value: str | None) -> None:
@property
def composer(self) -> str | None:
"""
Get and set the value of :attr:`VBox.composer` and :attr:`Metatag.composer` all at once.
Get and set the value of :attr:`Vbox.composer` and :attr:`Metatag.composer` all at once.
If the attributes have different values, then the attribute :attr:`VBox.composer` is preferred.
If the attributes have different values, then the attribute :attr:`Vbox.composer` is preferred.
"""
return self.__pick_value(self.vbox.composer, self.metatag.composer)

Expand All @@ -782,9 +782,9 @@ def composer(self, value: str | None) -> None:
@property
def lyricist(self) -> str | None:
"""
Get and set the value of :attr:`VBox.lyricist` and :attr:`Metatag.lyricist` all at once.
Get and set the value of :attr:`Vbox.lyricist` and :attr:`Metatag.lyricist` all at once.
If the attributes have different values, then the attribute :attr:`VBox.lyricist` is preferred.
If the attributes have different values, then the attribute :attr:`Vbox.lyricist` is preferred.
"""
return self.__pick_value(self.vbox.lyricist, self.metatag.lyricist)

Expand Down

0 comments on commit 05e22fe

Please sign in to comment.