Skip to content

Commit

Permalink
Add API reference (with mkdocstrings)
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsDrike committed Oct 18, 2024
1 parent a1ca0ac commit a20c994
Show file tree
Hide file tree
Showing 15 changed files with 235 additions and 1 deletion.
5 changes: 5 additions & 0 deletions docs/reference/private/abc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Utility Abstract Base Classes

These are some internal ABC classes that we utilize in various places.

::: mcproto.utils.abc
13 changes: 13 additions & 0 deletions docs/reference/private/authentication.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Internal components for authentication

These are the utility components related to / used in the authentication module.

<!-- TODO: https://github.com/mkdocstrings/mkdocstrings/discussions/699
-->

::: mcproto.auth.msa.MSAAccount
options:
show_root_heading: true
show_root_toc_entry: true
filters:
- "^_[^_]"
3 changes: 3 additions & 0 deletions docs/reference/private/deprecation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Deprecation utilities

::: mcproto.utils.deprecation
11 changes: 11 additions & 0 deletions docs/reference/private/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Private API Reference

This is the reference documentation page for **private** mcproto API.

!!! warning

Private here means that the functions/classes documented here are only meant to be used internally by the library,
**you shouldn't use these in your code** if you're just a user of this library. This page is here mainly as a
reference for contributors and for providing proper linkable references. The backwards compatibility of these
components will not be guarranteed, which means breaking changes may be introduced between patch versinos without
any warnings.
5 changes: 5 additions & 0 deletions docs/reference/private/protocol.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Internal components for protocol

These are the utility components related to / used in the protocol module.

::: mcproto.protocol.utils
9 changes: 9 additions & 0 deletions docs/reference/private/types.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Internal components for types

These are the utility components related to / used in the types module.

::: mcproto.types.nbt
options:
show_submodules: true
filters:
- "^_[^_]"
11 changes: 11 additions & 0 deletions docs/reference/public/authentication.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Authentication

::: mcproto.auth.account

::: mcproto.auth.yggdrasil

::: mcproto.auth.msa

::: mcproto.auth.microsoft.oauth

::: mcproto.auth.microsoft.xbox
6 changes: 6 additions & 0 deletions docs/reference/public/encryption.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Encryption utilities

The following components are used for encryption related interacions (generally needed during the communication with
the server, after an encryption request during the login process)

::: mcproto.encryption
5 changes: 5 additions & 0 deletions docs/reference/public/multiplayer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Multiplayer utilities

The following components are used for various multiplayer interacions (generally needed during the server joining process).

::: mcproto.multiplayer
35 changes: 35 additions & 0 deletions docs/reference/public/packets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Packets

## Base classes and interaction functions

::: mcproto.packets
options:
heading_level: 3

## Handshaking gamestate

::: mcproto.packets.handshaking.handshake
options:
heading_level: 3

## Status gamestate

::: mcproto.packets.status.ping
options:
heading_level: 3

::: mcproto.packets.status.status
options:
heading_level: 3

## Login gamestate

::: mcproto.packets.login.login
options:
heading_level: 3

## Play gamestate

!!! bug "Work In Progress"

Packets for the Play gamestate aren't yet implemented.
9 changes: 9 additions & 0 deletions docs/reference/public/protocol.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Protocol documentation

This is the documentation for components related to interactions with the minecraft protocol and connection establishing.

::: mcproto.protocol.base_io

::: mcproto.buffer.Buffer

::: mcproto.connection
5 changes: 5 additions & 0 deletions docs/reference/public/types.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Types

::: mcproto.types
options:
show_submodules: true
42 changes: 42 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,20 @@ nav:
- Great commits: contributing/guides/great-commits.md
- Unit Tests: contributing/guides/unit-tests.md
- Deprecations: contributing/guides/deprecations.md
- API Reference:
- Protocol: reference/public/protocol.md
- Authentication: reference/public/authentication.md
- Encryption: reference/public/encryption.md
- Multiplayer: reference/public/multiplayer.md
- Types: reference/public/types.md
- Packets: reference/public/packets.md
- Private API Reference:
- reference/private/index.md
- ABCs: reference/private/abc.md
- Deprecation: reference/private/deprecation.md
- Authentication: reference/private/authentication.md
- Protocol: reference/private/protocol.md
- Types: reference/private/types.md

theme:
name: material
Expand Down Expand Up @@ -105,6 +119,34 @@ plugins:
- mike:
canonical_version: "latest"
version_selector: true
- mkdocstrings:
enable_inventory: true
default_handler: python
handlers:
python:
options:
docstring_options:
ignore_init_summary: true
show_root_heading: false
show_root_toc_entry: false
show_source: false
docstring_style: sphinx
relative_crossrefs: true
scoped_crossrefs: true
show_signature_annotations: true
signature_crossrefs: true
separate_signature: true
show_symbol_type_heading: true
show_symbol_type_toc: true
parameter_headings: true
show_object_full_path: true
docstring_section_style: table
import:
- url: https://docs.python.org/3.13/objects.inv
domains: [std, py]
- https://typing-extensions.readthedocs.io/en/latest/objects.inv
- https://cryptography.io/en/stable/objects.inv
- https://python-semanticversion.readthedocs.io/en/stable/objects.inv

extra:
version:
Expand Down
76 changes: 75 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ mkdocs-material = "^9.5.30"
mike = "^2.1.2"
markdown-exec = { extras = ["ansi"], version = "^1.9.3" }
towncrier = "==24.7.1"
mkdocstrings-python = { version = "^1.12.1", python = ">3.9,<4" }

[tool.poetry.group.docs-ci]
optional = true
Expand Down

0 comments on commit a20c994

Please sign in to comment.