Skip to content

Commit

Permalink
Update dev help function and helper commands docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Yamboy1 committed Dec 14, 2022
1 parent 80bd04c commit 6cce179
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 5 deletions.
8 changes: 4 additions & 4 deletions dev
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ cmd_update_data() {
echo "Loading content..."
docker compose -f docker-compose.local.yml run --rm --label traefik.enable=false django python ./manage.py updatedata "$@"
}
defhelp updatedata 'Load content into database.'
defhelp update_data 'Load content into database.'

# Build static files
cmd_static() {
Expand Down Expand Up @@ -146,21 +146,21 @@ cmd_rebuild_search_indexes() {
echo "Rebuilding search index..."
docker compose -f docker-compose.local.yml run --rm --label traefik.enable=false django python ./manage.py rebuild_search_indexes
}
defhelp rebuild_index "Run Django rebuild_search_indexes command."
defhelp rebuild_search_indexes "Run Django rebuild_search_indexes command."

# Run Django makeresourcethumbnails command
cmd_make_resource_thumbnails() {
echo "Creating thumbnails for resource PDFs..."
docker compose -f docker-compose.local.yml run --rm --label traefik.enable=false django python ./manage.py makeresourcethumbnails
}
defhelp makeresourcethumbnails 'Run Django makeresourcethumbnails command.'
defhelp make_resource_thumbnails 'Run Django makeresourcethumbnails command.'

# Run Django makeresources command
cmd_make_resources() {
echo "Creating static resource PDFs..."
docker compose -f docker-compose.local.yml run --rm --label traefik.enable=false django python ./manage.py makeresources "$@"
}
defhelp makeresources 'Run Django makeresources command.'
defhelp make_resources 'Run Django makeresources command.'

# Run Django create_lesson_pdfs command
cmd_create_lesson_pdfs() {
Expand Down
77 changes: 76 additions & 1 deletion docs/getting_started/helper_commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,19 @@ Where ``[COMMAND]`` is a word from the list below:

- :ref:`build`
- :ref:`collect_static`
- :ref:`create_lesson_pdfs`
- :ref:`createsuperuser`
- :ref:`end`
- :ref:`exec`
- :ref:`help`
- :ref:`logs`
- :ref:`makemessages`
- :ref:`makemigrations`
- :ref:`make_resources`
- :ref:`make_resource_thumbnails`
- :ref:`migrate`
- :ref:`reboot_django`
- :ref:`rebuid_search_indexes`
- :ref:`restart`
- :ref:`start`
- :ref:`static`
Expand All @@ -35,6 +41,7 @@ Where ``[COMMAND]`` is a word from the list below:
- :ref:`test_suite`
- :ref:`update`
- :ref:`update_data`
- :ref:`update_static`

All users of the project (content and technical developers) should become familiar with the following commands:

Expand All @@ -54,6 +61,16 @@ Running ``./dev build`` will build or rebuild the Docker images that are require

-----------------------------------------------------------------------------

.. _createsuperuser:

``createsuperuser``
==============================================================================

Running ``./dev createsuperuser`` runs the Django ``createsuperuser`` command to create a superuser account.
This is required to access the Django admin interface.

-----------------------------------------------------------------------------

.. _collect_static:

``collect_static``
Expand All @@ -64,6 +81,14 @@ It will copy files under the ``static/`` folder into the ``staticfiles/`` folder

-----------------------------------------------------------------------------

.. _create_lesson_pdfs:

``create_lesson_pdfs``
==============================================================================

Running ``./dev create_lesson_pdfs`` runs the Django ``create_lesson_pdfs`` command.
This will create PDF files for each lesson that are accessible through the website.

.. _end:

``end``
Expand All @@ -73,6 +98,18 @@ Running ``./dev end`` will stop any containers which are currently running, this

-----------------------------------------------------------------------------

.. _exec:

``exec``
==============================================================================

Running ``./dev exec [COMMAND]`` will run the given command in the Django Docker container.
For example, to run ``ls`` in the Django Docker container, enter:

.. code-block:: bash
$ ./dev exec ls
.. _help:

``help``
Expand Down Expand Up @@ -100,7 +137,7 @@ To follow logs as they output, enter ``docker compose logs --follow``.
``makemessages``
==============================================================================

Running ``./dev makemessages`` runs the Djanog ``makemessages`` command.
Running ``./dev makemessages`` runs the Django ``makemessages`` command.
This will create message files where each message file represents a single language.
Message files contain all available translation strings and how they should be represented in the given language.

Expand All @@ -115,6 +152,26 @@ Running ``./dev makemigrations`` runs the Django ``makemigrations`` command to c

-----------------------------------------------------------------------------

.. _make_resources:

``make_resources``
==============================================================================

Running ``./dev make_resources`` runs the Django ``makeresources`` command.
This will create resource files for each resource and puts them in ``build/resources/``.

-----------------------------------------------------------------------------

.. _make_resource_thumbnails:

``make_resource_thumbnails``
==============================================================================

Running ``./dev make_resource_thumbnails`` runs the Django ``makeresourcethumbnails`` command.
This will create thumbnail images for each resource and puts them in ``build/img/resources/{resource}/thumbnails/{language}``.

-----------------------------------------------------------------------------

.. _migrate:

``migrate``
Expand All @@ -133,6 +190,14 @@ Running ``./dev reboot_django`` will rebuild the Django Docker container.

-----------------------------------------------------------------------------

.. _rebuid_search_indexes:

``rebuid_search_indexes``
==============================================================================

Running ``./dev rebuild_search_indexes`` runs the Django ``rebuild_search_indexes`` command.
This will rebuild the search indexes for the website.

.. _restart:

``restart``
Expand Down Expand Up @@ -259,6 +324,16 @@ Running ``./dev update_data`` runs the custom ``update_data`` command to load th

-----------------------------------------------------------------------------

.. _update_static:

``update_static``
==============================================================================

Running ``./dev update_static`` runs ``./dev static`` to build all the static files.
Then runs the Django ``collectstatic`` command to copy all static files into the ``staticfiles`` directory.

-----------------------------------------------------------------------------

You now know the basic commands for using the CS Unplugged system.
You are now ready to tackle the documentation for the area you wish to contribute on.
Head back to the :doc:`documentation homepage <../index>` and choose the documentation related to the task you wish to contribute to.

0 comments on commit 6cce179

Please sign in to comment.