Skip to content

Commit

Permalink
Add sphinx docs source (#56)
Browse files Browse the repository at this point in the history
Add comments as attributes of classes used instead of actual comments
  • Loading branch information
vishwakftw authored and prateekkumarweb committed Apr 30, 2019
1 parent 41a80d9 commit 904bba3
Show file tree
Hide file tree
Showing 12 changed files with 461 additions and 141 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,6 @@ content/contests/
content/tmp/*

# End of https://www.gitignore.io/api/django

# Docs
docs/build
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.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = PDP
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)
41 changes: 41 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# -*- coding: utf-8 -*-
# -- Path setup --------------------------------------------------------------

import os
import sys
import django
import sphinx_rtd_theme

sys.path.insert(0, os.path.abspath('../..'))

os.environ["DJANGO_SETTINGS_MODULE"] = "pdpjudge.settings"
django.setup()

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

project = 'PDP'
copyright = '2019, Vaibhav Sinha, Prateek Kumar, Vishwak Srinivasan'
author = 'Vaibhav Sinha, Prateek Kumar, Vishwak Srinivasan'

# The short X.Y version
version = ''
# The full version, including alpha/beta/rc tags
release = ''

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

extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.githubpages',
]

autodoc_member_order = 'bysource'
source_suffix = '.rst'
master_doc = 'index'
language = None

exclude_patterns = []
pygments_style = 'sphinx'

html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
28 changes: 28 additions & 0 deletions docs/source/forms.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Forms and input pre-processing
==============================

.. automodule:: judge.forms

.. autoclass:: NewContestForm
:members:

.. autoclass:: NewProblemForm
:members:

.. autoclass:: NewSubmissionForm
:members:

.. autoclass:: NewCommentForm
:members:

.. autoclass:: AddPersonToContestForm
:members:

.. autoclass:: AddTestCaseForm
:members:

.. autoclass:: EditProblemForm
:members:

.. autoclass:: DeletePersonFromContest
:members:
5 changes: 5 additions & 0 deletions docs/source/handler.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Handlers and database management
================================

.. automodule:: judge.handler
:members:
11 changes: 11 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Welcome to PDP's documentation!
===============================

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

models
forms
views
handler
40 changes: 40 additions & 0 deletions docs/source/models.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Models and Database Schema
==========================

.. automodule:: judge.models

.. autoclass:: Contest
:members:
:exclude-members: DoesNotExist, MultipleObjectsReturned

.. autoclass:: Problem
:members:
:exclude-members: DoesNotExist, MultipleObjectsReturned

.. autoclass:: Person
:members:
:exclude-members: DoesNotExist, MultipleObjectsReturned

.. autoclass:: ContestPerson
:members:
:exclude-members: DoesNotExist, MultipleObjectsReturned

.. autoclass:: Submission
:members:
:exclude-members: DoesNotExist, MultipleObjectsReturned

.. autoclass:: TestCase
:members:
:exclude-members: DoesNotExist, MultipleObjectsReturned

.. autoclass:: SubmissionTestCase
:members:
:exclude-members: DoesNotExist, MultipleObjectsReturned

.. autoclass:: Comment
:members:
:exclude-members: DoesNotExist, MultipleObjectsReturned

.. autoclass:: PersonProblemFinalScore
:members:
:exclude-members: DoesNotExist, MultipleObjectsReturned
5 changes: 5 additions & 0 deletions docs/source/views.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Views and page rendering
========================

.. automodule:: judge.views
:members:
Loading

0 comments on commit 904bba3

Please sign in to comment.