Skip to content

Commit

Permalink
Add Docs test action (#1)
Browse files Browse the repository at this point in the history
* Add Docs test action

Signed-off-by: jparisu <[email protected]>

* Fix some stuff

Signed-off-by: jparisu <[email protected]>

* Fix spelling

Signed-off-by: jparisu <[email protected]>

* Fix some docs stuff

Signed-off-by: jparisu <[email protected]>

* Final touches

Signed-off-by: jparisu <[email protected]>

---------

Signed-off-by: jparisu <[email protected]>
  • Loading branch information
jparisu authored Feb 1, 2024
1 parent 153ab38 commit 28ec0d5
Show file tree
Hide file tree
Showing 14 changed files with 112 additions and 42 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build and Test Documentation

on:
pull_request:
branches:
- main
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r docs/requirements.txt
- name: Build documentation
run: |
sphinx-build -b html docs/ docs/_build/html
- name: Documentation tests
run: |
sphinx-build -W --keep-going -b spelling docs/ docs/_build/spelling
5 changes: 4 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@
source_suffix = ['.rst', '.md']

# The master toctree document.
master_doc = 'index'
master_doc = 'rst/index'

# The spelling list filename.
spelling_word_list_filename=['spelling/spelling_wordlist.txt']
18 changes: 0 additions & 18 deletions docs/index.rst

This file was deleted.

25 changes: 25 additions & 0 deletions docs/rst/appendixes/glossary.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

.. _glossary:

########
Glossary
########

.. glossary::

Terrain
2D matrix of integers representing the height of a map at each cell.

Coordinate
A tuple of two integers ``(x,y)`` representing a cell in the terrain.

Path
A list of coordinates in the terrain.
To be correct, it must start in the origin, end in the destination, and each step must be adjacent to the previous one.

Cost
An integer number related with a path.
It represents a measure of the cost of the path in steps and climbs.

Path Finding Algorithm
A function that receives a terrain and returns a valid path.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. _installation:
.. _getting_started_installation:

############
Installation
Expand All @@ -10,7 +10,7 @@ Installation
Google Colab
============

Using :ref:`Google Colab <https://colab.google>` is the easiest way to get started.
Using `Google Colab <https://colab.google>`_ is the easiest way to get started.
Just add in the first cell of your notebook:

.. code-block:: python
Expand All @@ -31,7 +31,7 @@ Install in Windows Anaconda
In order to install the package in Windows Anaconda, the steps are the same as for :ref:`installation_googlecolab`.
The only detail is that ``git`` may not be installed by default in Anaconda.

From a command prompt, you can install it in a conda environment inside Anaconda:
From a command prompt, you can install it in a ``conda`` environment inside Anaconda:

.. code-block:: bash
Expand Down
8 changes: 4 additions & 4 deletions docs/src/tldr.rst → docs/rst/getting_started/tldr.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. _tldr:
.. _getting_started_tldr:

#####
TL;DR
Expand All @@ -12,9 +12,9 @@ This project helps you to generate 2D terrains, that are matrix of integers, wit
Over these terrains you have several features:

- You can print it in the console
- You can plot it in a matplotlib 2D plot
- You can plot it in a ``matplotlib`` 2D plot
- You can plot it in 3D with different angles
- **You can check the total path of a given path**
- **You can check the total length of a given path from origin to destination**
- You can even draw the paths in the plots previously mentioned


Expand All @@ -28,7 +28,7 @@ Just use the following command in your notebook:
!pip install git+https://github.com/jparisu/sIArena.git
Check the :ref:`installation guide <installation>` for more details.
Check the :ref:`installation guide <getting_started_installation>` for more details.


=========================
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. _tutorial:
.. _getting_started_tutorial:

########
Tutorial
Expand Down
35 changes: 35 additions & 0 deletions docs/rst/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@

.. toctree::
:caption: Introduction
:maxdepth: 2
:hidden:

/rst/titlepage


.. toctree::
:caption: Getting Started
:maxdepth: 2
:hidden:

/rst/getting_started/installation
/rst/getting_started/tutorial
/rst/getting_started/tldr


.. toctree::
:caption: Elements
:maxdepth: 2
:hidden:

/rst/elements/terrain
/rst/elements/measure
/rst/elements/generation


.. toctree::
:caption: Appendixes
:maxdepth: 2
:hidden:

/rst/appendixes/glossary
5 changes: 4 additions & 1 deletion docs/src/titlepage.rst → docs/rst/titlepage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,7 @@ This library is mainly written in *Python*.
Further reading
===============

To start using the library, please check the :ref:`getting_started` section.
To start using the library, please check the following links:

- :ref:`getting_started_installation`
- :ref:`getting_started_tutorial`
2 changes: 2 additions & 0 deletions docs/spelling/spelling_wordlist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
IArena
Colab
14 changes: 0 additions & 14 deletions docs/src/elements/elements.rst

This file was deleted.

0 comments on commit 28ec0d5

Please sign in to comment.