Skip to content

use same order for all configuration-blocks #11179

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

Merged

Conversation

OskarStark
Copy link
Contributor

@OskarStark OskarStark commented Mar 17, 2019

ensure the following order of code-blocks in a .. configuration-block:: directive:

  1. php-annotations
  2. yaml
  3. xml
  4. php

@wouterj
Copy link
Member

wouterj commented Mar 17, 2019

Hmm, not sure if I agree with this "rule". For some reason (not sure why), Symfony decided Xliff should be the main language for translation instead of yaml. So that's why it's put in the first place.

@OskarStark
Copy link
Contributor Author

If I browse the documentation and and select yaml for example, the yaml tab will be selected on all other following sites if I am right. Like here for example: https://symfony.com/doc/current/reference/configuration/security.html#using-the-bcrypt-password-encoder

Anyway it wouldn't be a problem to use .. code-block:: xliff, use the xml lexer and change the rule, that xliff should be used first. I can check the content of the code-block too to know if its an xliff file.

My goal is to make the docs consistent as possible to give fast automated feedback to the contributors, especially new ones. I totally agree, that we cannot have "rules" for everything 👍

@javiereguiluz
Copy link
Member

Even if being consistent is important (and we appreciate all your work around this) I think I agree with Wouter on this one.

The order of configuration-block formats is from "most common"/"recommended" ... to "less common". So, for routes: annotations, yaml, xml, raw php ... but for translation it should be xml, yaml, raw php. This is for the reason explained by Wouter about XLIFF.

Also, precisely because the tab is now selected automatically (and persisted when you change it) the tab order is almost irrelevant, because you always see your preferred format selected.

@OskarStark OskarStark force-pushed the order-code-blocks-configuration-block branch 3 times, most recently from 69c1ae2 to c99239c Compare March 20, 2019 09:07
ensure the following order of code-blocks in a .. configuration-block:: directive:
 - php-annotations
 - yaml
 - xml
 - php
@OskarStark OskarStark force-pushed the order-code-blocks-configuration-block branch from c99239c to 7cfa0d7 Compare March 20, 2019 09:07
@OskarStark
Copy link
Contributor Author

Thank you for your feedback Javier!

I changed the rule to ensure the following order if an .. code-block:: xml is present and it contains xliff:

  • xml
  • php-annotations
  • yaml
  • php

If an .. code-block:: xml is present without xliff content:

  • php-annotations
  • yaml
  • xml
  • php

After that change, the current state of the PR is the result and it looks good to me 👍

@@ -48,6 +40,14 @@ Basic Usage
protected $identifier;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

off topic but shouldn't we change properties to private?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably yes ... but, as you said, off topic :)

@javiereguiluz
Copy link
Member

Thanks Oskar.

@javiereguiluz javiereguiluz merged commit 7cfa0d7 into symfony:3.4 Mar 20, 2019
javiereguiluz added a commit that referenced this pull request Mar 20, 2019
This PR was merged into the 3.4 branch.

Discussion
----------

use same order for all configuration-blocks

ensure the following order of code-blocks in a `.. configuration-block::` directive:

1. `php-annotations`
2. `yaml`
3. `xml`
4. `php`

Commits
-------

7cfa0d7 use same order for all configuration-blocks
@OskarStark OskarStark deleted the order-code-blocks-configuration-block branch March 20, 2019 10:15
@OskarStark
Copy link
Contributor Author

You are very welcome 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants