Skip to content

Commit 1f3d512

Browse files
committed
docs
1 parent 1a5e4b2 commit 1f3d512

File tree

8 files changed

+156
-2
lines changed

8 files changed

+156
-2
lines changed

.readthedocs.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@ build:
1212

1313
# Build documentation in the "docs/" directory with Sphinx
1414
sphinx:
15-
configuration: docs/conf.py
15+
configuration: docs/source/conf.py
1616

1717
# Optionally, but recommended,
1818
# declare the Python requirements required to build your documentation
1919
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
2020
# python:
2121
# install:
2222
# - requirements: docs/requirements.txt
23-

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = source
9+
BUILDDIR = build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/make.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=source
11+
set BUILDDIR=build
12+
13+
if "%1" == "" goto help
14+
15+
%SPHINXBUILD% >NUL 2>NUL
16+
if errorlevel 9009 (
17+
echo.
18+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19+
echo.installed, then set the SPHINXBUILD environment variable to point
20+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
21+
echo.may add the Sphinx directory to PATH.
22+
echo.
23+
echo.If you don't have Sphinx installed, grab it from
24+
echo.http://sphinx-doc.org/
25+
exit /b 1
26+
)
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

docs/requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
sphinx==7.1.2
2+
sphinx-rtd-theme==1.3.0rc1

docs/source/api.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
API
2+
===
3+
4+
.. autosummary::
5+
:toctree: generated
6+
7+
lumache

docs/source/conf.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
3+
# -- Project information
4+
5+
project = 'Lumache'
6+
copyright = '2021, Graziella'
7+
author = 'Graziella'
8+
9+
release = '0.1'
10+
version = '0.1.0'
11+
12+
# -- General configuration
13+
14+
extensions = [
15+
'sphinx.ext.duration',
16+
'sphinx.ext.doctest',
17+
'sphinx.ext.autodoc',
18+
'sphinx.ext.autosummary',
19+
'sphinx.ext.intersphinx',
20+
]
21+
22+
intersphinx_mapping = {
23+
'python': ('https://docs.python.org/3/', None),
24+
'sphinx': ('https://www.sphinx-doc.org/en/master/', None),
25+
}
26+
intersphinx_disabled_domains = ['std']
27+
28+
templates_path = ['_templates']
29+
30+
# -- Options for HTML output
31+
32+
html_theme = 'sphinx_rtd_theme'
33+
34+
# -- Options for EPUB output
35+
epub_show_urls = 'footnote'

docs/source/index.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Welcome to Lumache's documentation!
2+
===================================
3+
4+
**Lumache** (/lu'make/) is a Python library for cooks and food lovers
5+
that creates recipes mixing random ingredients.
6+
It pulls data from the `Open Food Facts database <https://world.openfoodfacts.org/>`_
7+
and offers a *simple* and *intuitive* API.
8+
9+
Check out the :doc:`usage` section for further information, including
10+
how to :ref:`installation` the project.
11+
12+
.. note::
13+
14+
This project is under active development.
15+
16+
Contents
17+
--------
18+
19+
.. toctree::
20+
21+
usage
22+
api

docs/source/usage.rst

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Usage
2+
=====
3+
4+
.. _installation:
5+
6+
Installation
7+
------------
8+
9+
To use Lumache, first install it using pip:
10+
11+
.. code-block:: console
12+
13+
(.venv) $ pip install lumache
14+
15+
Creating recipes
16+
----------------
17+
18+
To retrieve a list of random ingredients,
19+
you can use the ``lumache.get_random_ingredients()`` function:
20+
21+
.. autofunction:: lumache.get_random_ingredients
22+
23+
The ``kind`` parameter should be either ``"meat"``, ``"fish"``,
24+
or ``"veggies"``. Otherwise, :py:func:`lumache.get_random_ingredients`
25+
will raise an exception.
26+
27+
.. autoexception:: lumache.InvalidKindError
28+
29+
For example:
30+
31+
>>> import lumache
32+
>>> lumache.get_random_ingredients()
33+
['shells', 'gorgonzola', 'parsley']
34+

0 commit comments

Comments
 (0)