Skip to content

Commit

Permalink
Starts the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
lucassimon committed Feb 5, 2018
1 parent 5bc8eb6 commit f1b4702
Show file tree
Hide file tree
Showing 5 changed files with 135 additions and 77 deletions.
6 changes: 3 additions & 3 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = python -msphinx
SPHINXBUILD = sphinx-build
SPHINXPROJ = correios
SOURCEDIR = .
BUILDDIR = _build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
Expand Down
20 changes: 0 additions & 20 deletions docs/index.rst

This file was deleted.

72 changes: 36 additions & 36 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=python -msphinx
)
set SOURCEDIR=.
set BUILDDIR=_build
set SPHINXPROJ=correios

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The Sphinx module was not found. Make sure you have Sphinx installed,
echo.then set the SPHINXBUILD environment variable to point to the full
echo.path of the 'sphinx-build' executable. Alternatively you may add the
echo.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
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

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

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
43 changes: 25 additions & 18 deletions docs/conf.py → docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# correios documentation build configuration file, created by
# sphinx-quickstart on Sun Oct 15 22:20:13 2017.
# sphinx-quickstart on Mon Feb 5 21:17:31 2018.
#
# This file is execfile()d with the current directory set to its
# containing dir.
Expand Down Expand Up @@ -31,6 +32,12 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.mathjax',
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode']

# Add any paths that contain templates here, relative to this directory.
Expand All @@ -41,49 +48,49 @@
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'

source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'

# General information about the project.
project = u'correios'
copyright = u'2017, olist'
author = u'olist'
project = 'correios'
copyright = '2018, olist'
author = 'olist'

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

# 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
language = 'pt_br'

# 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']
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
todo_include_todos = True


# -- 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'
html_theme = 'default'

# 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
Expand All @@ -103,11 +110,8 @@
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
html_sidebars = {
'**': [
'about.html',
'navigation.html',
'relations.html', # needs 'show_related': True theme option to display
'searchbox.html',
'donate.html',
]
}

Expand Down Expand Up @@ -142,8 +146,8 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'correios.tex', u'correios Documentation',
u'olist', 'manual'),
(master_doc, 'correios.tex', 'correios Documentation',
'olist', 'manual'),
]


Expand All @@ -152,7 +156,7 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'correios', u'correios Documentation',
(master_doc, 'correios', 'correios Documentation',
[author], 1)
]

Expand All @@ -163,10 +167,13 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'correios', u'correios Documentation',
(master_doc, 'correios', 'correios Documentation',
author, 'correios', 'One line description of project.',
'Miscellaneous'),
]




# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}
71 changes: 71 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
correios
========

.. image:: https://img.shields.io/pypi/v/correios.svg
:target: https://pypi.python.org/pypi/correios
:alt: Latest PyPI version

.. image:: https://travis-ci.org/olist/correios.png
:target: https://travis-ci.org/olist/correios
:alt: Latest Travis CI build status

.. image:: https://codecov.io/gh/olist/correios/branch/master/graph/badge.svg
:target: https://codecov.io/gh/olist/correios
:alt: Latest coverage status

A client library for Brazilian Correios APIs (SIGEP and SRO) and services.


Installation
------------

.. code-block:: shell
$ pip install correios # basic model support
$ pip install correios[pdf] # label and posting list pdf generation support
$ pip install correios[api] # support for SIGEP/SRO API client
$ pip install correios[pdf,api] # full installation
Update Local WSDL Files
-----------------------

Local WSDL files are used to increase performance on SOAP requests. Enventually
you'll want to update them and withou having to update this lib.

If you want to maintain this files on a custom path you can pass the 'path'
option with the custom path. Don't use relative paths.

Just run on shell

.. code-block:: shell
$ update-correios-wsdl -p /path/to/your/custom/wsdl/folder
Arguments:
-p, --path : Custom path where wsdl files will be saved, note that this option
will have higher priority than the value of the envvar 'CORREIOS_WSDL_PATH'


Or you can use the method update_wsdl to do it.

.. code-block:: python
from correios.update_wsdl import update_wsdl
update_wsdl(path='/path/to/your/custom/wsdl/folder')
That's it!

.. toctree::
:maxdepth: 4
:caption: Contents:



Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

0 comments on commit f1b4702

Please sign in to comment.