-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Added standard bundle installation instructions #4163
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
Added standard bundle installation instructions #4163
Conversation
Basically, I like the idea and how you wrote this section. I'm not sure if it is good to place it at the bottom of the chapter though. Doesn't it belong to the "Documentation" section? I also think that it's worth to merge this into 2.3. |
In order to ease the installation process of third-party bundles, we propose | ||
you to use the following standardized instructions in your ``README`` file: | ||
|
||
.. code-block:: |
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.
We need a language here. I guess markdown
doesn't work. Can you check whether or not this renders properly when you use rst
?
@xabbuh thanks for your review! I've switched the "installation template" to a sidebar and I've used the |
My main concern is this command:
Which version should we tell bundle creators to include in that command? Lots of them are including |
@javiereguiluz I think the bundle doc should use
|
In order to ease the installation process of third-party bundles, we propose | ||
you to use the following standardized instructions in your ``README`` file. | ||
|
||
.. sidebar:: Installation Instructions Template |
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.
you should either add a note saying this is a rST template, or give also a Markdown template. Most projects are using Markdown for the readme on github.
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.
You are right. RST is the official format for the bundle documentation, but 99% of bundles hosted on GitHub use README.md
instead of README.rst
. I've switched the template to Markdown.
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.
well, the best practice in the doc was written at a time where symfony.com was expected to have a repository of bundles with their doc being rendered (KnpBundles appeared as a third-party solution to this problem because the official tool announced by Fabien was not yet there, and never became a reality given we then choose composer meaning that KnpBundles and Packagist can probably be enough and people can use libraries which are not bundles). The de-facto standard then became Markdown because everyone is using Github (well, mostly at least) and it used to suck at rendering rST (3 years ago when building the Symfony2 ecosystem, the code-block
directive was not supported by their rST renderer for instance) while Markdown was well rendered
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.
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 ..raw
does not achieve this. It let you pass unprocessed context (i.e. either html
or latex
or other format, which is why it asks you for a format btw: you have to provide it for each output format).
What you expect in your image is still a <pre>
tag in HTML, and it is technically a code-block (so <pre><code>
is more semantic).
the only difference with the rendering of ..code-block
is that you don't want line numbers (this is fine, Sphinx has an option to omit them in its directive) and a different background color (and this is a matter of theming) But I could totally live with the code being on a block background, and people will be able to copy-paste it.
See http://symfony.com/doc/current/contributing/code/patches.html#make-a-pull-request and you will see that the code snippet containing the pull-request template can totally be copy-pasted (we did not even bothered about removing line numbers on 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.
You are right! We just need a simple .. code-block:: text
directive to output the Markdown content "as is".
|
||
This command requires to have installed Composer globally, as explained | ||
in the [installation chapter](https://getcomposer.org/doc/00-intro.md) | ||
of Composer documentation. |
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.
wouldn't be "have Composer installed globally"?
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.
And we could also use "to have Composer globally installed". I'm not sure what to do. We need the help of some native speaker.
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 agree with @raulfraile. I would also remove everything after the comma and directly link "Composer globally installed".
I think it's time to make a decision: @weaverryan @wouterj @xabbuh @stof do you think that this documentation is good enough to start sending PR to all bundles' repositories during the second DX Hackday? Or do you prefer to take more time to think more about this? |
@@ -194,6 +194,59 @@ Extensive documentation should also be provided in the | |||
the ``Resources/doc/`` directory; the ``Resources/doc/index.rst`` file is | |||
the only mandatory file and must be the entry point for the documentation. | |||
|
|||
Installation instructions |
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.
"Instructions" should be upper-cased.
} | ||
``` | ||
|
||
Optionally you can add *Step 3*, *Step 4*, etc. to explain other required |
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.
Add a comma after "optionally".
// ... | ||
new <vendor>\<bundle-name>\<bundle-long-name>(), | ||
); | ||
} |
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 return
statement is missing.
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 usually add a // ...
before this line too
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.
If we add the return statements, I don't think that this is necessary. Usually you would simply add the new bundle at the end of the array and then return the $bundles
array, won't you? So, having another placeholder there might lead to some confusion.
What do you think about the last change? Original text
Proposal
|
@javiereguiluz You should add a note after the code block to tell authors to update the constraint according to the major version of the bundle (so that they know they should change it). |
$ composer require <package-name> "~1" | ||
``` | ||
|
||
This command requires to have Composer installed globally, as explained |
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.
... requires you to have Composer
@javiereguiluz Sorry for the delay - my eyes weren't on the docs during the hack day. I added some comments, but then I think this is ready! I also agree with @stof's comment, but I think it should be a different section or can be a different PR altogether. There are 2 more changes that are coming (composer/composer#3096 and the Thanks! |
Should I make any other change to this PR before merging it? |
This issue is labeled as In progress, but I don't know what is left to be done. Any clue? Thanks! |
Looks fine to me. 👍 |
@javiereguiluz I think this is Finished. Now we will also have @xabbuh's help in properly labeling things. Once it's finished, I'm looking for those so I can merge them quickly :). BUT, your branch is missing! Do you still have it locally? If not, I'll merge via the interface. But the internal merge tool requires your branch to be there. Let me know. Thanks! |
@weaverryan the GH tool provided by Fabien does not need the branch to be there. It gets the code from the special ref available in the symfony repo for PRs, not from the branch ref in the fork. |
@weaverryan I no longer have the branch locally :( |
@stof, I'm using gh, and I just made sure I was on the latest version. It says Is it possible that it doesn't grab from the docs ref when using Thanks! |
@weaverryan I'll make a PR shortly with the correct branch |
see #4236 |
@weaverryan @stof there is nothing wrong with the tool you use. The branch is not available because I'm stupid and I deleted my |
@javiereguiluz no worries :). Stof was saying that the tool can actually fetch the missing code from a different location (similar to what the GH merge button must do behind the scenes). But we have a new PR now, so I'll merge from there. Thanks! |
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #4236). Discussion ---------- Javiereguiluz bundle install instructions Replaces #4163 Commits ------- 7097070 Added the fixes suggested by Ryan 35dddba Reworded a bit the installation instructions 7a6644b Removed the sidebar and made some minor tweaks 41ce2a5 Minor fixes and tweaks 4b29de2 More tweaks and fixes 322ec60 Removed the first person perspective and other minor fixes c39f7d3 Fixed some code formatting ed96447 More improvements based on reviewers' comments 21ce2c0 Fixed minor typo 11db860 Applied all the fixes and suggestions made by reviewers b297d29 First draft of the bundle installation instructions
@javiereguiluz github always keeps branches of PRs in the main repository, in order to always show the diff of the PR (even when the branch was removed). You can fetch that by using |
This looks weird. GH does not run such commands. Are you sure you run the code from the sensiolabs/gh repo ? |
I think fabien sent the tool to ryan back in January 2014, so I don't think it's very up to date (not sure though) |
well, I know for sure that Ryan has access to the git repo to get the latest version of the tool |
@stof you're right - I updated locally, but was still using my old binary. So, my fault! |
Note: if you think that this draft is awful, please say it so and we'll rewrite it from scratch.