emdemor-app-template


Nameemdemor-app-template JSON
Version 0.0.3 PyPI version JSON
download
home_page
SummaryUm template para começar o desenvolvimento de apps
upload_time2023-01-06 21:31:28
maintainer
docs_urlNone
author
requires_python>=3.9
licenseCopyright (c) 2023, Eduardo Morais All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
keywords template app
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## Modificações

1. Altere o nome da pasta `emdemor_app_template` para o nome do seu App e desenvolva seu código ali. Vou citar como exemplo um app fictício `emmapp`.

2. No arquivo `environment.yml` altere o nome do ambiente conda para o que seja de maior conveniência. Por exemplo, pode-se usar `emmapp`.

3. Configure o arquivo `LICENSE` de acordo com a licensa que escolher.

4. No arquivo Makefile, substitua `emdemor_app_template` nas linhas 19 e 24 (dentro das regras clear e uninstall) para o nome de seu app (no nosso caso, `emmapp`)

5. No arquivo `pyproject.toml`, Substitua `emdemor_app_template` pelo nome de seu app nas linhas 6 (campo "name" dentro de [project]), 28 (campo "version" dentro de [tool.setuptools.dynamic]) e 32 (campo onde você define o comando para rodar o app. Escolha o comando que deseja usar.)

6. No arquivo `docs/source/conf.py`, substitua o app name nas linhas 9 (dentro do `sys.path.insert`) e 14 (nome do projeto). Aproveite para configurar as informações de autor e data.

7. Escreva a introdução da sua documentação no arquivo `docs/source/intro.rst`

8. Para cada modulo na pasta `emmapp` (no seu caso, será o nome de seu app), crie uma arquivo tipo RST dentro de `_files/_modules` com o nome do modulo. Por exemplo, para o módulo `emmapp.utils`, deve-se criar o arquivo `_files/_modules/utils.rst`. Dentro, deverá ter o seguinte código
```
{{nome do modulo}}
===================

.. automodule:: {{nome do modulo}}
   :members:
```

9. Para cada submodulo na pasta `emmapp` (no seu caso, será o nome de seu app), crie uma pasta dentro de `_files/_modules` com o nome do modulo e um arquivo tipo RST dentro dessa pasta para cada submodulo. Por exemplo, para do módulo `emmapp/mymodule/hello`, deve-se criar a pasta `_files/_modules/mymodule`, e dentro, o arquivo `_files/_modules/mymodule/hello.rst`. Nesse arquivo, deverá ter o seguinte código
```
{{nome do submodulo}}
===================

.. automodule:: {{nome do modulo}}.{{nome do submodulo}}
   :members:
```

10. Dentro de `_files/_usage`, edite o arquivo `getting_started.rst` e quaisquer outros arquivos que adicionar. Lembre-se que para cada arquivo novo em `docs/source/_files/_usage`, deve-se também referenciá-lo em  `docs/source/usage.rst`

## Detalhes sobre a documentação

1. Instale sphinx

```bash
pip install sphinx
```

2. Crie e entre na pasta docs e rode sphinx-quickstart

```bash
mkdir docs
cd docs
sphinx-quickstart
```

3. Preencha as informações

```bash
> 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á.

4. 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á:

```python
import os
import sys

sys.path.insert(0, os.path.abspath("../../src"))
```

5. Adicione extensões. No arquivo `docs/source/conf.py`, onde está

```python
# 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:

```python
# 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",
]
```

6. Altere o thema html do arquivo

```python
# The theme to use for HTML and HTML Help pages.  See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_rtd_theme"
```

7. 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:

```python
# 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,
}

```

8. Dentro da pasta docs, rode:

```bash
make html
```

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

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "emdemor-app-template",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "template,app",
    "author": "",
    "author_email": "Eduardo <emdemor415@gmail.com.br>",
    "download_url": "https://files.pythonhosted.org/packages/cc/0e/43d9db7384f4922e7b9239b0973c0f7f38ccfd6df1c0fbf92fa1b487f6e9/emdemor_app_template-0.0.3.tar.gz",
    "platform": null,
    "description": "## Modifica\u00e7\u00f5es\n\n1. Altere o nome da pasta `emdemor_app_template` para o nome do seu App e desenvolva seu c\u00f3digo ali. Vou citar como exemplo um app fict\u00edcio `emmapp`.\n\n2. No arquivo `environment.yml` altere o nome do ambiente conda para o que seja de maior conveni\u00eancia. Por exemplo, pode-se usar `emmapp`.\n\n3. Configure o arquivo `LICENSE` de acordo com a licensa que escolher.\n\n4. No arquivo Makefile, substitua `emdemor_app_template` nas linhas 19 e 24 (dentro das regras clear e uninstall) para o nome de seu app (no nosso caso, `emmapp`)\n\n5. No arquivo `pyproject.toml`, Substitua `emdemor_app_template` pelo nome de seu app nas linhas 6 (campo \"name\" dentro de [project]), 28 (campo \"version\" dentro de [tool.setuptools.dynamic]) e 32 (campo onde voc\u00ea define o comando para rodar o app. Escolha o comando que deseja usar.)\n\n6. No arquivo `docs/source/conf.py`, substitua o app name nas linhas 9 (dentro do `sys.path.insert`) e 14 (nome do projeto). Aproveite para configurar as informa\u00e7\u00f5es de autor e data.\n\n7. Escreva a introdu\u00e7\u00e3o da sua documenta\u00e7\u00e3o no arquivo `docs/source/intro.rst`\n\n8. Para cada modulo na pasta `emmapp` (no seu caso, ser\u00e1 o nome de seu app), crie uma arquivo tipo RST dentro de `_files/_modules` com o nome do modulo. Por exemplo, para o m\u00f3dulo `emmapp.utils`, deve-se criar o arquivo `_files/_modules/utils.rst`. Dentro, dever\u00e1 ter o seguinte c\u00f3digo\n```\n{{nome do modulo}}\n===================\n\n.. automodule:: {{nome do modulo}}\n   :members:\n```\n\n9. Para cada submodulo na pasta `emmapp` (no seu caso, ser\u00e1 o nome de seu app), crie uma pasta dentro de `_files/_modules` com o nome do modulo e um arquivo tipo RST dentro dessa pasta para cada submodulo. Por exemplo, para do m\u00f3dulo `emmapp/mymodule/hello`, deve-se criar a pasta `_files/_modules/mymodule`, e dentro, o arquivo `_files/_modules/mymodule/hello.rst`. Nesse arquivo, dever\u00e1 ter o seguinte c\u00f3digo\n```\n{{nome do submodulo}}\n===================\n\n.. automodule:: {{nome do modulo}}.{{nome do submodulo}}\n   :members:\n```\n\n10. Dentro de `_files/_usage`, edite o arquivo `getting_started.rst` e quaisquer outros arquivos que adicionar. Lembre-se que para cada arquivo novo em `docs/source/_files/_usage`, deve-se tamb\u00e9m referenci\u00e1-lo em  `docs/source/usage.rst`\n\n## Detalhes sobre a documenta\u00e7\u00e3o\n\n1. Instale sphinx\n\n```bash\npip install sphinx\n```\n\n2. Crie e entre na pasta docs e rode sphinx-quickstart\n\n```bash\nmkdir docs\ncd docs\nsphinx-quickstart\n```\n\n3. Preencha as informa\u00e7\u00f5es\n\n```bash\n> Separar os diret\u00f3rios de origem e compila\u00e7\u00e3o (y/n) [n]: y\n> Nome do projeto: Template de Python\n> Nome(s) de autor(es): A. U. Thor\n> Lan\u00e7amento do projeto []: 2022-12-31\n> Idioma do projeto [en]: en\n```\n\nAp\u00f3s isso, teremos duas pastas dentro de docs. A pasta source vai ser onde vamos trabalhar para gerar documenta\u00e7\u00e3o. A pasta build ser\u00e1 onde a documenta\u00e7\u00e3o estar\u00e1.\n\n4. Editar o endere\u00e7o do seus modulos (no template, \u00e9 a pasta src) em rela\u00e7\u00e3o ao arquivo `docs/source/conf.py`. No nosso caso, ser\u00e1:\n\n```python\nimport os\nimport sys\n\nsys.path.insert(0, os.path.abspath(\"../../src\"))\n```\n\n5. Adicione extens\u00f5es. No arquivo `docs/source/conf.py`, onde est\u00e1\n\n```python\n# Add any Sphinx extension module names here, as strings. They can be\n# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom\n# ones.\nextensions = []\n```\n\nSubstitua por:\n\n```python\n# Add any Sphinx extension module names here, as strings. They can be\n# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom\n# ones.\nextensions = [\n    \"sphinx.ext.autodoc\",\n    \"sphinx.ext.intersphinx\",\n    \"sphinx.ext.autodoc\",\n    \"sphinx.ext.mathjax\",\n    \"sphinx.ext.viewcode\",\n    \"sphinx.ext.napoleon\",\n]\n```\n\n6. Altere o thema html do arquivo\n\n```python\n# The theme to use for HTML and HTML Help pages.  See the documentation for\n# a list of builtin themes.\n#\nhtml_theme = \"sphinx_rtd_theme\"\n```\n\n7. Adicione logo, favicon e estilos css \u00e0 sua p\u00e1gina. Para isso, adicione todos os arquivos dentro de `docs/source/_static`. Dentro do arquivo `docs/source/conf.py`, adicione as seguintes linhas:\n\n```python\n# Add any paths that contain custom static files (such as style sheets) here,\n# relative to this directory. They are copied after the builtin static files,\n# so a file named \"default.css\" will overwrite the builtin \"default.css\".\nhtml_static_path = [\"_static\"]\n\nhtml_logo = \"_static/logo.png\"\n\nhtml_css_files = [\"custom-theme.css\"]\n\nhtml_favicon = \"_static/favicon.ico\"\n\nhtml_theme_options = {\n    \"logo_only\": True,\n    \"display_version\": False,\n}\n\n```\n\n8. Dentro da pasta docs, rode:\n\n```bash\nmake html\n```\n\nA documenta\u00e7\u00e3o estar\u00e1 em `docs/build/html`\n",
    "bugtrack_url": null,
    "license": "Copyright (c) 2023, Eduardo Morais  All rights reserved.  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:  Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ",
    "summary": "Um template para come\u00e7ar o desenvolvimento de apps",
    "version": "0.0.3",
    "split_keywords": [
        "template",
        "app"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ccb8188d61770660f8a7b30a16e7c5b49c804e29a109e9b1019985c3a77c4e6d",
                "md5": "2ff5c85d1b6a31a556dd6b1b7f100418",
                "sha256": "18c761047c35fec1b9429257026d3495a3a76d40c087a3c1c088ced725d88160"
            },
            "downloads": -1,
            "filename": "emdemor_app_template-0.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2ff5c85d1b6a31a556dd6b1b7f100418",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 6651,
            "upload_time": "2023-01-06T21:31:26",
            "upload_time_iso_8601": "2023-01-06T21:31:26.130016Z",
            "url": "https://files.pythonhosted.org/packages/cc/b8/188d61770660f8a7b30a16e7c5b49c804e29a109e9b1019985c3a77c4e6d/emdemor_app_template-0.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cc0e43d9db7384f4922e7b9239b0973c0f7f38ccfd6df1c0fbf92fa1b487f6e9",
                "md5": "1292af741252b0c528ac866701fd7e2f",
                "sha256": "256fe4dbad8d66c6fb057417cdf1fa55f5ef85b82bf7a1054ce33297ca1c5d8e"
            },
            "downloads": -1,
            "filename": "emdemor_app_template-0.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "1292af741252b0c528ac866701fd7e2f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 4961,
            "upload_time": "2023-01-06T21:31:28",
            "upload_time_iso_8601": "2023-01-06T21:31:28.135465Z",
            "url": "https://files.pythonhosted.org/packages/cc/0e/43d9db7384f4922e7b9239b0973c0f7f38ccfd6df1c0fbf92fa1b487f6e9/emdemor_app_template-0.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-06 21:31:28",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "emdemor-app-template"
}
        
Elapsed time: 0.02748s