diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 00000000..0a3b1864 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,23 @@ +# .readthedocs.yaml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details +--- +# Required +version: 2 + +# Set the version of Python and other tools you might need +build: + os: ubuntu-22.04 + tools: + python: "3.11" + +# Build documentation in the docs/ directory with Sphinx +sphinx: + configuration: docs/conf.py + +# We recommend specifying your dependencies to enable reproducible builds: +# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html +python: + install: + - requirements: docs/requirements.txt +... diff --git a/README.rst b/README.rst index e80cd971..560d308d 100644 --- a/README.rst +++ b/README.rst @@ -1,6 +1,8 @@ Introduction ============ +.. inclusion-marker-do-not-remove + PyGeoIf provides a `GeoJSON-like protocol `_ for geo-spatial (GIS) vector data. Other Python programs and packages that you may have heard of already diff --git a/docs/CONTRIBUTORS.txt b/docs/CONTRIBUTORS.rst similarity index 100% rename from docs/CONTRIBUTORS.txt rename to docs/CONTRIBUTORS.rst diff --git a/docs/HISTORY.txt b/docs/HISTORY.rst similarity index 100% rename from docs/HISTORY.txt rename to docs/HISTORY.rst diff --git a/docs/LICENSE.rst b/docs/LICENSE.rst new file mode 100644 index 00000000..d1fdccef --- /dev/null +++ b/docs/LICENSE.rst @@ -0,0 +1,21 @@ + +License +======= + +Copyright (C) 2012 - 2023 Christian Ledermann + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License (LGPL_) as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License (LGPL_) for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +.. _LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.0.en.html diff --git a/docs/LICENSE.txt b/docs/LICENSE.txt deleted file mode 100644 index d8d8473b..00000000 --- a/docs/LICENSE.txt +++ /dev/null @@ -1,19 +0,0 @@ - - Pygeoif is a basic implementation of the __geo_interface__ in - pure Python - - Copyright (C) 2012 - 2023 Christian Ledermann - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 00000000..d4bb2cbb --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = . +BUILDDIR = _build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 00000000..4f6f7022 --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,42 @@ +# noqa: D100, INP001 +# Configuration file for the Sphinx documentation builder. +# +# For the full list of built-in configuration values, see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information + +project = "pygeoif" +copyright = "2023, Christian Ledermann" # noqa: A001 +author = "Christian Ledermann" +release = "1.2" + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = [ + "sphinx.ext.duration", + "sphinx.ext.doctest", + "sphinx.ext.autodoc", + "sphinx.ext.autosummary", +] + +templates_path = ["_templates"] +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] + + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = "alabaster" +html_static_path = ["_static"] +try: + import sphinx_rtd_theme + + html_theme = "sphinx_rtd_theme" + html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] +except ImportError: + pass + +autodoc_member_order = "bysource" diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 00000000..986eb3c2 --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,24 @@ +.. pygeoif documentation master file, created by + sphinx-quickstart on Sun Oct 29 13:56:59 2023. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to pygeoif's documentation! +=================================== + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + overview + modules + HISTORY + CONTRIBUTORS + LICENSE + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 00000000..32bb2452 --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=. +set BUILDDIR=_build + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.https://www.sphinx-doc.org/ + exit /b 1 +) + +if "%1" == "" goto help + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/docs/modules.rst b/docs/modules.rst new file mode 100644 index 00000000..a2c8296b --- /dev/null +++ b/docs/modules.rst @@ -0,0 +1,10 @@ +API Reference +============= + +.. toctree:: + :maxdepth: 4 + + pygeoif + +.. autosummary:: + :toctree: generated diff --git a/docs/overview.rst b/docs/overview.rst new file mode 100644 index 00000000..75741435 --- /dev/null +++ b/docs/overview.rst @@ -0,0 +1,5 @@ +Overview +========= + +.. include:: ../README.rst + :start-after: inclusion-marker-do-not-remove diff --git a/docs/pygeoif.rst b/docs/pygeoif.rst new file mode 100644 index 00000000..024b062e --- /dev/null +++ b/docs/pygeoif.rst @@ -0,0 +1,67 @@ +pygeoif +======= + + +Module contents +--------------- + + +Submodules +---------- + +pygeoif.geometry module +----------------------- + +.. automodule:: pygeoif.geometry + :members: + :member-order: bysource + :undoc-members: + :show-inheritance: + +pygeoif.feature module +---------------------- + +.. automodule:: pygeoif.feature + :members: + :undoc-members: + :show-inheritance: + +pygeoif.factories module +------------------------ + +.. automodule:: pygeoif.factories + :members: + :undoc-members: + :show-inheritance: + +pygeoif.functions module +------------------------ + +.. automodule:: pygeoif.functions + :members: + :undoc-members: + :show-inheritance: + +pygeoif.exceptions module +------------------------- + +.. automodule:: pygeoif.exceptions + :members: + :undoc-members: + :show-inheritance: + +pygeoif.types module +-------------------- + +.. automodule:: pygeoif.types + :members: + :undoc-members: + :show-inheritance: + +pygeoif.about module +-------------------- + +.. automodule:: pygeoif.about + :members: + :undoc-members: + :special-members: __version__ diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 00000000..2cd888ca --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,3 @@ +sphinx +sphinx-autodoc-typehints +sphinx-rtd-theme