Skip to content

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

Merged
merged 28 commits into from
Apr 3, 2024
Merged

DOCSP-37618: Usage Examples landing page #2767

merged 28 commits into from
Apr 3, 2024

Conversation

norareidy
Copy link
Contributor

@norareidy norareidy commented Mar 12, 2024

JIRA - https://jira.mongodb.org/browse/DOCSP-37618
Staging - https://preview-mongodbnorareidy.gatsbyjs.io/laravel/DOCSP-37618-staging/usage-examples/

Checklist

  • Add tests and ensure they pass
  • Add an entry to the CHANGELOG.md file
  • Update documentation for new features

Copy link
Contributor

@ccho-mongodb ccho-mongodb left a 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.

Comment on lines 42 to 46
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>`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Issue:

  1. 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.

  2. 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.

Copy link
Contributor Author

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

@norareidy norareidy requested a review from ccho-mongodb March 13, 2024 19:14
ccho-mongodb
ccho-mongodb previously approved these changes Mar 13, 2024
Copy link
Contributor

@ccho-mongodb ccho-mongodb left a 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.

Comment on lines 40 to 43
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
Copy link
Contributor

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 database
  • Movie view that lists the results
  • HTTP and API controller endpoints for displaying and storing Movie data
    "

Comment on lines 45 to 64
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.
Copy link
Contributor

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 your MovieController.php file in the ... directory
  • Add the code from the View File Code tab to your browse_movies.blade.php file in the ... directory.

Follow the instructions on the Usage Example page to run the code and view the output.
"

Copy link
Contributor Author

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

@norareidy norareidy marked this pull request as ready for review March 14, 2024 17:25
@norareidy norareidy requested a review from a team as a code owner March 14, 2024 17:25
@norareidy norareidy requested a review from GromNaN March 14, 2024 17:25
Copy link
Member

@GromNaN GromNaN left a 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.

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
Copy link
Member

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?

Copy link
Contributor Author

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.

@norareidy
Copy link
Contributor Author

I don't get the point of this page.

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!

@GromNaN GromNaN added the docs label Mar 25, 2024
@GromNaN GromNaN changed the base branch from 4.1 to docs-rewrite March 25, 2024 16:26
@GromNaN GromNaN changed the base branch from docs-rewrite to 4.1 March 25, 2024 16:59
@@ -27,4 +27,4 @@ jobs:
uses: alcaeus/automatic-merge-up-action@main
with:
ref: ${{ github.ref_name }}
branchNamePattern: '<major>.<minor>'
branchNamePattern: '<major>.<minor>'
Copy link
Member

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.

Copy link
Contributor Author

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

@caitlindavey caitlindavey requested a review from GromNaN April 1, 2024 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants