Skip to content

Commit

Permalink
Merge pull request #4 from maumueller/sphinx-build
Browse files Browse the repository at this point in the history
merging after rebase and successful CI run.
  • Loading branch information
maumueller authored Jul 28, 2020
2 parents 8f9db7c + 78eacc4 commit 9b8e534
Show file tree
Hide file tree
Showing 13 changed files with 959 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: check

on: [push]
on: [push, pull_request]

jobs:
build:
Expand Down Expand Up @@ -31,3 +31,9 @@ jobs:
- name: Typecheck
run: |
mypy
- name: Documentation
run: |
pip install sphinx
cd docs
mkdir _target && mkdir _static
sphinx-build . _target/
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
`itu.algs4` is a Python 3 port of the Java code in [Algorithms, 4th Edition](https://algs4.cs.princeton.edu/home/).

[![Build Status](https://github.com/itu-algorithms/itu.algs4/workflows/check/badge.svg)](https://github.com/itu-algorithms/itu.algs4/actions)
[![Documentation Status](https://readthedocs.org/projects/itualgs4/badge/?version=latest)](https://itualgs4.readthedocs.io/en/latest/?badge=latest)

## Target audience

Expand Down Expand Up @@ -137,6 +138,8 @@ from itu.algs4.graphs.edge_weighted_digraph import EdgeWeightedDigraph

## Documentation

The documentation can be found [here](https://itualgs4.readthedocs.io/en/latest/).

You can use Python's built-in `help` function on any package, sub-package, public class, or function to get a description of what it contains or does. This documentation should also show up in your IDE of choice.
For example `help(itu.algs4)` yields the following:

Expand Down
53 changes: 53 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# 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
sys.path.insert(0, os.path.abspath('../'))


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

project = 'itu.algs4'
copyright = '2020, ITU Algorithms Group'
author = 'ITU Algorithms Group'
master_doc = 'index'


# -- 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.
extensions = [ "sphinx.ext.autodoc"
]

# 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 = ['_build', 'Thumbs.db', '.DS_Store']


# -- 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 = 'alabaster'

# 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']
27 changes: 27 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.. itu.algs4 documentation master file, created by
sphinx-quickstart on Mon Jul 6 13:50:43 2020.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to itu.algs4's documentation!
=====================================

.. toctree::
:maxdepth: 2
:caption: Contents:

source/itu.algs4.fundamentals.rst
source/itu.algs4.graphs.rst
source/itu.algs4.searching.rst
source/itu.algs4.sorting.rst
source/itu.algs4.stdlib.rst
source/itu.algs4.strings.rst



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

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
3 changes: 3 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pygame
typing_extensions
color
22 changes: 22 additions & 0 deletions docs/source/itu.algs4.errors.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
itu.algs4.errors package
========================

Submodules
----------

itu.algs4.errors.errors module
------------------------------

.. automodule:: itu.algs4.errors.errors
:members:
:undoc-members:
:show-inheritance:


Module contents
---------------

.. automodule:: itu.algs4.errors
:members:
:undoc-members:
:show-inheritance:
94 changes: 94 additions & 0 deletions docs/source/itu.algs4.fundamentals.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
itu.algs4.fundamentals package
==============================

Submodules
----------

itu.algs4.fundamentals.bag module
---------------------------------

.. automodule:: itu.algs4.fundamentals.bag
:members:
:undoc-members:
:show-inheritance:

itu.algs4.fundamentals.binary\_search module
--------------------------------------------

.. automodule:: itu.algs4.fundamentals.binary_search
:members:
:undoc-members:
:show-inheritance:

itu.algs4.fundamentals.evaluate module
--------------------------------------

.. automodule:: itu.algs4.fundamentals.evaluate
:members:
:undoc-members:
:show-inheritance:

itu.algs4.fundamentals.java\_helper module
------------------------------------------

.. automodule:: itu.algs4.fundamentals.java_helper
:members:
:undoc-members:
:show-inheritance:

itu.algs4.fundamentals.queue module
-----------------------------------

.. automodule:: itu.algs4.fundamentals.queue
:members:
:undoc-members:
:show-inheritance:

itu.algs4.fundamentals.stack module
-----------------------------------

.. automodule:: itu.algs4.fundamentals.stack
:members:
:undoc-members:
:show-inheritance:

itu.algs4.fundamentals.three\_sum module
----------------------------------------

.. automodule:: itu.algs4.fundamentals.three_sum
:members:
:undoc-members:
:show-inheritance:

itu.algs4.fundamentals.three\_sum\_fast module
----------------------------------------------

.. automodule:: itu.algs4.fundamentals.three_sum_fast
:members:
:undoc-members:
:show-inheritance:

itu.algs4.fundamentals.two\_sum\_fast module
--------------------------------------------

.. automodule:: itu.algs4.fundamentals.two_sum_fast
:members:
:undoc-members:
:show-inheritance:

itu.algs4.fundamentals.uf module
--------------------------------

.. automodule:: itu.algs4.fundamentals.uf
:members:
:undoc-members:
:show-inheritance:


Module contents
---------------

.. automodule:: itu.algs4.fundamentals
:members:
:undoc-members:
:show-inheritance:
Loading

0 comments on commit 9b8e534

Please sign in to comment.