-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Use the shorthand notation when applicable #9339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@greg0ire thanks for taking care of this. I'm sorry for the amount of review comments (35!) but I wanted to mark all the places where we can get rid of ::
.
By the way, I'm not sure I like replacing .. code-block:: php
by ::
when there's no previous line of text. The problem with ::
is that it looks strange and it's not easy to understand, whereas .. code-block:: php
is beautiful and self-explanatory. Ping @xabbuh what do you think?
@@ -24,7 +24,7 @@ Usage | |||
|
|||
A lock can be used, for example, to allow only one instance of a command to run. | |||
|
|||
.. code-block:: php | |||
:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move this to the end of the previous line? Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While reading this comment there is at least one important difference to point out that we did not discuss on Slack: The colon of the short-hand notation will be rendered in the final document. So we need to check too if that really makes sense with each example.
@@ -70,7 +70,7 @@ which returns an array of expression functions (instances of | |||
:class:`Symfony\\Component\\ExpressionLanguage\\ExpressionFunction`) to | |||
register. | |||
|
|||
.. code-block:: php | |||
:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move this to the end of the previous line.
components/process.rst
Outdated
@@ -312,7 +312,7 @@ Process Pid | |||
You can access the `pid`_ of a running process with the | |||
:method:`Symfony\\Component\\Process\\Process::getPid` method. | |||
|
|||
.. code-block:: php | |||
:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge with the previous line, please.
components/templating.rst
Outdated
@@ -190,7 +190,7 @@ choose which one to use for the template, the | |||
:method:`EngineInterface::supports() <Symfony\\Component\\Templating\\EngineInterface::supports>` | |||
method is used. | |||
|
|||
.. code-block:: php | |||
:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge with previous line, please.
components/translation.rst
Outdated
@@ -31,7 +31,7 @@ Configuration | |||
|
|||
The constructor of the ``Translator`` class needs one argument: The locale. | |||
|
|||
.. code-block:: php | |||
:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge with previous line, please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one will look a bit weird I think
@@ -585,7 +585,7 @@ contain a ``lifetime`` key, set to 5 minutes (300 seconds) unless otherwise | |||
set in the configuration. Pass this argument to your authentication provider | |||
in order to put it to use. | |||
|
|||
.. code-block:: php | |||
:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge with previous line, please.
security/impersonating_user.rst
Outdated
@@ -236,7 +236,7 @@ the sticky locale: | |||
|
|||
The listener implementation assumes your ``User`` entity has a ``getLocale()`` method. | |||
|
|||
.. code-block:: php | |||
:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge with previous line, please.
security/remember_me.rst
Outdated
@@ -238,7 +238,7 @@ in the controller could be secured using the service context. | |||
In the following example, the action is only allowed if the user has the | |||
``IS_AUTHENTICATED_FULLY`` role. | |||
|
|||
.. code-block:: php | |||
:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge with previous line, please.
security/voters.rst
Outdated
@@ -38,7 +38,7 @@ A custom voter needs to implement | |||
or extend :class:`Symfony\\Component\\Security\\Core\\Authorization\\Voter\\AbstractVoter`, | |||
which makes creating a voter even easier. | |||
|
|||
.. code-block:: php | |||
:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge with previous line, please.
session/locale_sticky_session.rst
Outdated
@@ -129,7 +129,7 @@ locale value before they are redirected to their first page. | |||
To do this, you need an event listener for the ``security.interactive_login`` | |||
event: | |||
|
|||
.. code-block:: php | |||
:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge with previous line, please.
It's part of the standard
The constructor of the ``Translator`` class needs one argument: The locale. | ||
|
||
.. code-block:: php | ||
The constructor of the ``Translator`` class needs one argument: The locale:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@javiereguiluz @xabbuh that one will look a bit weird, won't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would stick with the explicit code block here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem with :: is that it looks strange and it's not easy to understand, whereas .. code-block:: php is beautiful and self-explanatory. Ping @xabbuh what do you think?
I would stick with the explicit code block here
I'll extrapolate and take this as an agreement with @javiereguiluz 's feelings about ::
at the beginning of a line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But that probably means I should amend the standard.
@greg0ire please, tell me when you consider this ready for merge. Thanks! |
I believe it's ready, but warning, I amended the standard |
code block (read `the Sphinx documentation`_ to see when you should use the | ||
shorthand); | ||
code block unless it results in the marker being on its own line (read | ||
`the Sphinx documentation`_ to see when you should use the shorthand); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@javiereguiluz here is the part I amended, please tell me what you think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Let's merge this PR too ... and let's wish there are not too many conflicts. Thanks for working on this @greg0ire. |
This has been merged up to |
@@ -124,7 +124,7 @@ You can now reference these parameters wherever you need them. | |||
|
|||
</container> | |||
|
|||
.. code-block:: php | |||
:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is wrong as this is part of a configuration-block
block. Reverted in #9368.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woops, sorry for this!
It's part of the standard