Skip to content

Commit

Permalink
Add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
TLCFEM committed Oct 20, 2024
1 parent 9adfc45 commit 3c89715
Show file tree
Hide file tree
Showing 7 changed files with 83 additions and 9 deletions.
3 changes: 3 additions & 0 deletions docs/.pages
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
nav:
- msglc.md
- API: api
3 changes: 3 additions & 0 deletions docs/api/LazyReader.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# LazyReader

::: msglc.reader.LazyReader
6 changes: 6 additions & 0 deletions docs/color_scheme.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[data-md-color-scheme="slate"] {
--md-primary-fg-color: #23252f;
--md-default-bg-color: #2e303e;
--md-typeset-a-color: #8e91aa;
--md-accent-fg-color: #658eda
}
2 changes: 2 additions & 0 deletions docs/msglc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# msglc

57 changes: 57 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
site_name: msglc
site_author: Theodore Chang
copyright: Copyright © 2024 Theodore Chang
repo_url: "https://github.com/TLCFEM/msglc"
theme:
name: material
features:
- navigation.tabs
- navigation.footer
palette:
- media: "(prefers-color-scheme: light)"
scheme: default
primary: white
accent: pink
toggle:
icon: material/lightbulb-outline
name: Turn off the lights
- media: "(prefers-color-scheme: dark)"
scheme: slate
toggle:
icon: material/lightbulb
name: Turn on the lights
extra_css:
- color_scheme.css
markdown_extensions:
- admonition
- pymdownx.arithmatex:
generic: true
- pymdownx.highlight:
linenums: true
anchor_linenums: true
use_pygments: true
auto_title: true
- pymdownx.betterem
- pymdownx.caret
- pymdownx.critic
- pymdownx.details
- pymdownx.inlinehilite
- pymdownx.keys
- pymdownx.mark
- pymdownx.smartsymbols
- pymdownx.superfences:
custom_fences:
- name: mermaid
class: mermaid
format: !!python/name:pymdownx.superfences.fence_code_format
- pymdownx.tilde
plugins:
- search
- awesome-pages
- mkdocstrings:
default_handler: python
handlers:
python:
options:
show_source: true
docstring_style: sphinx
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ dev = [
"pytest-benchmark",
"pytest-asyncio",
"ruff",
"mkdocs-material",
"mkdocs-awesome-pages-plugin",
"mkdocstrings[python]",
]
numpy = [
"numpy",
Expand Down
18 changes: 9 additions & 9 deletions src/msglc/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,17 +431,17 @@ def __init__(
Please inherit the `Unpacker` class from the `unpacker.py`.
There are already several unpackers available using different libraries.
.. highlight:: python
.. code-block:: python
class CustomUnpacker(Unpacker):
def decode(self, data: bytes):
# provide the decoding logic
...
with LazyReader("file.msg", unpacker=CustomUnpacker()) as reader:
# read the data
```py
class CustomUnpacker(Unpacker):
def decode(self, data: bytes):
# provide the decoding logic
...
with LazyReader("file.msg", unpacker=CustomUnpacker()) as reader:
# read the data
...
```
:param buffer_or_path: the buffer or path to the file
:param counter: the counter object for tracking the number of bytes read
:param cached: whether to cache the data
Expand Down

0 comments on commit 3c89715

Please sign in to comment.