Documentació#

Truc

La documentació d’aquest lloc està escrita en ReStructuredTex, o, abreujadament, RST. Si us plau mireu RST Primer si no coneixeu el RST.

Aquesta pàgina us guiarà en la escriptura de magnifica documentació per al projecte UBports que es pot mostrar a aquest lloc.

Directrius de la documentació#

These rules govern how you should write your documentation to avoid problems with style, format, or linking.

Títol#

All pages must have a document title that will be shown in the table of contents (left sidebar) and at the top of the page.

Titles should be «sentence cased» rather than «Title Cased». For example:

Incorrect casing:
    Writing A Good Bug Report
Correct casing:
    Writing a good bug report
Correct casing when proper nouns are involved:
    Installing Ubuntu Touch on your phone

No hi ha una definició única sobre com fer títols amb frases que tothom segueix, però fer títol amb frases és senzill. Això ajuda a mantenir les majúscules consistents a la taula de continguts.

Page titles are underlined with equals signs. For example, the markup for Informació d’errors includes the following title:

Bug reporting
=============

Note that:

  1. The title is sentence cased

  2. The title is underlined with equals signs

  3. The underline spans the title completely without going over

Incorrect examples of titles include:

  • Incorrect casing

    Bug Reporting
    =============
    
  • Underline too short

    Bug reporting
    =====
    
  • Underline too long

    Bug reporting
    ================
    

Headings#

There are several levels of headings that you may place on your page. These levels are shown here in order:

Page title
==========

Level one
---------

Level two
^^^^^^^^^

Level three
"""""""""""

Each heading level creates a sub-section in the global table of contents tree available when the documentation is built. In the primary (web) version of the documentation, this only shows four levels deep from the top level of the documentation. Please refrain from using more heading levels than will show in this tree as it makes navigating your document difficult. If you must use this many heading levels, it is a good sign that your document should be split up into multiple pages.

Taula de continguts#

La gent no pot navegar a la vostra pàgina si no la poden trobar. Tampoc no pot l’Sphinx. És per això que heu d’afegir pàgines noves a la taula de continguts de l’Sphinx.

You can do this by adding the page to the index.rst file in the same directory that you created it. For example, if you create a file called «newpage.rst», you would add the line marked with a chevron (>) in the nearest index:

.. toctree::
    :maxdepth: 1
    :name: example-toc

    oldpage
    anotheroldpage
>   newpage

L’ordre importa. Si us agradaria que la vostra pàgina aparegui a un lloc determinat de la taula de continguts, ubiqueu-la allà. A l’exemple anterior, paginanova s’afegiria al final de la taula de continguts.

Moving pages#

Sometimes it becomes necessary to move a page from one place in the documentation to another. Generally this is to improve document flow: For example, it makes more sense for the page to come after a page you’ve just added in a different section.

However, people link to our documentation from many sources that we do not control. Blogs, websites, and other documentation sites can direct people here using links that they may never update. It is a terrible experience to follow a link from a different site and land on a 404 page, left to your own devices to find your way in restructured documentation.

We use a tool called Rediraffe to avoid this bad experience. Rediraffe creates redirect pages which can send a user from an old, invalid link to a new, useful link. Please create a redirect link when changing a page’s name or moving a page within the documentation’s directory structure. Redirect links are created by placing the filename of the old document and the filename of the new document, relative to the documentation’s root, in the redirects.txt file.

We use Rediraffe’s checkdiff builder to ensure that pages are not deleted from the documentation without a redirect in place. This builder is run as part of the build.sh script in the repository and as part of our automated build once you submit a Pull Request.

What follows are some examples of situations where you should create redirects.

You are moving systemdev/calendars.rst to appdev/calendars.rst. Add the following to the redirects.txt file:

"systemdev/calendars.txt" "appdev/calendars.txt"

You are moving appdev/clickable.rst into several pages in appdev/clickable/ to give significantly more information about the tool than there was previously. You have created an introduction page, appdev/clickable/introduction.rst. In this case, it would be a good idea to redirect the old page to the new introduction page. This can be done by adding the following to redirects.txt:

"appdev/clickable.rst" "appdev/clickable/introduction.rst"

Advertiments#

Your edits must not introduce any warnings into the documentation build. If any warnings occur, the build will fail and your pull request will be marked with a red “X”. Please ensure that your RST is valid and correct before you create a pull request. This is done automatically (via sphinx-build crashing with your error) if you follow our build instructions below.

Line length#

There is no restriction on line length in this repository. Please do not break lines at an arbitrary line length. Instead, turn on word wrap in your text editor.

Flux de treball de les contribucions#

Després que hàgiu escrit un document, els passos següents us ajudaran a fer una contribució a aquesta documentació.

Nota

Us caldrà un compte del GitHub per completar aquests passos. Si no en teniu una, cliqueu aquí per començar el procés de crear un compte.

Bifurcació del repositori#

Podeu fer edicions més avançades de la nostra documentació bifurcant ubports/docs.ubports.com al GitHub. Si no teniu seguretat sobre com fer això, mireu l’excel·lent guia del GitHub a bifurcació de projectes.

Compilació de la documentació#

Si voleu compilar aquesta documentació abans d’enviar una demanda de baixada (cosa que hauríeu de fer), seguiu aquestes instruccions a la còpia local de la vostra bifurcació del repositori.

Es pot compilar la documentació executant ./build.sh a l’arrel d’aquest repositori. L’script crearà també un entorn virtual de compilació a ~/ubportsdocsenv, si no n’hi ha cap present.

Si tot ha anat bé, podeu entrar el directori _build/html i obrir index.html per veure la documentació de l’UBports.

Si teniu algun problema en la compilació dels documents, el primer a provar és eliminar l’entorn de compilació. Executeu rm -r ~/ubportsdocsenv i proveu un altre cop la compilació. Depenent de quan vau usar l’script de compilació per primer cop, potser haureu d’executar l’ordre rm amb sudo.

Final check of your contribution#

After you have created your PR on github, the CI (continuous integration) system will make a test build of your contribution. Please double check whether this builds successfully and whether the result looks as you intended it to:

  • Scroll to the bottom of the «Conversation» tab of your PR on github, here you will see the checks (You may have to click on «Show all checks»)

  • It can have a yellow dot, i.e., «pending» then wait a few more seconds.

  • Or it may have a red X, i.e., it failed. In this case please check why it failed

  • If it shows a green check mark, it means the PR could be built successfully

  • Now please click on «Details»,

  • then «Artifacts» on the top right,

  • then «_build/html/..index.html»,

  • and finally on «Go to start page».

Now you can browse a complete build of the UBports docs site with your contribution included. Double check whether your changes look ok.

Mètodes alternatius per contribuir#

Traduccions#

Podeu trobar els components d’aquest document per traduir a its project in UBports Weblate.

Escriptura de documents en formats diferents al RST#

Si volguéssiu escriure documents per a l’UBports però no us agrada escriure RestructuredText, si us plau escriviu-lo sense format i publiqueu-lo al UBports Forum a la secció rellevant (probablement General). Algú us podrà ajudar a revisar el vostre esborrany i a escriure el ReStructuredText requerit.

Incomoditat amb Git#

Si heu escrit un document complet amb el ReStructredText però no teniu comoditat usant Git o GitHub, si us plau publiqueu-lo al UBports Forum a la secció rellevant (probablement General). Algú us podrà ajudar a revisar el vostre esborrany i a pujar-lo a aquesta documentació.

PER FER actuals#

This section lists the TODOs that have been included in this documentation. If you know how to fix one, please send us a Pull Request to make it better!

Per crear un per fer, afegiu aquest marcatge a la vostra pàgina:

.. todo::

   My todo text

Tasca pendent

There is also another way to create somewhat more featureful webapps, sometimes referred to as webapp+ or alternative container. This needst to be properly documented. It’s a simple qml app that can be easily configured. Creation is almost as simple as “classic” webapp, but result is more powerfull with the a nice navigation feature. A rather advanced example of this is the YouTube app from Mateo Salta which has quite some modifications on top of the template.

(L'entrada original es troba a /home/docs/checkouts/readthedocs.org/user_builds/docsubportscom-catalan/checkouts/latest/appdev/webapp/index.rst, línia 19).

Tasca pendent

Document the process for Nexus 4 (mako)

(L'entrada original es troba a /home/docs/checkouts/readthedocs.org/user_builds/docsubportscom-catalan/checkouts/latest/systemdev/kernel-hal.rst, línia 57).