Skip to content

Commit

Permalink
Updated existing documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
gentlecat committed Feb 4, 2015
1 parent 62e124d commit 2b33544
Show file tree
Hide file tree
Showing 12 changed files with 57 additions and 58 deletions.
2 changes: 1 addition & 1 deletion docs/contrib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ Contributing
contrib/intro
contrib/installation
contrib/db
contrib/backup
contrib/export
contrib/translation
2 changes: 1 addition & 1 deletion docs/contrib/db.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ Entities
Schema diagram
--------------

.. image:: /images/schema.png
.. image:: /images/schema.svg
20 changes: 11 additions & 9 deletions docs/contrib/backup.rst → docs/contrib/export.rst
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
Backups
=======
Exporting data
==============

You can create backups including various pieces of data that we store: reviews,
revisions, users, and other stuff. Some parts include private data about users
that is not meant to be shared.

Creating backups
----------------
Creating data dumps
-------------------

Below you can find commands that can be used to create backups of different formats.

Complete database dump *(for PostgreSQL)*::

$ python manage.py data backup dump_db -r
$ python manage.py export full_db

JSON dump with all reviews *(no private info)*::
MusicBrainz-style dump public *(no private info)*::

$ python manage.py export public

$ python manage.py data backup dump_json -r
JSON dump with all reviews *(no private info)*::

MusicBrainz-style dump *(no private info)*::
$ python manage.py export json

$ python manage.py data backup export -r
All commands have rotation feature which can be enabled by passing `-r` argument.
10 changes: 2 additions & 8 deletions docs/contrib/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,7 @@ If you don't want to do that yet, here's a list of blueprints that should be kep
More information about importance of keeping transport layer secure is available at
https://www.owasp.org/index.php/Top_10_2010-A9-Insufficient_Transport_Layer_Protection.

Running
-------

Don't forget to enter your virtual environment first::

$ source ./env

Now you can safely run the webservice app::
Running the server
------------------

$ python run.py
29 changes: 18 additions & 11 deletions docs/contrib/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ Introduction
CritiqueBrainz project is separated into three main packages: data, frontend, and web service (ws).
The data package is used to interact with the database. The frontend provides user-friendly interface
that is available at https://critiquebrainz.org. The web service provides web API for CritiqueBrainz
(see :doc:`api`).
(see :doc:`../dev/api`).

*Here's an overview of the project structure:*

.. image:: /images/structure.svg

Contributing
^^^^^^^^^^^^
Expand All @@ -14,8 +18,8 @@ See `CONTRIBUTING.md file <https://github.com/metabrainz/critiquebrainz/blob/mas
Using Vagrant
^^^^^^^^^^^^^

Vagrant significantly simplifies development process on all major platforms by running applications in reproducible
environment. It is available at http://www.vagrantup.com/.
Vagrant significantly simplifies development process on all major platforms by running applications in
reproducible environment. It is available at http://www.vagrantup.com/.

You can use it for CritiqueBrainz development. All you need to do is set up custom configuration file.
After that you can start a VM and connect to it::
Expand All @@ -30,24 +34,27 @@ After VM is created and running, you can start the application::

Web server should be accessible at http://localhost:5000/.

PostgreSQL will be available on port *15432* with `trust`_ authentication method.
PostgreSQL will also be available on port *15432* with `trust`_ authentication method.

.. _trust: http://www.postgresql.org/docs/9.1/static/auth-methods.html#AUTH-TRUST

Testing
^^^^^^^

To run all tests activate virtual environment and run ``run_tests.py`` script::
To run all tests use::

$ source ./env
$ python run_tests.py
$ fab test

This command run all tests and, if successful, produce a test coverage report.

Modifying strings
^^^^^^^^^^^^^^^^^

CritiqueBrainz supports interface translation. If you add or modify strings that will be displayed to user,
then you need to wrap them in one of two functions: ``gettext()`` or ``ngettext()``.
CritiqueBrainz supports interface translation. If you add or modify strings that will be displayed
to users, then you need to wrap them in one of two functions: ``gettext()`` or ``ngettext()``.

Before committing changes don't forget to extract all strings into ``messages.pot``:

Before committing changes don't forget to extract all strings into ``messages.pot``.
$ fab update_strings

For more info see :doc:`../translation`.
For more info see :doc:`translation`.
22 changes: 8 additions & 14 deletions docs/contrib/translation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,19 @@ Our project page is located at https://www.transifex.com/projects/p/critiquebrai
There are a couple of things you should know if you are trying to modify strings.
See the info below.

Working locally
---------------

Before doing anything make sure that you have virtual environment set up.
Activate it to have access to ``pybabel`` and ``fab`` commands::

$ source ./env

Extracting strings
^^^^^^^^^^^^^^^^^^
------------------

To extract strings into a Portable Object Template file (*messages.pot*) use command::

$ fab extract_strings

Adding support for a new language
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
---------------------------------

To add support for new language add its Transifex code into ``SUPPORTED_LANGUAGES`` list in default configuration file:
``default_config.py``. After that you can pull translations from Transifex::
To add support for new language add its Transifex code into ``SUPPORTED_LANGUAGES``
list in default configuration file: ``default_config.py``. After that you can pull
translations from Transifex::

$ fab pull_translations

Expand All @@ -50,6 +43,7 @@ You will need to create *.transifexrc* file that will look like::
More info about setup process is available at http://docs.transifex.com/developer/client/setup.

Additional info
^^^^^^^^^^^^^^^
---------------

CritiqueBrainz uses Flask-Babel extension. Its documentation is available at http://pythonhosted.org/Flask-Babel/.
CritiqueBrainz uses Flask-Babel extension. Its documentation is available at
http://pythonhosted.org/Flask-Babel/.
2 changes: 1 addition & 1 deletion docs/dev.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Development
===========

This part of CritqueBrainz documentation will help you find information about
our web service
our web service.

.. toctree::
:maxdepth: 2
Expand Down
Binary file removed docs/images/schema.png
Binary file not shown.
1 change: 1 addition & 0 deletions docs/images/schema.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2b33544

Please sign in to comment.