Skip to content

Commit

Permalink
fix: code blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeWithEmad committed Apr 1, 2024
1 parent ed1986b commit 21fe261
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 36 deletions.
18 changes: 9 additions & 9 deletions source/community/release_notes/dogwood.rst
Expand Up @@ -404,15 +404,15 @@ Transactions
* To avoid exceptions when you create models, edX recommends that you use the
following pattern.

::

if need_to_create_model:
try:
with transaction.atomic():
MyFancyModel.create(**kwargs)
except IntegrityError:
# Model has already been created.
log.warning("Something...")
.. code-block:: python
if need_to_create_model:
try:
with transaction.atomic():
MyFancyModel.create(**kwargs)
except IntegrityError:
# Model has already been created.
log.warning("Something...")
.. _Database Transactions: https://docs.djangoproject.com/en/1.8/topics/db/transactions
Expand Down
6 changes: 3 additions & 3 deletions source/community/release_notes/nutmeg.rst
Expand Up @@ -40,7 +40,7 @@ In order for User Tours to properly work, the backpopulate user tours management

.. code-block:: shell
$ python ./manage.py lms backpopulate_user_tours
python ./manage.py lms backpopulate_user_tours
Dates Tab
Expand All @@ -50,7 +50,7 @@ The Dates Tab has been added as a default static tab on all courses. All new cou

.. code-block:: shell
$ python manage.py cms backfill_course_tabs
python manage.py cms backfill_course_tabs
The Dates Tab has also been removed from the legacy learner experience. It is only available in the Learner MFE. This is the first step in remove the legacy learner experience altogether, which will be completed in the Olive release.

Expand Down Expand Up @@ -129,7 +129,7 @@ Administrators & Operators
.. _learning sequences: https://github.com/openedx/edx-platform/blob/db32ff2cdf678fa8edd12c9da76a76eef0478614/openedx/core/djangoapps/content/learning_sequences/README.rst
.. code-block:: shell
$ python manage.py cms simulate_publish
python manage.py cms simulate_publish
* By setting the :code:`ENABLE_NEW_RELIC` to false, the new relic logging integration will be disabled across all MFEs.

Expand Down
10 changes: 5 additions & 5 deletions source/developers/how-tos/maintain-translations-in-your-repo.rst
Expand Up @@ -20,14 +20,14 @@ translations into the `edx-platform`_ repository:

.. code-block:: bash
$ cd /path/to/edx-platform
$ make pull_translations
cd /path/to/edx-platform
make pull_translations
The ``make pull_translations`` command will (roughly) run the following command:

.. code-block:: bash
$ atlas pull translations/edx-platform/conf/locale:conf/locale
atlas pull translations/edx-platform/conf/locale:conf/locale
==============
Is It Working?
Expand All @@ -38,8 +38,8 @@ for the presence of the translations:

.. code-block:: bash
$ tree conf/locale # or ls conf/locale
$ git status # Should show the new files
tree conf/locale # or ls conf/locale
git status # Should show the new files
Run your application and test translations by changing the user langauge from the Account Settings page.

Expand Down
Expand Up @@ -131,9 +131,9 @@ steps.

#. Install your block.

::
.. code-block:: bash
$ vagrant ssh
vagrant ssh
vagrant@precise64:~$ sudo -u edxapp /edx/bin/pip.edxapp install /path/to/your/block
#. Enable the block.
Expand Down
Expand Up @@ -407,9 +407,9 @@ everything (scraping and serving) is working properly.

First, use the coverage tool to generate dummy files.

.. code-block:: sh
.. code-block:: bash
$ paver i18n_dummy
paver i18n_dummy
This step creates new dummy translations in the Esperanto directory
(edx-platform/conf/local/eo/LC_MESSAGES) and the RTL directory
Expand All @@ -418,10 +418,10 @@ should discard these files once you have finished testing.

Next, restart the LMS and Studio to load in the new translation files.

.. code-block:: sh
.. code-block:: bash
$ paver devstack lms
$ paver devstack studio
paver devstack lms
paver devstack studio
Append ``/update_lang/`` to the root LMS or Studio URL and use the form to set
the preview language. The language code ``eo`` can be used to specify the test
Expand Down
Expand Up @@ -8,13 +8,17 @@ We use a variety of tools to check for errors and vulnerabilities, and to enforc
a coding standard and coding style.

To check the quality of your pull request, go to the top level of the edx-
platform codebase and run the following command. ::
platform codebase and run the following command.

$ paver run_quality
.. code-block:: bash
paver run_quality
Most other repos use the command ::
Most other repos use the command

.. code-block:: bash
$ make quality
make quality
The following topics provide additional details on the tools that we use.

Expand All @@ -39,9 +43,11 @@ we can ensure that pull requests do not introduce new quality violations, and
also clean up existing violations in the process of introducing other changes.

To run diff-quality along with our other quality based tools, go to the top
level of the edx-platform codebase and run the following command. ::
level of the edx-platform codebase and run the following command.

$ paver run_quality
.. code-block:: bash
paver run_quality
You can also use the ``paver run_pep8`` and ``paver run_pylint`` commands to
run only pep8 or pylint.
Expand All @@ -51,7 +57,9 @@ This will print a report of the quality violations that your branch has made.
Although we try to be vigilant in resolving all quality violations, some
Pylint violations are too challenging to resolve, so we opt to ignore them via
use of a pragma. A pragma tells Pylint to ignore the violation in the given
line. An example is::
line. An example is.

.. code-block:: python
self.assertEquals(msg, form._errors['course_id'][0]) # pylint: disable=protected-access
Expand Down
Expand Up @@ -100,9 +100,9 @@ whether the learner's answer is correct.
problem points. The ``msg`` is displayed below all response fields, and it
can contain XHTML markup.

* A dictionary of the form
* A dictionary of the form:

.. code-block:: xml
.. code-block:: python
{ 'overall_message': 'Overall message',
'input_list': [
Expand Down Expand Up @@ -377,7 +377,7 @@ following ways.
* Return the value ``"Partial"`` as part of the input list for multi-part
problems.

.. code-block:: xml
.. code-block:: python
{ 'overall_message': 'Overall message',
'input_list': [
Expand Down
4 changes: 2 additions & 2 deletions source/translators/concepts/translation-process.rst
Expand Up @@ -26,7 +26,7 @@ Annotating and Extracting Strings

Given code like this:

.. code-block::
.. code-block:: python
from django.utils.translation import ugettext as _
Expand Down Expand Up @@ -73,7 +73,7 @@ are periodically updated in the openedx-translations_ repository.
The openedx-atlas_ CLI tool was built to help you download translation files for a
specific part of the codebase.

.. code-block::
.. code-block:: bash
cd /path/to/credentials
# pull down the latest translations for all available
Expand Down

0 comments on commit 21fe261

Please sign in to comment.