Skip to main content

Um template para começar o desenvolvimento de apps

Project description

Gerar Documentação

  1. Instale sphinx
pip install sphinx
  1. Crie e entre na pasta docs e rode sphinx-quickstart
mkdir docs
cd docs
sphinx-quickstart
  1. Preencha as informações
> Separar os diretórios de origem e compilação (y/n) [n]: y
> Nome do projeto: Template de Python
> Nome(s) de autor(es): A. U. Thor
> Lançamento do projeto []: 2022-12-31
> Idioma do projeto [en]: en

Após isso, teremos duas pastas dentro de docs. A pasta source vai ser onde vamos trabalhar para gerar documentação. A pasta build será onde a documentação estará.

  1. Editar o endereço do seus modulos (no template, é a pasta src) em relação ao arquivo docs/source/conf.py. No nosso caso, será:
import os
import sys

sys.path.insert(0, os.path.abspath("../../src"))
  1. Adicione extensões. No arquivo docs/source/conf.py, onde está
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = []

Substitua por:

# 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.intersphinx",
    "sphinx.ext.autodoc",
    "sphinx.ext.mathjax",
    "sphinx.ext.viewcode",
    "sphinx.ext.napoleon",
]
  1. Altere o thema html do arquivo
# The theme to use for HTML and HTML Help pages.  See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_rtd_theme"
  1. Adicione logo, favicon e estilos css à sua página. Para isso, adicione todos os arquivos dentro de docs/source/_static. Dentro do arquivo docs/source/conf.py, adicione as seguintes linhas:
# 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"]

html_logo = "_static/logo.png"

html_css_files = ["custom-theme.css"]

html_favicon = "_static/favicon.ico"

html_theme_options = {
    "logo_only": True,
    "display_version": False,
}
  1. Dentro da pasta docs, rode:
make html

A documentação estará em docs/build/html

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

emdemor_app_template-0.0.2.tar.gz (4.1 kB view hashes)

Uploaded Source

Built Distribution

emdemor_app_template-0.0.2-py3-none-any.whl (5.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page