Skip to content

Commit a86c670

Browse files
DevinHilleniuslibre-man
authored andcommitted
Add documentation (#30)
* Add sphinx documentation and automatic deploy
1 parent 177f3dc commit a86c670

14 files changed

Lines changed: 431 additions & 0 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
.DS_Store
12
/env/
23
/__pycache__/
4+
*/__pycache__/
35
mount/
46
/.dir-locals.el
57
/.run_tests.sh
68
.cov2emacs.log
79
/.coverage
810
/dist/
11+
docs/_build/
912
.mypy_cache/

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,14 @@ script:
6363
- make test
6464
- pip install mypy
6565
- mypy codegra_fs
66+
- pip install -r docs_requirements.txt || true
67+
- ( cd docs; make html )
68+
- travis-sphinx build --source=docs/
6669

6770
after_script:
6871
cat server.log
6972

7073
after_success:
7174
- coveralls
7275
- codecov
76+
- travis-sphinx deploy -c fs-docs.codegra.de

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS = -W
6+
SPHINXBUILD = python3 -msphinx
7+
SPHINXPROJ = CodeGradefs
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/_static/_images/favicon.ico

14.7 KB
Binary file not shown.

docs/_static/_images/logo.svg

Lines changed: 18 additions & 0 deletions
Loading

docs/_static/style.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.wy-nav-content {
2+
width: 60em; /* Change as you like. */
3+
max-width: 100% !important;
4+
}
5+
6+
7+
.wy-table-responsive table td {
8+
/* !important prevents the common CSS stylesheets from overriding
9+
this as on RTD they are loaded after this stylesheet */
10+
white-space: normal !important;
11+
}
12+
13+
.wy-table-responsive {
14+
overflow: visible !important;
15+
}

docs/_templates/layout.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{% extends "!layout.html" %}
2+
{% block extrahead %}
3+
<link href="{{ pathto("_static/style.css", True) }}" rel="stylesheet" type="text/css">
4+
{% endblock %}

docs/conf.py

Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
#
4+
# CodeGra.de documentation build configuration file, created by
5+
# sphinx-quickstart on Thu Jun 29 15:43:19 2017.
6+
#
7+
# This file is execfile()d with the current directory set to its
8+
# containing dir.
9+
#
10+
# Note that not all possible configuration values are present in this
11+
# autogenerated file.
12+
#
13+
# All configuration values have a default; values that are commented out
14+
# serve to show the default.
15+
16+
# If extensions (or modules to document with autodoc) are in another directory,
17+
# add these directories to sys.path here. If the directory is relative to the
18+
# documentation root, use os.path.abspath to make it absolute, like shown here.
19+
20+
import os
21+
import sys
22+
import subprocess
23+
from datetime import date
24+
25+
import sphinx_fontawesome
26+
27+
import codegra_fs
28+
29+
sys.path.append("../")
30+
31+
# -- General configuration ------------------------------------------------
32+
33+
# If your documentation needs a minimal Sphinx version, state it here.
34+
#
35+
# needs_sphinx = '1.0'
36+
37+
# Add any Sphinx extension module names here, as strings. They can be
38+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
39+
# ones.
40+
extensions = [
41+
'sphinx.ext.autodoc',
42+
'sphinx.ext.napoleon',
43+
'sphinx.ext.intersphinx',
44+
'sphinx.ext.coverage',
45+
'sphinx.ext.todo',
46+
'sphinx.ext.viewcode',
47+
'sphinx.ext.doctest',
48+
'sphinx.ext.githubpages',
49+
'sphinx_fontawesome',
50+
]
51+
52+
# Add any paths that contain templates here, relative to this directory.
53+
templates_path = ['_templates']
54+
55+
# The suffix(es) of source filenames.
56+
# You can specify multiple suffix as a list of string:
57+
#
58+
# source_suffix = ['.rst', '.md']
59+
source_suffix = '.rst'
60+
61+
# The master toctree document.
62+
master_doc = 'index'
63+
64+
# General information about the project.
65+
project = 'CodeGrade Filesystem'
66+
copyright = str(date.today().year) + ', CodeGrade'
67+
author = 'CodeGrade Team'
68+
69+
# The version info for the project you're documenting, acts as replacement for
70+
# |version| and |release|, also used in various other places throughout the
71+
# built documents.
72+
#
73+
# The short X.Y version.
74+
75+
version = '.'.join(map(str, codegra_fs.__version__))
76+
# The full version, including alpha/beta/rc tags.
77+
release = version
78+
79+
# The language for content autogenerated by Sphinx. Refer to documentation
80+
# for a list of supported languages.
81+
#
82+
# This is also used if you do content translation via gettext catalogs.
83+
# Usually you set "language" from the command line for these cases.
84+
language = 'en'
85+
86+
# List of patterns, relative to source directory, that match files and
87+
# directories to ignore when looking for source files.
88+
# This patterns also effect to html_static_path and html_extra_path
89+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '']
90+
91+
# The name of the Pygments (syntax highlighting) style to use.
92+
pygments_style = 'sphinx'
93+
94+
# If true, `todo` and `todoList` produce output, else they produce nothing.
95+
todo_include_todos = False
96+
97+
# -- Options for HTML output ----------------------------------------------
98+
99+
# The theme to use for HTML and HTML Help pages. See the documentation for
100+
# a list of builtin themes.
101+
#
102+
html_theme = 'sphinx_rtd_theme'
103+
104+
# Theme options are theme-specific and customize the look and feel of a theme
105+
# further. For a list of options available for each theme, see the
106+
# documentation.
107+
#
108+
# html_theme_options = {}
109+
110+
# Add any paths that contain custom static files (such as style sheets) here,
111+
# relative to this directory. They are copied after the builtin static files,
112+
# so a file named "default.css" will overwrite the builtin "default.css".
113+
html_static_path = ['_static']
114+
115+
# -- Options for HTMLHelp output ------------------------------------------
116+
117+
# Output file base name for HTML help builder.
118+
htmlhelp_basename = 'CodeGradefs'
119+
120+
# -- Options for LaTeX output ---------------------------------------------
121+
122+
latex_elements = {
123+
# The paper size ('letterpaper' or 'a4paper').
124+
#
125+
# 'papersize': 'letterpaper',
126+
127+
# The font size ('10pt', '11pt' or '12pt').
128+
#
129+
# 'pointsize': '10pt',
130+
131+
# Additional stuff for the LaTeX preamble.
132+
#
133+
# 'preamble': '',
134+
135+
# Latex figure (float) alignment
136+
#
137+
# 'figure_align': 'htbp',
138+
}
139+
140+
# Grouping the document tree into LaTeX files. List of tuples
141+
# (source start file, target name, title,
142+
# author, documentclass [howto, manual, or own class]).
143+
latex_documents = [
144+
(master_doc, 'CodeGrade.tex', 'CodeGrade Documentation', author, 'manual'),
145+
]
146+
147+
# -- Options for manual page output ---------------------------------------
148+
149+
# One entry per manual page. List of tuples
150+
# (source start file, name, description, authors, manual section).
151+
man_pages = [(master_doc, 'codegrade', 'CodeGrade Documentation', [author], 1)]
152+
153+
# -- Options for Texinfo output -------------------------------------------
154+
155+
# Grouping the document tree into Texinfo files. List of tuples
156+
# (source start file, target name, title, author,
157+
# dir menu entry, description, category)
158+
texinfo_documents = [
159+
(
160+
master_doc, 'CodeGrade', 'CodeGrade Documentation', author,
161+
'CodeGrade', 'One line description of project.', 'Miscellaneous'
162+
),
163+
]
164+
165+
todo_include_todos = True
166+
167+
# Example configuration for intersphinx: refer to the Python standard library.
168+
intersphinx_mapping = {
169+
'https://docs.python.org/3': None,
170+
'http://werkzeug.pocoo.org/docs/latest/': None,
171+
'http://flask.pocoo.org/docs/latest/': None,
172+
'http://sqlalchemy-utils.readthedocs.io/en/latest': None,
173+
}
174+
175+
html_favicon = '_static/_images/favicon.ico'
176+
html_logo = '_static/_images/logo.svg'
177+
html_theme_options = {
178+
'logo_only': True,
179+
}

docs/index.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
.. CodeGra.de documentation master file, created by
2+
sphinx-quickstart on Thu Jun 29 15:43:19 2017.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
.. rst-class:: fa fa-fontawesome
6+
7+
CodeGrade Filesystem
8+
======================================
9+
10+
The CodeGrade Filesystem (or CodeGra.fs) can be used in combination with the web application.
11+
It can mount a local CodeGrade instance on your computer to locally browse submissions and files on the CodeGrade server.
12+
The filesystem can be used for students to locally work on the CodeGrade mount and thus automatically hand in the assignment
13+
with each save. For teachers the filesystem can be used to locally grade work using an editor of choice without any overhead. The Filesystem
14+
is aimed to drastically enhance the grading experience and make it more efficient.
15+
16+
The code of the CodeGrade filesystem is open-source and can be found on
17+
`Github <https://github.com/CodeGra-de/CodeGra.fs>`__.
18+
19+
.. toctree::
20+
:maxdepth: 2
21+
:caption: CodeGrade Filesystem
22+
23+
install
24+
usage
25+
plugins
26+
Back to CodeGrade Documentation <https://docs.codegra.de>

docs/install.rst

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
Installation
2+
=============
3+
The CodeGrade Filesystem is compatible with all popular operating systems:
4+
5+
* :fa:`linux` GNU/Linux
6+
* :fa:`apple` MacOS
7+
* :fa:`windows` Windows
8+
9+
.. note:: The support for windows is currently experimental: we would love to hear your feedback!
10+
11+
GNU/Linux and MacOS
12+
---------------------
13+
The Filesystem can be installed on GNU/Linux or MacOS using ``pip``, with the command:
14+
``sudo pip install CodeGra.fs``.
15+
This installs three scripts, ``cgfs`` used to mount the file-system,
16+
``cgfs-qt`` a GUI that can be used to mount the file-system, and ``cgapi-consumer``
17+
used by editor plugins. You can also install ``cgfs`` by giving ``pip`` the ``--user``
18+
flag, however make sure ``$HOME/.local/bin`` is in your ``$PATH`` in this case.
19+
20+
.. note:: Please consult our ``PyPi`` page `here <https://pypi.org/project/CodeGra.fs/>`__.
21+
22+
Please note that ``pip3`` is used, this because CodeGra.fs only with works with
23+
python **3.5** or higher. For MacOS this will probably mean you need to install
24+
Python3, you can do this using e.g. `homebrew <https://brew.sh/>`__
25+
(``brew install python``).
26+
27+
On GNU/Linux and MacOS CodeGra.fs depends on:
28+
29+
* `fusepy <https://github.com/terencehonles/fusepy>`__
30+
* `requests <http://docs.python-requests.org/en/master/>`__
31+
32+
.. note:: Please note that the newest version of FUSE for macOS is required for macOS Mojave, this has to be installed manually from `FUSE <https://osxfuse.github.io/>`__.
33+
34+
Windows
35+
---------
36+
Installation on Windows can also be done by using ``pip`` by following the steps
37+
for GNU/Linux and MacOS above. Another easier way is however using our supplied
38+
installer. You can download the installer for the latest release
39+
`here <https://github.com/CodeGra-de/CodeGra.fs/releases>`__. The installer
40+
does not install the command line ``cgfs`` script, if you need this script for
41+
whatever reason simply install the package using ``pip``.
42+
43+
When using the Windows installer you still need to install
44+
`WinFsp <https://github.com/billziss-gh/winfsp>`__ separately. Currently only
45+
version 1.4B3 is supported (which is in beta), you can download it
46+
`here <https://github.com/billziss-gh/winfsp/releases/tag/v1.4B3>`__.
47+
48+
When installing using pip CodeGra.fs depends on:
49+
50+
- `fusepy`_
51+
- `requests`_
52+
- `cffi`_
53+
- `WinFsp`_ (installed with dev headers).
54+
- `winfspy`_
55+
56+
.. _fusepy: https://github.com/terencehonles/fusepy
57+
.. _requests: http://docs.python-requests.org/en/master/
58+
.. _cffi: https://bitbucket.org/cffi/cffi
59+
.. _WinFsp: https://github.com/billziss-gh/winfsp
60+
.. _winfspy: https://github.com/Scille/winfspy

0 commit comments

Comments
 (0)