diff --git a/docs/Makefile b/docs/Makefile deleted file mode 100644 index 298ea9e213..0000000000 --- a/docs/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -# Minimal makefile for Sphinx documentation -# - -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = sphinx-build -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/_static/img/api_doc.png b/docs/_static/img/api_doc.png deleted file mode 100644 index 1466eb7b54..0000000000 Binary files a/docs/_static/img/api_doc.png and /dev/null differ diff --git a/docs/_static/img/api_http.png b/docs/_static/img/api_http.png deleted file mode 100644 index 0023358760..0000000000 Binary files a/docs/_static/img/api_http.png and /dev/null differ diff --git a/docs/_static/img/modal_form.png b/docs/_static/img/modal_form.png deleted file mode 100644 index a1daf28e21..0000000000 Binary files a/docs/_static/img/modal_form.png and /dev/null differ diff --git a/docs/conf.py b/docs/conf.py deleted file mode 100644 index b02b70a41d..0000000000 --- a/docs/conf.py +++ /dev/null @@ -1,100 +0,0 @@ -# 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: -# http://www.sphinx-doc.org/en/master/config - -# -- 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('../')) -sys.path.append(os.path.abspath('../InvenTree')) - - -# -- Project information ----------------------------------------------------- - -project = 'InvenTree' -copyright = '2019, InvenTree' - - -# -- 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', - 'sphinx.ext.napoleon', - 'autoapi.extension', -] - -napoleon_google_docstring = True -napoleon_numpy_docstring = False - -autoapi_dirs = [ - '../InvenTree', -] - -autoapi_options = [ - 'members', - 'private-members', - 'special-members', -] - -autoapi_type = 'python' - -autoapi_ignore = [ - '*migrations*', - '**/test*.py', - '**/manage.py', - '**/apps.py', - '**/admin.py', - '**/middleware.py', - '**/utils.py', - '**/wsgi.py', - '**/templates/', -] - -# Add any paths that contain templates here, relative to this directory. -autoapi_template_dir = 'templates' -autoapi_root = 'docs' -autoapi_add_toctree_entry = False - -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', - 'manage.rst', # Ignore django management file - '**/*.migrations*.rst', # Ignore migration files -] - - -# -- 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 = 'sphinx_rtd_theme' - -# 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'] - -# Table of contents in sidebar -html_sidebars = {'**': [ - 'globaltoc.html', - 'relations.html', - 'sourcelink.html', - 'searchbox.html' -]} \ No newline at end of file diff --git a/docs/forms.rst b/docs/forms.rst deleted file mode 100644 index 9bdb0dc7a6..0000000000 --- a/docs/forms.rst +++ /dev/null @@ -1,57 +0,0 @@ -InvenTree Modal Forms -===================== - -.. toctree:: - :titlesonly: - :maxdepth: 2 - :caption: Modal Forms - :hidden: - - -The InvenTree web interface uses modal forms for user input. InvenTree defines a wrapper layer around the Django form classes to provide a mechanism for retrieving and rendering forms via jQuery and AJAX. - -.. image:: _static/img/modal_form.png - -Forms are rendered to a Bootstrap modal window, allowing in-page data input and live page updating. - -Crispy Forms ------------- - -Django provides native form rendering tools which are very powerful, allowing form rendering, input validation, and display of error messages for each field. - -InvenTree makes use of the `django-crispy-forms `_ extension to reduce the amount of boilerplate required to convert a Django model to a HTML form. - -Form Rendering --------------- - -The InvenTree front-end web interface is implemented using jQuery and Bootstrap. Forms are rendered using Django `class-based forms `_ using standard Django methods. - -The main point of difference is that instead of rendering a HTTP response (and displaying a static form page) form data are requested via AJAX, and the form contents are injected into the modal window. - -A set of javascript/jQuery functions handle the client/server interactions, and manage GET and POST requests. - -Sequence of Events ------------------- - -#. User presses a button or other element which initiates form loading -#. jQuery function sends AJAX GET request to InvenTree server, requesting form at a specified URL -#. Django renders form (according to specific model/view rules) -#. Django returns rendered form as a JSON object -#. Client displays the modal window and injects the form contents into the modal -#. User fills in form data, presses the 'Submit' button -#. Client sends the completed form to server via POST -#. Django backend handles POST request, specifically determines if the form is valid -#. Return a JSON object containing status of form validity - * If the form is valid, return (at minimum) ``{form_valid: true}``. Client will close the modal. - * If the form is invalid, re-render the form and send back to the client. Process repeats - -At the end of this process (i.e. after successful processing of the form) the client closes the modal and runs any optional post-processes (depending on the implementation). - -Further Reading ---------------- - -For a better understanding of the modal form architecture, refer to the relevant source files: - -**Server Side:** Refer to ``./InvenTree/InvenTree/views.py`` for AJAXified Django Views - -**Client Side:** Refer to ``./InvenTree/static/script/inventree/modals.js`` for client-side javascript diff --git a/docs/index.rst b/docs/index.rst deleted file mode 100644 index 3289ffc21a..0000000000 --- a/docs/index.rst +++ /dev/null @@ -1,38 +0,0 @@ -InvenTree Source Documentation -================================ - -.. toctree:: - :titlesonly: - :maxdepth: 2 - :caption: Index - :hidden: - - Translations - Modal Forms - Tables - REST API - InvenTree Modules - Module Reference - -The documentation found here is provided to be useful for developers working on the InvenTree codebase. User documentation can be found on the `InvenTree website `_. - -Documentation for the Python modules is auto-generated from the `InvenTree codebase `_. - -Code Structure --------------- - -**Backend** - -InvenTree is developed using the `django web framework `_, a powerful toolkit for making web applications in Python. - -The database management code and business logic is written in Python 3. Core functionality is separated into individual modules (or *apps* using the django nomenclature). - -Each *app* is located in a separate directory under InvenTree. Each *app* contains python modules named according to the standard django configuration. - -**Frontend** - -The web frontend rendered using a mixture of technologies. - -Base HTML code is rendered using the `django templating language `_ which provides low-level access to the underlying database models. - -jQuery is also used to implement front-end logic, and desponse to user input. A REST API is provided to facilitate client-server communication. \ No newline at end of file diff --git a/docs/make.bat b/docs/make.bat deleted file mode 100644 index 7893348a1b..0000000000 --- a/docs/make.bat +++ /dev/null @@ -1,35 +0,0 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set SOURCEDIR=. -set BUILDDIR=_build - -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 diff --git a/docs/modules.rst b/docs/modules.rst deleted file mode 100644 index 6509965972..0000000000 --- a/docs/modules.rst +++ /dev/null @@ -1,26 +0,0 @@ -InvenTree Modules -================= - -.. toctree:: - :titlesonly: - :maxdepth: 2 - :caption: App Modules - :hidden: - - docs/InvenTree/index - docs/build/index - docs/common/index - docs/company/index - docs/part/index - docs/order/index - docs/stock/index - -The InvenTree Django ecosystem provides the following 'apps' for core functionality: - -* `InvenTree `_ - High level management functions -* `Build `_ - Part build projects -* `Common `_ - Common modules used by various apps -* `Company `_ - Company management (suppliers / customers) -* `Part `_ - Part management -* `Order `_ - Order management -* `Stock `_ - Stock management \ No newline at end of file diff --git a/docs/reference.rst b/docs/reference.rst deleted file mode 100644 index 5a45ca9177..0000000000 --- a/docs/reference.rst +++ /dev/null @@ -1,14 +0,0 @@ -Module Reference -=================== - -.. toctree:: - :titlesonly: - :maxdepth: 2 - :caption: Module Reference - :hidden: - - -The complete reference indexes are found below: - -* :ref:`modindex` -* :ref:`genindex` \ No newline at end of file diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index 7b5dff3e0a..0000000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -Sphinx>=2.0.1 -sphinx-autoapi==1.0.0 -sphinx-rtd-theme==0.4.3 \ No newline at end of file diff --git a/docs/rest.rst b/docs/rest.rst deleted file mode 100644 index 768f3d1003..0000000000 --- a/docs/rest.rst +++ /dev/null @@ -1,42 +0,0 @@ -REST API -======== - -.. toctree:: - :titlesonly: - :maxdepth: 2 - :caption: REST API - :hidden: - -InvenTree provides a REST API which serves data to the web client and also provides data access to third-party applications. The REST API is implemented using the `Django REST framework (DRF) `_ which provides the following features out of the box: - -* AJAX REST API -* Web-browseable REST -* User authentication -* Database model serialization and validation - -API Access ----------- - -The API is accessible from the root URL ``/api/``. It requires user authentication. - -* Requesting data via AJAX query will return regular JSON objects. -* Directing a browser to the API endpoints provides a web-browsable interface - -.. image:: _static/img/api_http.png - -API Documentation ------------------ - -API documentation is provided by DRF autodoc tools, and is available for browsing at ``/api-doc/`` - -.. image:: _static/img/api_doc.png - -API Code --------- - -Javascript/jQuery code for interacting with the server via the REST API can be found under ``InvenTree/static/script/InvenTree``. - -Python interface ----------------- - -A Python library for interacting with the InvenTree API is provided on `GitHub `_ \ No newline at end of file diff --git a/docs/tables.rst b/docs/tables.rst deleted file mode 100644 index 58f6aefb48..0000000000 --- a/docs/tables.rst +++ /dev/null @@ -1,14 +0,0 @@ -Table Management -================ - -.. toctree:: - :titlesonly: - :maxdepth: 2 - :caption: Tables - :hidden: - -InvenTree uses `Bootstrap Table `_ to manage tabulated data in the web front-end. The ability to tabulate data from read via an AJAX request allows tables to be updated on-the-fly (without a full page reload). - -Bootstrap Table also provides integrated tools for table searching, filtering, and advanced rendering. - -Frontend code for table functionality can be found at ``InvenTree/static/script/inventree/tables.js``. \ No newline at end of file diff --git a/docs/templates/python/module.rst b/docs/templates/python/module.rst deleted file mode 100644 index ec51763131..0000000000 --- a/docs/templates/python/module.rst +++ /dev/null @@ -1,97 +0,0 @@ -{% if not obj.display %} -:orphan: - -{% endif %} -:mod:`{{ obj.name }}` -======={{ "=" * obj.name|length }} - -.. py:module:: {{ obj.name }} - -{% if obj.docstring %} -.. autoapi-nested-parse:: - - {{ obj.docstring|prepare_docstring|indent(3) }} - -{% endif %} - -{% block subpackages %} -{% set visible_subpackages = obj.subpackages|selectattr("display")|list %} -{% if visible_subpackages %} -Subpackages ------------ -.. toctree:: - :titlesonly: - :maxdepth: 3 - -{% for subpackage in visible_subpackages %} - {{ subpackage.short_name }}/index.rst -{% endfor %} - - -{% endif %} -{% endblock %} -{% block submodules %} -{% set visible_submodules = obj.submodules|selectattr("display")|list %} -{% if visible_submodules %} -Submodules ----------- - -The {{ obj.name }} module contains the following submodules - -.. toctree:: - :titlesonly: - :maxdepth: 1 - -{% for submodule in visible_submodules %} - {{ submodule.short_name }}/index.rst -{% endfor %} - - -{% endif %} -{% endblock %} -{% block content %} -{% set visible_children = obj.children|selectattr("display")|list %} -{% if visible_children %} -{{ obj.type|title }} Contents -{{ "-" * obj.type|length }}--------- - -{% set visible_classes = visible_children|selectattr("type", "equalto", "class")|list %} -{% set visible_functions = visible_children|selectattr("type", "equalto", "function")|list %} -{% if include_summaries and (visible_classes or visible_functions) %} -{% block classes %} -{% if visible_classes %} -Classes -~~~~~~~ - -.. autoapisummary:: - -{% for klass in visible_classes %} - {{ klass.id }} -{% endfor %} - - -{% endif %} -{% endblock %} - -{% block functions %} -{% if visible_functions %} -Functions -~~~~~~~~~ - -.. autoapisummary:: - -{% for function in visible_functions %} - {{ function.id }} -{% endfor %} - - -{% endif %} -{% endblock %} -{% endif %} -{% for obj_item in visible_children %} -{% if obj.all is none or obj_item.short_name in obj.all %} -{{ obj_item.rendered|indent(0) }} -{% endif %} -{% endfor %} -{% endif %} -{% endblock %} diff --git a/docs/translate.rst b/docs/translate.rst deleted file mode 100644 index ba62dc6780..0000000000 --- a/docs/translate.rst +++ /dev/null @@ -1,16 +0,0 @@ -Translations -============ - -.. toctree:: - :titlesonly: - :maxdepth: 2 - :caption: Language Translation - :hidden: - -InvenTree supports multi-language translation using the `Django Translation Framework `_ - -Translation strings are located in the `InvenTree/locales/` directory, and translation files can be easily added here. - -To set the default language, change the `language` setting in the `config.yaml` settings file. - -To recompile the translation files (after adding new translation strings), run the command ``make translate`` from the root directory.