Guia da Documentação

Introdução

QGIS Documentation will be built automatically on the server at 0, 8am, 4pm PDT (Pacific Daylight Time). The current status is available at http://docs.qgis.org.

QGIS Documentation is mainly written using the reStructuredText (reST) format syntax, coupled with some scripts from the Sphinx toolset to post-process the HTML output. See http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html or http://sphinx.pocoo.org/markup/inline.html.

In general, when creating rst documentation for the QGIS project, please follow the Python documentation style guidelines. Below are exposed some general guidelines to follow when using reST for the QGIS documentation writing.

If you are looking for general rules on contributing to QGIS project or managing repositories, you may find help at Get Involved in the QGIS Community.

Escrevendo Documentação

Cabeçalhos

Cada página da web da documentação corresponde a um arquivo .rst.

Sections used to structure the text are identified through their title which is underlined (and overlined for the first level). Same level titles must use same character for underline adornment. In QGIS Documentation, you should use following styles for chapter, section, subsection and minisec.

********
Chapter
********

Section
=======

Subsection
----------

Minisec
.......

Subminisec
^^^^^^^^^^

Etiquetas embutidas

Você pode usar algumas etiquetas dentro do texto para enfatizar itens.

  • Menu gui: to mark a complete sequence of menu selections, including selecting submenus and choosing a specific operation, or any subsequence of such a sequence.

    :menuselection:`menu --> submenu`
  • Dialog and Tab title: Labels presented as part of an interactive user interface including window title, tab title and option labels.

    :guilabel:`title`
  • Button labels

    **[Apply]**
  • Nome do arquivo ou diretório

    :file:`README.rst`
  • Icon with popup text belonging to Icon

    |icon| :sup:`popup_text`

    (see image below).

  • Atalho do teclado

    :kbd:`ctrl B`

    will show Ctrl B

  • Texto do usuário

    ``label``
    

Rótulo/referência

References are used to place anchors inside the text. It then helps you create and call hyperlinks between sections or page.

O exemplo abaixo cria a âncora de uma seção (por exemplo, Rótulo/título de referência)

.. _my_anchor:

Label/reference
---------------

To call the reference in the same page, use

see my_anchor_ for more information.

o qual irá retornar:

veja my_anchor para mais informação.

Notice how it will jump to the following line/thing following the ‘anchor’. Normally to declare this label you do not need to use apastroph’s but you do need to use empty lines before and after the anchor.

Um outro modo para pular para o mesmo lugar de qualquer lugar na documentação é usar a regra ”:ref:”.

see :ref:`my_anchor` for more information.

which will display the caption instead (in this case the title of this section!):

veja :ref:’my_anchor’ para mais informação.

So reference 1 (my_anchor) and reference 2 (Rótulo/referência). Because the reference often displays a full caption, there is not really the need to use the word section. Note that you can also use a custom caption to describe the reference

see :ref:`Label and reference <my_anchor>` for more information.

returning:

veja :ref: Rótulo e referência <my_anchor> para mais informação.

Figura e imagem

Fotos

Para inserir uma imagem, use

.. image:: /static/common/qgislogo.png
   :width: 10 em

o qual retorna

../../_images/qgislogo.png

Substituição

Você pode colocar uma imagem dentro do texto ou adicionar um pseudônimo para usar em qualquer lugar. Para usar uma imagem dentro de um parágrafo, basta criar um pseudônimo em algum lugar.

.. |nice_logo| image:: /static/common/qgislogo.png
               :width: 2 em

e chame isso em seu paragrafo:

my paragraph begins here with a nice logo |nice_logo|.

Here is how this example become:

meu paragrafo começa aqui com um belo logo |belo_logo|.

Nota

Atualmente, para garantir consistência e ajuda no uso de ícones do QGIS, uma lista de pseudônimos é construída e disponibilizada no :ref: capítulo substituições.

Figura

.. _figure_readme_1:

.. only:: html

   **Figure Readme 1:**

.. figure:: /static/common/qgislogo.png
   :width: 20 em
   :align: center

   A caption: A logo I like

O resultado se parece com isso:

Figure Readme 1:

../../_images/qgislogo.png

Uma legenda: A logo que eu gosto

Use `` .. only :: html`` para fazer o número da figura (Figura Leia-me 1) visível somente nos arquivos html. Os scripts irão inserir um número gerado automaticamente antes da legenda da figura em pdf.

To use a caption (see My caption) just insert indented text after a blank line in the figure block.

Referencing to the figure can be done using the reference label like this

(see Figure_Readme_1_).

It will show the anchor Figure_Readme_1. You can use uppercase if you want. It can be used in the same .rst document but not in other .rst documents.

You can not use the :ref: role for reference anymore, because in html the reference to the caption is lost (it now refers to the place before Figure Readme 1:)

see :ref:`figure_readme_1`, does not work due to the lost reference to
the caption of the figure, this is not a 'bug' but a choice we made!

Tabelas

Criar uma tabela simples

=======  =======  =======
x        y        z
=======  =======  =======
1        2        3
2        4
=======  =======  =======

Use a \ followed by an empty space to leave an empty space.

Pode também usar tabelas mais complicadas desenhando-as usando as referências e muito mais

.. _my_drawn_table_1:

+---------------+--------------------+
| Windows       | Mac OSX            |
+---------------+--------------------+
| |win|         | |osx|              |
+---------------+--------------------+
| and of course not to forget |nix|  |
+------------------------------------+

My drawn table, mind you this is unfortunately not regarded a caption

You can reference to it like this my_drawn_table_1_.

O resultado:

Windows Mac OSX
win osx
and of course not to forget nix

My drawn table, mind you this is unfortunately not regarded a caption

Pode referenciar como este my_drawn_table_1.

Índice

Several index tag exists in RST. To be able to translate the index, it is necessary to integrate it into the normal text. In this case use this syntax:

QGIS allows to load several :index:`Vector formats` supported by GDAL/OGR ...

Se o termo não necessita ser traduzido, por favor use esta sintaxe:

.. index:: WMS, WFS, WCS, CAT, SFS, GML, ...

Notas de rodapé

Please note: Footnotes are not recognized by any translation software and it is also not converted to pdf format properly. So, if possible don’t use footnotes within any documentation.

Isto é para a criação de notas de rodapé

blabla [1]_

Que irá apontar para:

[1]Updates of core plugins

Gerenciando Capturas de Tela

Adicionar novas Capturas de Tela

Here are some hints to create new, nice looking screenshots. For the user guide they go into ./resources/en/user_manual/

  • same environment for all the screen caps (same OS, same decoration, same font size). We have used Ubuntu with Unity and the default “ambience” theme. For screenshots of QGIS main window and composer we have set it to show menus on the window (not the default in unity).
  • reduce the window to the minimal space needed to show the feature (taking the all screen for a small modal window > overkill)
  • quanto menos confusão, melhor (não há necessidade de ativar todos as barras de ferramentas)

  • não redimensione-os com um editor de imagem, o tamanho será definido se necessário dentro dos arquivos rst (a redução de dimensões sem uma resolução correta > fica feio)

  • cut the background
  • Set print size resolution to 135 dpi, eg in Gimp set the print resolution (image > print size) and save. This way, if no size is set in the rst files, images will be at original size in html and at a good print resolution in the PDF. You can use ImageMagick convert command to do a batch of images:
convert -units PixelsPerInch input.png -density 135 output.png
  • salve elas em png (sem artefatos jpeg)

  • a captura de tela deve mostrar o conteúdo de acordo com o que está descrito no texto

  • you can find some prepared QGIS-projects that were used before to create screenshots in ./qgis-projects. This makes it easier to reproduce screenshots for the next version of QGIS. These projects use the QGIS Sample Data (aka Alaska Dataset), which should be placed in the same folder as the QGIS-Documentation Repository.
  • Use o seguinte comando para remover a função global do menu no Ubuntu para criar menores telas de aplicações junto a menus:

sudo apt-get autoremove appmenu-gtk appmenu-gtk3 appmenu-qt

Traduzir Capturas de Tela

Here are some hints to create screenshots for your translated user guide. They will go into ./resources/<your language>/user_manual/

  • same environment for all the screen caps (same OS, same decoration, same font size)
  • use the QGIS -projects included in QGIS-Documentation repository (in ./qgis_projects ). These were used to produce the ‘original’ screenshots in the manual. The QGIS Sample Data (aka Alaska Dataset) should be placed in the same folder as the QGIS-Documentation Repository.
  • same size as the english ‘original’ screenshots, otherwise they will be stretched and look ugly. If you need to have a different size due to longer ui strings, don’t forget to change the dimension in the rst code of your language.
  • reduce the window to the minimal space needed to show the feature (taking all the screen for a small modal window > overkill)
  • quanto menos confusão, melhor (não há necessidade de ativar todos as barras de ferramentas)

  • não redimensione-os com um editor de imagem, o tamanho será definido dentro dos arquivos rst (a redução de dimensões sem uma resolução correta > fica feio)

  • cut the background
  • salve elas em png (sem artefatos jpeg)

  • a captura de tela deve mostrar o conteúdo de acordo com o que está descrito no texto

Documentando os Algoritmos de Processamento

Se você quer escrever uma documentação para processamento de algoritmos considere estas diretrizes:

  • don’t overwrite existing help files by files from other sources (e.g. QGIS source tree or Processing-Help repository), this files have different formats
  • Arquivos de ajuda do algoritmo de processamento fazem parte do Guia do Usuário QGIS, portanto, use mesma formatação do Guia do Usuário e outros documentos

  • evite usar “Este algoritmo faz isso e aquilo...” como primeira frase na descrição do algoritmo. Experimente usar palavras mais gerais como na ajuda dos algoritmos TauDEM ou GRASS

  • adicione imagens se necessáro. Use o formato PNG e siga as diretrizes gerais para documentação.

  • se necessário adicionar links para informações adicionais (por exemplo, publicações ou páginas da web) para a seção “Veja também”

  • dar explicação clara para os parâmetros e saídas dos algoritmos (novamente GRASS e TauDEM são bons exemplos).

  • don’t edit parameter or output names. If you found typo or wrong spelling — report this in bugracker, so developers can fix this in Processing code too
  • não liste as opções disponíveis na descrição do algoritmo, opções já listadas no parâmetro de descrição.

  • não adicionar informações sobre o tipo de geometria vetor no algoritmo ou descrição do parâmetro sem razão convincente que essa informação está disponível na descrição do parâmetro