Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting Started on Documentation #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = taretto
#SOURCEDIR = source
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
Expand Down
36 changes: 36 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build
set SPHINXPROJ=Turret

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
Binary file added docs/source/_static/fonts/FontAwesome.otf
Binary file not shown.
Binary file not shown.
2,671 changes: 2,671 additions & 0 deletions docs/source/_static/fonts/fontawesome-webfont.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
176 changes: 176 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
# -*- coding: utf-8 -*-
import os
import sys


# Taretto documentation build configuration file, created by
# sphinx-quickstart on Wed Mar 7 11:20:52 2018.
#
# 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'

# Include the examples
sys.path.insert(0, os.path.abspath('../examples'))

# 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.doctest',
'sphinx.ext.viewcode',
'sphinx.ext.todo',
]

# 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 = u'Taretto'
copyright = u'2018, Taretto developers'
author = u'Taretto developers'

# 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 = u'0.1'
# The full version, including alpha/beta/rc tags.
release = u'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 = []

# 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 = 'sphinx_rtd_theme'

# 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']

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# This is required for the alabaster theme
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
html_sidebars = {
'**': [
'relations.html', # needs 'show_related': True theme option to display
'searchbox.html',
]
}


# -- Options for HTMLHelp output ------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'Tarettodoc'


# -- 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, 'Taretto.tex', u'Taretto Documentation',
u'Taretto developers', '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, 'taretto', u'Taretto 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, 'Taretto', u'Taretto Documentation',
author, 'Taretto', 'One line description of project.',
'Miscellaneous'),
]
41 changes: 41 additions & 0 deletions docs/source/endpoints/about.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
About Sentaku
==============

Sentaku_ is a python library that allows objects to dynamically choose their implementation.
Sentaku_ is the Japanese word for choice.

With Sentaku_ it is possible to describe the Elements of the Applocations you interact with
and the actions/attributes they have.
Sentaku_ takes care of chosing the impliementation of the Actions/Attributes.


Installing
----------

::

pip install sentaku



Use cases
-----------

A common use for such a system is Testing Various layers of an application with the same code,
as well as using different Layers of an Application for Setup/Teardown and for concise acceptance-tests.


A typical use case is Testing your modern html5 application.
Such an application usually consists of different layers.

1. the internal backend api
2. a rest api
3. a rich fronend
4. apis that directly interact with other services the application uses

When doing test setup/teardown it is
desirable to run against the fast backend api or rest API,
while when running the actual acceptance/system tests
it is more desirable to run against the rich user interface or the rest API

.. _Sentaku: http:://pypi.python.org/pypi/sentaku
27 changes: 27 additions & 0 deletions docs/source/endpoints/example_reference.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Example Project API Reference
==============================

Api Layer
----------

.. automodule:: todo_example.api
:members:

UX layer
---------

.. automodule:: todo_example.ux
:members:


RPC Layer
---------

.. automodule:: todo_example.pseudorpc
:members:

Spec Layer
----------

.. automodule:: todo_example.spec
:members:
45 changes: 45 additions & 0 deletions docs/source/endpoints/examples.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
Examples
=============


.. _mini-example:

Mini example
**************

The mini example demonstrates Sentaku usage
by searching a package on pypi and opening the first result in a browser

.. automodule:: mini_example
:members:



Todo example
**************


The todo example demonstrates Sentaku usage in a more complex manner.
A Example Todo list manager that has Multiple interfaces and
api differences between them.


Api Reference
--------------

.. toctree::

example_reference


Structure Description
---------------------

The Todo list example has 3 entrypoints

:py:class:`todo_example.api.TodoApp`
The Basic implementation as "internal api"
:py:class:`todo_example.ux.TodoUX`
A pseudo-ux sharing the api with :py:class:`todo_example.api.TodoApp`
:py:class:`todo_example.pseudorpc.PseudoRpc`
A pseudo RPC exposing the bahaviour using a different api
5 changes: 5 additions & 0 deletions docs/source/endpoints/extra_api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Extra Api
==========


.. autoclass:: sentaku.utils.AttributeBasedImplementations
36 changes: 36 additions & 0 deletions docs/source/endpoints/getting_started.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
quickly combining things
========================

the getting started guide is based on the :ref:`mini-example`


1. importing all the things we need in the example

.. literalinclude:: ../examples/mini_example.py
:lines: 10-20

2. implementations the core objects of backends you want to be able to use
and preparing them.

.. literalinclude:: ../examples/mini_example.py
:pyobject: Browser, FastSearch

3. declaring a context type for your application

.. literalinclude:: ../examples/mini_example.py
:pyobject: SearchContext

4. Declaring a element class and a few contextual methods

.. literalinclude:: ../examples/mini_example.py
:lines: 40-47

5. registration of the implementations for each backend

.. literalinclude:: ../examples/mini_example.py
:lines: 49-74

6. bringing it all together

.. literalinclude:: ../examples/mini_example.py
:lines: 76-
Loading