Skip to content

Commit

Permalink
chore: added support for read the docs / sphinx documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Guibod committed Feb 3, 2023
1 parent e29898b commit 323f234
Show file tree
Hide file tree
Showing 10 changed files with 653 additions and 6 deletions.
14 changes: 14 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

build:
os: ubuntu-22.04
tools:
python: "3.11"

sphinx:
configuration: docs/conf.py
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -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 = source
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)
23 changes: 23 additions & 0 deletions docs/source/_autosummary/mightstone.services.edhrec.EdhRecApi.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
mightstone.services.edhrec.EdhRecApi
====================================

.. currentmodule:: mightstone.services.edhrec

.. autoclass:: EdhRecApi


.. automethod:: __init__


.. rubric:: Methods

.. autosummary::

~EdhRecApi.__init__
~EdhRecApi.filter






Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
mightstone.services.edhrec.EdhRecStatic
=======================================

.. currentmodule:: mightstone.services.edhrec

.. autoclass:: EdhRecStatic


.. automethod:: __init__


.. rubric:: Methods

.. autosummary::

~EdhRecStatic.__init__
~EdhRecStatic.cards
~EdhRecStatic.combo
~EdhRecStatic.combos
~EdhRecStatic.commander
~EdhRecStatic.commanders
~EdhRecStatic.companions
~EdhRecStatic.partners
~EdhRecStatic.salt
~EdhRecStatic.sets
~EdhRecStatic.themes
~EdhRecStatic.top_cards
~EdhRecStatic.tribes






16 changes: 16 additions & 0 deletions docs/source/api_reference.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.. _api-reference:

API Reference
=============

Core Features
------------

.. automodule:: mightstone.services
:members:

EDHREC
------

.. automodule:: mightstone.services.edhrec
:members:
63 changes: 63 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys

import toml as toml

sys.path.insert(0, os.path.dirname(os.path.dirname((os.path.abspath(".")))))


# -- Project information -----------------------------------------------------

project = "mightstone"
copyright = "2022, Guillaume Boddaert"
author = "Guillaume Boddaert"
with open("../../pyproject.toml") as f:
release = toml.load(f)["tool"]["poetry"]["version"]
version = release

# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
master_doc = "index"
extensions = [
"sphinx.ext.autosummary",
"sphinx.ext.autodoc",
"sphinx.ext.napoleon",
"sphinx_rtd_theme",
"sphinxcontrib.autodoc_pydantic",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_rtd_theme"

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]
43 changes: 43 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
mightstone - A toolbox for anything Magic The Gathering related
================================================================

Mightstone is a package and a command line tool to interact with Magic The Gathering™️ resources online.

Installation
=============

You can install mightstone from PyPI using pip:

.. code::
pip install mightstone
Getting started
===============

For more information, check the :ref:`api-reference`.

.. toctree::
:maxdepth: 2
:hidden:

api_reference


Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

Acknowledgments
---------------

Mightstone is inspired by `mtgtools <https://github.com/EskoSalaka/mtgtools/>`_, by Esko-Kalervo Salaka

All the graphical and literal information and data related to Magic: The Gathering which can be handled with this software, such as card information and card images, is copyright © of Wizards of the Coast LLC, a Hasbro inc. subsidiary.
This software is in no way endorsed or promoted by Scryfall, magicthegathering.io or Wizards of the Coast.
This software is free and is created for the purpose of creating new Magic: The Gathering content and software, and just for fun.

0 comments on commit 323f234

Please sign in to comment.