Skip to content

Commit

Permalink
Make docs slightly more uniform than before (#60)
Browse files Browse the repository at this point in the history
* Add subheadings for classes in models and forms

* Group functions in views and handler in docs

* Remove unnecessary spaces

* Clean up docs
  • Loading branch information
vishwakftw authored and prateekkumarweb committed May 2, 2019
1 parent 64161f9 commit c8a2694
Show file tree
Hide file tree
Showing 8 changed files with 294 additions and 124 deletions.
3 changes: 3 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@

html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
html_theme_options = {
'collapse_navigation': False
}
37 changes: 36 additions & 1 deletion docs/source/forms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,64 @@ Forms and input pre-processing

.. automodule:: judge.forms

Creation forms
--------------

NewContestForm
~~~~~~~~~~~~~~
.. autoclass:: NewContestForm
:members:

NewProblemForm
~~~~~~~~~~~~~~
.. autoclass:: NewProblemForm
:members:

NewSubmissionForm
~~~~~~~~~~~~~~~~~
.. autoclass:: NewSubmissionForm
:members:

NewCommentForm
~~~~~~~~~~~~~~
.. autoclass:: NewCommentForm
:members:

Extension forms
---------------

AddPersonToContestForm
~~~~~~~~~~~~~~~~~~~~~~
.. autoclass:: AddPersonToContestForm
:members:

AddTestCaseForm
~~~~~~~~~~~~~~~
.. autoclass:: AddTestCaseForm
:members:

AddPosterScoreForm
~~~~~~~~~~~~~~~~~~
.. autoclass:: AddPosterScoreForm
:members:

Updation forms
--------------

UpdateContestForm
~~~~~~~~~~~~~~~~~
.. autoclass:: UpdateContestForm
:members:

EditProblemForm
~~~~~~~~~~~~~~~
.. autoclass:: EditProblemForm
:members:

.. autoclass:: DeletePersonFromContest
Deletion forms
--------------

DeletePersonFromContestForm
~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. autoclass:: DeletePersonFromContestForm
:members:
48 changes: 47 additions & 1 deletion docs/source/handler.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,50 @@ Handlers and database management
================================

.. automodule:: judge.handler
:members:

Process Functions
-----------------

.. autofunction:: process_contest
.. autofunction:: process_problem
.. autofunction:: process_solution
.. autofunction:: process_testcase
.. autofunction:: process_person
.. autofunction:: process_comment

Addition Functions
------------------

.. autofunction:: add_person_to_contest
.. autofunction:: add_person_rgx_to_contest
.. autofunction:: add_persons_to_contest

Update Functions
----------------

.. autofunction:: update_problem
.. autofunction:: update_poster_score
.. autofunction:: update_leaderboard

Getter Functions
----------------

.. autofunction:: get_personcontest_permission
.. autofunction:: get_personproblem_permission
.. autofunction:: get_posters
.. autofunction:: get_participants
.. autofunction:: get_personcontest_score
.. autofunction:: get_submission_status
.. autofunction:: get_submission_status_mini
.. autofunction:: get_submissions
.. autofunction:: get_leaderboard
.. autofunction:: get_comments
.. autofunction:: get_csv

Deletion Functions
------------------

.. autofunction:: delete_contest
.. autofunction:: delete_problem
.. autofunction:: delete_testcase
.. autofunction:: delete_personcontest
36 changes: 30 additions & 6 deletions docs/source/models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,62 @@ Models and Database Schema

.. automodule:: judge.models

Base Models
-----------

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

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

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

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

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

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

.. autoclass:: SubmissionTestCase
Derived Models
--------------

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

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

PersonProblemFinalScore
~~~~~~~~~~~~~~~~~~~~~~~
.. autoclass:: PersonProblemFinalScore
:members:
:exclude-members: DoesNotExist, MultipleObjectsReturned
52 changes: 51 additions & 1 deletion docs/source/views.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,54 @@ Views and page rendering
========================

.. automodule:: judge.views
:members:

Default Views
-------------

.. autofunction:: index

.. autofunction:: handler404

.. autofunction:: handler500

Creation Views
--------------

.. autofunction:: new_contest
.. autofunction:: new_problem

Modification Views
------------------

.. autofunction:: edit_problem
.. autofunction:: add_person
.. autofunction:: add_poster
.. autofunction:: add_participant

Detail Views
------------

.. autofunction:: contest_detail
.. autofunction:: problem_detail
.. autofunction:: submission_detail
.. autofunction:: get_people
.. autofunction:: get_posters
.. autofunction:: get_participants
.. autofunction:: problem_submissions

Deletion Views
--------------

.. autofunction:: delete_contest
.. autofunction:: delete_problem
.. autofunction:: delete_testcase

Downloading Views
-----------------

.. autofunction:: contest_scores_csv
.. autofunction:: problem_starting_code
.. autofunction:: problem_compilation_script
.. autofunction:: problem_test_script
.. autofunction:: problem_default_script
.. autofunction:: submission_download
2 changes: 1 addition & 1 deletion judge/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class AddPersonToContestForm(forms.Form):
"""Email ID of the person"""


class DeletePersonFromContest(forms.Form):
class DeletePersonFromContestForm(forms.Form):
"""
Form to remove a Person from a Contest.
"""
Expand Down
Loading

0 comments on commit c8a2694

Please sign in to comment.