From 0848a22a7389e057d60b2fb0a24bc13a95ab8855 Mon Sep 17 00:00:00 2001 From: Simeon Warner Date: Wed, 6 Nov 2024 14:17:54 -0500 Subject: [PATCH] Doc tweaks --- docs/api.rst | 3 ++- docs/conf.py | 4 +++- docs/ocfl.inventory.rst | 10 ++++++++++ docs/ocfl.storage_root.rst | 7 +++++++ ocfl/inventory.py | 2 +- ocfl/object.py | 3 +-- 6 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 docs/ocfl.inventory.rst create mode 100644 docs/ocfl.storage_root.rst diff --git a/docs/api.rst b/docs/api.rst index 62824a7..9f43f73 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -10,4 +10,5 @@ functions. ocfl ocfl.object - + ocfl.storage_root + ocfl.inventory diff --git a/docs/conf.py b/docs/conf.py index baa7cf4..8aa3f9c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -23,6 +23,7 @@ "sphinx.ext.autodoc", "sphinx.ext.autosummary", "sphinx.ext.doctest", + "sphinx.ext.napoleon", "sphinx_rtd_theme"] myst_enable_extensions = ["colon_fence"] @@ -41,5 +42,6 @@ # Autodoc autodoc_default_options = { - "autoclass_content": "both" + "autoclass_content": "both", # doesn't work to show __init__ docs?? + 'special-members': '__init__' # get __init__ to show explicitly } diff --git a/docs/ocfl.inventory.rst b/docs/ocfl.inventory.rst new file mode 100644 index 0000000..7d2ef63 --- /dev/null +++ b/docs/ocfl.inventory.rst @@ -0,0 +1,10 @@ +``ocfl.inventory`` +================== + +.. automodule:: ocfl.inventory + +.. autoclass:: Inventory + :members: + +.. autoclass:: Version + :members: diff --git a/docs/ocfl.storage_root.rst b/docs/ocfl.storage_root.rst new file mode 100644 index 0000000..c127100 --- /dev/null +++ b/docs/ocfl.storage_root.rst @@ -0,0 +1,7 @@ +``ocfl.storage_root`` +===================== + +.. automodule:: ocfl.storage_root + +.. autoclass:: StorageRoot + :members: diff --git a/ocfl/inventory.py b/ocfl/inventory.py index 27a8cd7..c60d54a 100644 --- a/ocfl/inventory.py +++ b/ocfl/inventory.py @@ -30,7 +30,7 @@ class Inventory(): # pylint: disable=too-many-public-methods be an array or a dict, then and empty array or empty dict are returned if not present in the underlying data. - Instance attributes: + Attributes: data: dict that is the top level JSON object of the parsed JSON representation of the inventory file. This is the only place that an Inventory instance stores information. diff --git a/ocfl/object.py b/ocfl/object.py index 582eb48..544c8df 100755 --- a/ocfl/object.py +++ b/ocfl/object.py @@ -65,7 +65,7 @@ def __init__(self, *, identifier=None, content_directory="content", obj_fs=None, path=None, create=False): """Initialize OCFL object. - Arguments relevant to building an object: + Arguments: identifier: id for this object content_directory: allow override of the default "content" digest_algorithm: allow override of the default "sha512" @@ -83,7 +83,6 @@ def __init__(self, *, identifier=None, content_directory="content", specification for fixity and to allow non-preferred digest algorithms for content references in the object fixity: list of fixity types to add as fixity section - obj_fs: a pyfs filesystem reference for the root of this object path: if set then open a pyfs filesystem at path (alternative to obj_fs) create: set True to allow opening filesystem at path to create a directory