-
Notifications
You must be signed in to change notification settings - Fork 1.5k
DOCSP-37618: Usage Examples landing page #2767
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
DOCSP-37618: Usage Examples landing page #2767
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.
Looks pretty good! I'd like to take another look after the issues are resolved since they might change the content significantly.
docs/usage-examples.txt
Outdated
Follow this tutorial to set up your MongoDB deployment with the sample data and run the | ||
example code in your development environment. Before performing the following actions, | ||
ensure that you create an Atlas account and deploy a cluster. For information about setting | ||
up an account and a cluster, see the :atlas:`Get Started with Atlas Guide | ||
</getting-started/#atlas-getting-started>`. |
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.
Issue:
-
I think the description of the procedure/steps is currently inaccurate. When reading the first sentence "Follow this tutorial to set up your MongoDB deployment with sample data and run the sample code...", I expected the tutorial to explain that part. However, the procedure/steps includes the prerequisite of the quick start guide which includes setup of the MongoDB deployment with sample data and how to add and run the code.
-
I think the step in the tutorial about running the usage example code is inaccurate since it omits information about viewing it in the browser.
Suggestion:
I think keeping the description of the steps and the procedure/steps aligned would be helpful. I also think this page should delegate some of the explanation of how to run them to the specific usage example since the procedure might differ depending on the operation.
E.g.
"You can run the usage examples from Laravel web application and MongoDB Atlas cluster that you set up in the :ref:laravel-quick-start
guide. Ensure that your application and cluster meet the following requirements:
...
To run the example controller code and view the results, follow the instructions on the usage example page.
"
Let me know if you need any help with filling out the details.
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.
Thanks for this detailed comment; I think I made all the changes you requested, let me know if it looks alright
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.
LGTM!
Added a couple suggestions that I think could make the procedure easier to follow.
docs/usage-examples.txt
Outdated
application meets the following requirements: | ||
|
||
- Connects to the ``movies`` collection in the Atlas sample datasets | ||
- Contains the ``MovieController.php`` and ``browse_movies.blade.php`` files |
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.
Suggestion:
I think it could be easier to verify the requirements as Laravel web app components rather than existence of the collection and files. I think it's also missing mention of the API controller (used for storing data - see https://www.mongodb.com/docs/drivers/php/laravel-mongodb/current/quick-start/write-data/). E.g.
"... application contains the following components:"
- Configuration to use an Atlas cluster that contains the sample datasets
Movie
model configured to use the MongoDB databaseMovie
view that lists the results- HTTP and API controller endpoints for displaying and storing
Movie
data
"
docs/usage-examples.txt
Outdated
Then, follow this tutorial to add the usage example code to your Laravel application and view | ||
the expected results. | ||
|
||
.. procedure:: | ||
:style: connected | ||
|
||
.. step:: Add the Controller Code to Your Application | ||
|
||
Copy the example code from the :guilabel:`Controller File Code` tab on the usage example | ||
page and paste it into the ``MovieController.php`` file. | ||
|
||
.. step:: Add the View Code to Your Application | ||
|
||
Copy the example code from the :guilabel:`View File Code` tab on the usage example page and | ||
paste it into the ``browse_movies.blade.php`` file. | ||
|
||
.. step:: Run the Usage Example Code | ||
|
||
To run the example controller code and view the results, follow the instructions on the | ||
usage example page. |
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.
Suggestion:
I think presenting this information might not make sense before a reader gets the chance to see a Usage Example page. As mentioned in a previous comment, it should delegate some of the explanation to the specific usage examples since they may differ depending on the operation.
Start with information on when this applies, e.g.
"
Each Usage Example page features example code in the Controller File Code
and View File Code
tabs that you can copy and paste into your Laravel application.
Unless otherwise specified, you can add Usage Example sample code to your application by performing the following actions:
- Add the code from the
Controller File Code
tab to yourMovieController.php
file in the ... directory - Add the code from the
View File Code
tab to yourbrowse_movies.blade.php
file in the ... directory.
Follow the instructions on the Usage Example page to run the code and view the output.
"
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.
Ah okay, so including tutorial steps doesn't seem necessary; changed
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 don't get the point of this page.
docs/usage-examples.txt
Outdated
you set up in the :ref:`laravel-quick-start` guide. After completing the Quick Start, ensure | ||
that your application meets the following requirements: | ||
|
||
- Configuration to use an Atlas cluster that contains the sample datasets |
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.
How a beginner can check all this requirements?
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 added a tip directive that links to each corresponding Quick Start step, so the user can click on those for more details on how to fulfill the requirements.
In all the drivers docs, we have a usage example landing page that explains how to run the code examples. Then, all the individual usage examples are linked out from that page. Here’s the Rust driver usage example landing page and a usage example, for instance. So the structure would be similar in this case. Hopefully that clarifies the point of this page a bit! |
.github/workflows/merge-up.yml
Outdated
@@ -27,4 +27,4 @@ jobs: | |||
uses: alcaeus/automatic-merge-up-action@main | |||
with: | |||
ref: ${{ github.ref_name }} | |||
branchNamePattern: '<major>.<minor>' | |||
branchNamePattern: '<major>.<minor>' |
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 newline at end of file must be reverted.
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.
Ah this was unintentional, fixed
JIRA - https://jira.mongodb.org/browse/DOCSP-37618
Staging - https://preview-mongodbnorareidy.gatsbyjs.io/laravel/DOCSP-37618-staging/usage-examples/
Checklist