From b4f0554fc3d7fd44e5d1ab22f7801029ce1a521d Mon Sep 17 00:00:00 2001 From: Perimetro20 Date: Thu, 19 Jan 2017 18:33:53 -0600 Subject: [PATCH 1/5] Relationship between student and his cards for spaced repetition completed --- ProjectStud/settings/base.py | 3 +- .../migrations/0002_auto_20170120_0032.py | 29 +++++++++++++++ .../migrations/0003_auto_20170120_0032.py | 35 +++++++++++++++++++ spaced_repetition/models.py | 11 +++--- user_profiles/__init__.py | 0 user_profiles/admin.py | 3 ++ user_profiles/apps.py | 5 +++ user_profiles/migrations/0001_initial.py | 28 +++++++++++++++ user_profiles/migrations/__init__.py | 0 user_profiles/models.py | 7 ++++ user_profiles/tests.py | 3 ++ 11 files changed, 119 insertions(+), 5 deletions(-) create mode 100644 spaced_repetition/migrations/0002_auto_20170120_0032.py create mode 100644 spaced_repetition/migrations/0003_auto_20170120_0032.py create mode 100644 user_profiles/__init__.py create mode 100644 user_profiles/admin.py create mode 100644 user_profiles/apps.py create mode 100644 user_profiles/migrations/0001_initial.py create mode 100644 user_profiles/migrations/__init__.py create mode 100644 user_profiles/models.py create mode 100644 user_profiles/tests.py diff --git a/ProjectStud/settings/base.py b/ProjectStud/settings/base.py index 87c3a3f..04452d5 100644 --- a/ProjectStud/settings/base.py +++ b/ProjectStud/settings/base.py @@ -39,7 +39,8 @@ 'social.apps.django_app.default', 'base.apps.BaseConfig', 'tosp_auth.apps.TospAuthConfig', - 'spaced_repetition.apps.SpacedRepetitionConfig' + 'spaced_repetition.apps.SpacedRepetitionConfig', + 'user_profiles.apps.UserProfilesConfig' ] MIDDLEWARE = [ diff --git a/spaced_repetition/migrations/0002_auto_20170120_0032.py b/spaced_repetition/migrations/0002_auto_20170120_0032.py new file mode 100644 index 0000000..6af2c82 --- /dev/null +++ b/spaced_repetition/migrations/0002_auto_20170120_0032.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.2 on 2017-01-20 00:32 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('spaced_repetition', '0001_initial'), + ] + + operations = [ + migrations.RenameField( + model_name='deck', + old_name='parent', + new_name='parent_directory', + ), + migrations.RenameField( + model_name='folder', + old_name='parent', + new_name='parent_directory', + ), + migrations.RemoveField( + model_name='deck', + name='user', + ), + ] diff --git a/spaced_repetition/migrations/0003_auto_20170120_0032.py b/spaced_repetition/migrations/0003_auto_20170120_0032.py new file mode 100644 index 0000000..4f8301d --- /dev/null +++ b/spaced_repetition/migrations/0003_auto_20170120_0032.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.2 on 2017-01-20 00:32 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('user_profiles', '0001_initial'), + ('spaced_repetition', '0002_auto_20170120_0032'), + ] + + operations = [ + migrations.AddField( + model_name='card', + name='owner', + field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='user_profiles.Student'), + preserve_default=False, + ), + migrations.AddField( + model_name='deck', + name='owner', + field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='user_profiles.Student'), + preserve_default=False, + ), + migrations.AddField( + model_name='folder', + name='owner', + field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='user_profiles.Student'), + preserve_default=False, + ), + ] diff --git a/spaced_repetition/models.py b/spaced_repetition/models.py index 335e171..e53615d 100644 --- a/spaced_repetition/models.py +++ b/spaced_repetition/models.py @@ -1,23 +1,26 @@ import datetime from django.db import models -from django.contrib.auth.models import User + +from user_profiles.models import Student class Folder(models.Model): - parent = models.ForeignKey('self') + owner = models.ForeignKey(Student) + parent_directory = models.ForeignKey('self') created_at = models.DateTimeField(auto_now_add=True) updated_at = models.DateTimeField(auto_now=True) class Deck(models.Model): - user = models.ForeignKey(User) - parent = models.ForeignKey(Folder) + owner = models.ForeignKey(Student) + parent_directory = models.ForeignKey(Folder) name = models.DateTimeField(max_length=250) created_at = models.DateTimeField(auto_now_add=True) updated_at = models.DateTimeField(auto_now=True) class Card(models.Model): + owner = models.ForeignKey(Student) deck = models.ForeignKey(Deck) question = models.CharField(max_length=300) answer = models.CharField(max_length=750) diff --git a/user_profiles/__init__.py b/user_profiles/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/user_profiles/admin.py b/user_profiles/admin.py new file mode 100644 index 0000000..4185d36 --- /dev/null +++ b/user_profiles/admin.py @@ -0,0 +1,3 @@ +# from django.contrib import admin + +# Register your models here. diff --git a/user_profiles/apps.py b/user_profiles/apps.py new file mode 100644 index 0000000..4993900 --- /dev/null +++ b/user_profiles/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class UserProfilesConfig(AppConfig): + name = 'user_profiles' diff --git a/user_profiles/migrations/0001_initial.py b/user_profiles/migrations/0001_initial.py new file mode 100644 index 0000000..6c7296c --- /dev/null +++ b/user_profiles/migrations/0001_initial.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.2 on 2017-01-20 00:32 +from __future__ import unicode_literals + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('spaced_repetition', '0002_auto_20170120_0032'), + ] + + operations = [ + migrations.CreateModel( + name='Student', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('home_directory', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='spaced_repetition.Folder')), + ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ], + ), + ] diff --git a/user_profiles/migrations/__init__.py b/user_profiles/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/user_profiles/models.py b/user_profiles/models.py new file mode 100644 index 0000000..081fdbb --- /dev/null +++ b/user_profiles/models.py @@ -0,0 +1,7 @@ +from django.db import models +from django.contrib.auth.models import User + + +class Student(models.Model): + user = models.OneToOneField(User, on_delete=models.CASCADE) + home_directory = models.OneToOneField('spaced_repetition.Folder') \ No newline at end of file diff --git a/user_profiles/tests.py b/user_profiles/tests.py new file mode 100644 index 0000000..a79ca8b --- /dev/null +++ b/user_profiles/tests.py @@ -0,0 +1,3 @@ +# from django.test import TestCase + +# Create your tests here. From 74657072563a77205662c85011a93432c0eb8b23 Mon Sep 17 00:00:00 2001 From: Perimetro20 Date: Thu, 19 Jan 2017 19:58:00 -0600 Subject: [PATCH 2/5] Fixed the problems with flake8 compliance --- user_profiles/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user_profiles/models.py b/user_profiles/models.py index 081fdbb..615d1df 100644 --- a/user_profiles/models.py +++ b/user_profiles/models.py @@ -3,5 +3,5 @@ class Student(models.Model): - user = models.OneToOneField(User, on_delete=models.CASCADE) - home_directory = models.OneToOneField('spaced_repetition.Folder') \ No newline at end of file + user = models.OneToOneField(User, on_delete=models.CASCADE) + home_directory = models.OneToOneField('spaced_repetition.Folder') From 039b7c9d9abe7ea45d442841b8d69d3c8d883716 Mon Sep 17 00:00:00 2001 From: Perimetro20 Date: Tue, 31 Jan 2017 23:29:48 -0600 Subject: [PATCH 3/5] Automatic creation of the student profile, as well as a home_directory when a new user is created is fully implemented, and tested. Still missing documentation. --- spaced_repetition/admin.py | 37 ++++++++++++++++++- .../migrations/0004_auto_20170201_0026.py | 26 +++++++++++++ .../migrations/0005_auto_20170201_0222.py | 26 +++++++++++++ .../migrations/0006_auto_20170201_0224.py | 21 +++++++++++ .../migrations/0007_auto_20170201_0318.py | 26 +++++++++++++ spaced_repetition/models.py | 19 ++++++---- user_profiles/admin.py | 10 ++++- user_profiles/models.py | 28 +++++++++++++- user_profiles/tests.py | 22 ++++++++++- 9 files changed, 201 insertions(+), 14 deletions(-) create mode 100644 spaced_repetition/migrations/0004_auto_20170201_0026.py create mode 100644 spaced_repetition/migrations/0005_auto_20170201_0222.py create mode 100644 spaced_repetition/migrations/0006_auto_20170201_0224.py create mode 100644 spaced_repetition/migrations/0007_auto_20170201_0318.py diff --git a/spaced_repetition/admin.py b/spaced_repetition/admin.py index 4185d36..4ca090e 100644 --- a/spaced_repetition/admin.py +++ b/spaced_repetition/admin.py @@ -1,3 +1,36 @@ -# from django.contrib import admin +from django.contrib import admin -# Register your models here. +from .models import Folder, Deck, Card + + +class FolderAdmin(admin.ModelAdmin): + list_display = ('name', 'owner', 'created_at', 'updated_at') + +admin.site.register(Folder, FolderAdmin) + + +class DeckAdmin(admin.ModelAdmin): + list_display = ( + 'name', + 'parent_directory', + 'owner', + 'created_at', + 'updated_at' + ) + +admin.site.register(Deck, DeckAdmin) + + +class CardAdmin(admin.ModelAdmin): + list_display = ( + 'question', + 'answer', + 'deck', + 'box', + 'last_studied', + 'owner', + 'created_at', + 'updated_at' + ) + +admin.site.register(Card, CardAdmin) diff --git a/spaced_repetition/migrations/0004_auto_20170201_0026.py b/spaced_repetition/migrations/0004_auto_20170201_0026.py new file mode 100644 index 0000000..338da70 --- /dev/null +++ b/spaced_repetition/migrations/0004_auto_20170201_0026.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.2 on 2017-02-01 00:26 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('spaced_repetition', '0003_auto_20170120_0032'), + ] + + operations = [ + migrations.AlterField( + model_name='folder', + name='owner', + field=models.ForeignKey(blank=True, default=None, on_delete=django.db.models.deletion.CASCADE, to='user_profiles.Student'), + ), + migrations.AlterField( + model_name='folder', + name='parent_directory', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='spaced_repetition.Folder'), + ), + ] diff --git a/spaced_repetition/migrations/0005_auto_20170201_0222.py b/spaced_repetition/migrations/0005_auto_20170201_0222.py new file mode 100644 index 0000000..0ab88e0 --- /dev/null +++ b/spaced_repetition/migrations/0005_auto_20170201_0222.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.2 on 2017-02-01 02:22 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('spaced_repetition', '0004_auto_20170201_0026'), + ] + + operations = [ + migrations.AlterField( + model_name='folder', + name='owner', + field=models.ForeignKey(blank=True, on_delete=django.db.models.deletion.CASCADE, to='user_profiles.Student'), + ), + migrations.AlterField( + model_name='folder', + name='parent_directory', + field=models.ForeignKey(default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='spaced_repetition.Folder'), + ), + ] diff --git a/spaced_repetition/migrations/0006_auto_20170201_0224.py b/spaced_repetition/migrations/0006_auto_20170201_0224.py new file mode 100644 index 0000000..7f52e26 --- /dev/null +++ b/spaced_repetition/migrations/0006_auto_20170201_0224.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.2 on 2017-02-01 02:24 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('spaced_repetition', '0005_auto_20170201_0222'), + ] + + operations = [ + migrations.AlterField( + model_name='folder', + name='owner', + field=models.ForeignKey(default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='user_profiles.Student'), + ), + ] diff --git a/spaced_repetition/migrations/0007_auto_20170201_0318.py b/spaced_repetition/migrations/0007_auto_20170201_0318.py new file mode 100644 index 0000000..0fa829c --- /dev/null +++ b/spaced_repetition/migrations/0007_auto_20170201_0318.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.2 on 2017-02-01 03:18 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('spaced_repetition', '0006_auto_20170201_0224'), + ] + + operations = [ + migrations.AddField( + model_name='folder', + name='name', + field=models.CharField(default='Home', max_length=250), + preserve_default=False, + ), + migrations.AlterField( + model_name='deck', + name='name', + field=models.CharField(max_length=250), + ), + ] diff --git a/spaced_repetition/models.py b/spaced_repetition/models.py index e53615d..2a9058b 100644 --- a/spaced_repetition/models.py +++ b/spaced_repetition/models.py @@ -1,26 +1,31 @@ import datetime from django.db import models -from user_profiles.models import Student - class Folder(models.Model): - owner = models.ForeignKey(Student) - parent_directory = models.ForeignKey('self') + owner = models.ForeignKey('user_profiles.Student', null=True, default=None) + parent_directory = models.ForeignKey('self', null=True, default=None) + name = models.CharField(max_length=250) created_at = models.DateTimeField(auto_now_add=True) updated_at = models.DateTimeField(auto_now=True) + def __str__(self): + return '%s' % (self.name) + class Deck(models.Model): - owner = models.ForeignKey(Student) + owner = models.ForeignKey('user_profiles.Student') parent_directory = models.ForeignKey(Folder) - name = models.DateTimeField(max_length=250) + name = models.CharField(max_length=250) created_at = models.DateTimeField(auto_now_add=True) updated_at = models.DateTimeField(auto_now=True) + def __str__(self): + return '%s' % (self.name) + class Card(models.Model): - owner = models.ForeignKey(Student) + owner = models.ForeignKey('user_profiles.Student') deck = models.ForeignKey(Deck) question = models.CharField(max_length=300) answer = models.CharField(max_length=750) diff --git a/user_profiles/admin.py b/user_profiles/admin.py index 4185d36..1479cc8 100644 --- a/user_profiles/admin.py +++ b/user_profiles/admin.py @@ -1,3 +1,9 @@ -# from django.contrib import admin +from django.contrib import admin -# Register your models here. +from .models import Student + + +class StudentAdmin(admin.ModelAdmin): + list_display = ('user', ) + +admin.site.register(Student, StudentAdmin) diff --git a/user_profiles/models.py b/user_profiles/models.py index 615d1df..e568dac 100644 --- a/user_profiles/models.py +++ b/user_profiles/models.py @@ -1,7 +1,33 @@ from django.db import models +from django.dispatch import receiver +from django.db.models.signals import post_save from django.contrib.auth.models import User +from spaced_repetition.models import Folder + class Student(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) - home_directory = models.OneToOneField('spaced_repetition.Folder') + home_directory = models.OneToOneField(Folder) + + def __str__(self): + return '%s' % (self.user) + + +@receiver(post_save, sender=User) +def create_student_profile_for_new_user(sender, created, instance, **kwargs): + if created: + # Create his future home directory + new_home_directory = Folder() + new_home_directory.save() + + # Create the new student object + student = Student( + user=instance, + home_directory=new_home_directory + ) + student.save() + + # Assign the new student as the owner of the new directory + new_home_directory.owner = student + new_home_directory.save() diff --git a/user_profiles/tests.py b/user_profiles/tests.py index a79ca8b..eff7c38 100644 --- a/user_profiles/tests.py +++ b/user_profiles/tests.py @@ -1,3 +1,21 @@ -# from django.test import TestCase +from django.contrib.auth.models import User +from django.test import TestCase -# Create your tests here. +from .models import Student +from spaced_repetition.models import Folder + + +class TestStudentModel(TestCase): + + def setUp(self): + test_user = User(username="tiesto", password="tiesto666") + test_user.save() + + def test_student_profile_creation(self): + test_user = User.objects.get(username="tiesto") + self.assertIsInstance(test_user.student, Student) + + def test_student_home_directory_creation(self): + test_user = User.objects.get(username="tiesto") + test_student = test_user.student + self.assertIsInstance(test_student.home_directory, Folder) From 43092f1f1e774fe33aef9b4891b88116fb1b5e21 Mon Sep 17 00:00:00 2001 From: Perimetro20 Date: Mon, 6 Feb 2017 00:27:04 -0600 Subject: [PATCH 4/5] Pull request comments have been addresed in this commit; to string methods for every model are implemented, and they use the .format() function --- spaced_repetition/models.py | 7 +++++-- user_profiles/models.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/spaced_repetition/models.py b/spaced_repetition/models.py index 2a9058b..5b7fd62 100644 --- a/spaced_repetition/models.py +++ b/spaced_repetition/models.py @@ -10,7 +10,7 @@ class Folder(models.Model): updated_at = models.DateTimeField(auto_now=True) def __str__(self): - return '%s' % (self.name) + return '{}'.format(self.name) class Deck(models.Model): @@ -21,7 +21,7 @@ class Deck(models.Model): updated_at = models.DateTimeField(auto_now=True) def __str__(self): - return '%s' % (self.name) + return '{}'.format(self.name) class Card(models.Model): @@ -33,3 +33,6 @@ class Card(models.Model): last_studied = models.DateTimeField(default=datetime.datetime.now) created_at = models.DateTimeField(auto_now_add=True) updated_at = models.DateTimeField(auto_now=True) + + def __str__(self): + return '{}'.format(self.question) diff --git a/user_profiles/models.py b/user_profiles/models.py index e568dac..6d622c2 100644 --- a/user_profiles/models.py +++ b/user_profiles/models.py @@ -11,7 +11,7 @@ class Student(models.Model): home_directory = models.OneToOneField(Folder) def __str__(self): - return '%s' % (self.user) + return '{}'.format(self.user) @receiver(post_save, sender=User) From b98156e764acc80f2cab9d8c9ee7dc38a8baf901 Mon Sep 17 00:00:00 2001 From: Perimetro20 Date: Mon, 6 Feb 2017 00:39:07 -0600 Subject: [PATCH 5/5] Initial configuration of sphinx completed --- docs/Makefile | 20 +++++++ docs/conf.py | 160 +++++++++++++++++++++++++++++++++++++++++++++++++ docs/index.rst | 20 +++++++ docs/make.bat | 36 +++++++++++ 4 files changed, 236 insertions(+) create mode 100644 docs/Makefile create mode 100644 docs/conf.py create mode 100644 docs/index.rst create mode 100644 docs/make.bat diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..4baab5c --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +SPHINXPROJ = ProjectStud +SOURCEDIR = . +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) \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..85972dc --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,160 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# ProjectStud documentation build configuration file, created by +# sphinx-quickstart on Mon Feb 6 00:38:31 2017. +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +# 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('.')) + + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +# +# needs_sphinx = '1.0' + +# 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', + 'sphinx.ext.coverage', + 'sphinx.ext.mathjax', + 'sphinx.ext.viewcode'] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +# +# source_suffix = ['.rst', '.md'] +source_suffix = '.rst' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = 'ProjectStud' +copyright = '2017, [tosp]' +author = '[tosp]' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version = '0.1' +# The full version, including alpha/beta/rc tags. +release = '0.1' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = None + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This patterns also effect to html_static_path and html_extra_path +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = False + + +# -- 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' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +# +# html_theme_options = {} + +# 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'] + + +# -- Options for HTMLHelp output ------------------------------------------ + +# Output file base name for HTML help builder. +htmlhelp_basename = 'ProjectStuddoc' + + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # + # 'papersize': 'letterpaper', + + # The font size ('10pt', '11pt' or '12pt'). + # + # 'pointsize': '10pt', + + # Additional stuff for the LaTeX preamble. + # + # 'preamble': '', + + # Latex figure (float) alignment + # + # 'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + (master_doc, 'ProjectStud.tex', 'ProjectStud Documentation', + '{[}tosp{]}', 'manual'), +] + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + (master_doc, 'projectstud', 'ProjectStud Documentation', + [author], 1) +] + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + (master_doc, 'ProjectStud', 'ProjectStud Documentation', + author, 'ProjectStud', 'One line description of project.', + 'Miscellaneous'), +] + + + diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000..a87b54d --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,20 @@ +.. ProjectStud documentation master file, created by + sphinx-quickstart on Mon Feb 6 00:38:31 2017. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to ProjectStud's documentation! +======================================= + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 0000000..1c7ad89 --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,36 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=. +set BUILDDIR=_build +set SPHINXPROJ=ProjectStud + +if "%1" == "" goto help + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.http://sphinx-doc.org/ + exit /b 1 +) + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% + +:end +popd