New docs structure

This commit is contained in:
Darren Eberly
2022-07-07 00:24:52 -04:00
parent 62202b300b
commit c7d5f35bd0
26 changed files with 362 additions and 144 deletions

24
docs/api/common_types.rst Normal file
View File

@@ -0,0 +1,24 @@
.. _common_types_api:
Common Types
============
This module provides some common types used throughout PyTiled Parser. These are all just NamedTuple
classes provided to make sets of data more clear. As such they can be subscripted like a normal tuple
to get the same values, or you can reference them by name. The values shown here are in the order they
will be in the final tuple.
pytiled_parser.Color
^^^^^^^^^^^^^^^^^^^^
.. autoclass:: pytiled_parser.Color
pytiled_parser.OrderedPair
^^^^^^^^^^^^^^^^^^^^^^^^^^
.. autoclass:: pytiled_parser.OrderedPair
pytiled_parser.Size
^^^^^^^^^^^^^^^^^^^
.. autoclass:: pytiled_parser.Size

20
docs/api/index.rst Normal file
View File

@@ -0,0 +1,20 @@
.. _api:
API Reference
=============
This page documents the Application Programming Interface (API) for the PyTiled Parser library.
Throughout the API documentation you will see links labeled both TMX Reference and JSON Reference.
These links go to the official Tiled documentation for that specific type. Sometimes there is not a
one to one mapping, so it may lead to the closest thing in the Tiled format.
At some points certain classes modules may have links to other parts of the Tiled documentation which
cover some of the concepts surrounding that module and it's usage within Tiled.
.. toctree::
:maxdepth: 1
:caption: PyTiled Parser
common_types
properties
layer

48
docs/api/layer.rst Normal file
View File

@@ -0,0 +1,48 @@
.. _layer_api:
Layer
=====
This module provides classes for all layer types
There is the base Layer class, which TileLayer, ObjectLayer, ImageLayer,
and LayerGroup all derive from. The base Layer class is never directly used,
and serves only as an abstract base for common elements between all types.
For more information about Layers, see `Tiled's Manual <https://doc.mapeditor.org/en/stable/manual/layers/>`_
pytiled_parser.Layer
^^^^^^^^^^^^^^^^^^^^
.. autoclass:: pytiled_parser.Layer
:members:
pytiled_parser.TileLayer
^^^^^^^^^^^^^^^^^^^^^^^^
.. autoclass:: pytiled_parser.TileLayer
:members:
pytiled_parser.Chunk
^^^^^^^^^^^^^^^^^^^^
.. autoclass:: pytiled_parser.Chunk
:members:
pytiled_parser.ObjectLayer
^^^^^^^^^^^^^^^^^^^^^^^^^^
.. autoclass:: pytiled_parser.ObjectLayer
:members:
pytiled_parser.ImageLayer
^^^^^^^^^^^^^^^^^^^^^^^^^
.. autoclass:: pytiled_parser.ImageLayer
:members:
pytiled_parser.LayerGroup
^^^^^^^^^^^^^^^^^^^^^^^^^
.. autoclass:: pytiled_parser.LayerGroup
:members:

27
docs/api/properties.rst Normal file
View File

@@ -0,0 +1,27 @@
.. _properties_api:
Properties
==========
This module provides some common types used throughout PyTiled Parser. These are all just NamedTuple
classes provided to make sets of data more clear. As such they can be subscripted like a normal tuple
to get the same values, or you can reference them by name. The values shown here are in the order they
will be in the final tuple.
Properties do not have a special class or anything associated with them. They are simply type aliases for
built-in Python types.
pytiled_parser.Property
^^^^^^^^^^^^^^^^^^^^^^^
The ``pytiled_parser.Property`` type is a Union of the `float`, `str`, and `bool` built-in types, as well as
`Path` class from pathlib, and the `pytiled_parser.Color` common type.
A property may be any one of these types.
pytiled_parser.Properties
^^^^^^^^^^^^^^^^^^^^^^^^^
The ``pytiled_parser.Properties`` type is a Dictionary mapping of `str` to `pytiled_parser.Property` objects.
When the map is parsed, all properties will be loaded in as a Property, and stored in a Properties dictionary
with the name being it's key in the dictionary.