Skip to content

Commit

Permalink
Testing out a mermaid class diagram.
Browse files Browse the repository at this point in the history
  • Loading branch information
scott-griffiths committed Jan 29, 2025
1 parent 02511e9 commit 6bdf486
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
25 changes: 25 additions & 0 deletions doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,31 @@ included in each section.

For a more structured introduction to the library see the `Tour of bitformat <https://nbviewer.org/github/scott-griffiths/bitformat/blob/main/doc/bitformat_tour.ipynb>`_.

.. mermaid::

---
title: Classes in bitformat
---
classDiagram
class Bits {
}
class Dtype {
+ str name
+ int size
}
class FieldType{
+ str name
}
class Field{
+ Dtype dtype
+ Any value
}
class Format{
+ List[FieldType] fields
}
FieldType <|-- Field
FieldType <|-- Format

The Basics
----------
The :class:`Bits` and :class:`Dtype` classes are the most fundamental ones to use and understand.
Expand Down
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
author = "Scott Griffiths"
release = "0.2.0"

extensions = ["sphinx.ext.autodoc"]
extensions = ["sphinx.ext.autodoc", "sphinxcontrib.mermaid"]
autoapi_dirs = ["../bitformat/"]
autoapi_add_toctree_entry = False
autodoc_mock_imports = ["bitformat.bit_rust", "lark"]
Expand Down
1 change: 1 addition & 0 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
sphinx==8.1.3
piccolo-theme==0.24.0
sphinx-autoapi==3.3.2
sphinxcontrib-mermaid==1.0.0

0 comments on commit 6bdf486

Please # to comment.