Skip to content
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

[docs] Restructure #2082

Merged
merged 43 commits into from
Jun 7, 2023
Merged

[docs] Restructure #2082

merged 43 commits into from
Jun 7, 2023

Conversation

bharatkashyap
Copy link
Member

@bharatkashyap bharatkashyap commented May 26, 2023

This PR attempts to:

  • restructure the docs into the sections mentioned in [docs] Restructure #2052
  • change content in most existing pages
  • add many new pages
  • change all of the existing media to adhere to a 1440x796 DPR 2.0 resolution
  • add an option to view images in full size.
  • Remove unused media files
  • Move the landing page content into the data folder

Deviations from the structure in #2052 have been made in two places:

  • "Deploy to Render" has been placed in Tutorials
  • A section on "Display mode" has been added to Concepts
  • The "How to guides" section on custom components has two children:
    • Number (A number display component)
    • Cube (A custom components which imports external libraries)

@bharatkashyap bharatkashyap added the docs Improvements or additions to the documentation label May 26, 2023
@bharatkashyap bharatkashyap changed the title Restructure docs [docs] Restructure May 26, 2023
Copy link
Member

@apedroferreira apedroferreira left a comment

Choose a reason for hiding this comment

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

Thanks, Bharat, this is a lot!

A few things I've noticed in the preview:

  1. I can't preview / zoom into images in the preview
  2. There seems to be no footer at the bottom of the docs pages, or even any padding at all? We used to have a footer there.
  3. Maybe our tutorials section will be mixing up too many unrelated topics. Could we somehow have a Deployment section somewhere with subsections on different services we can deploy to?
  4. Not sure what we agreed on about "display mode" - maybe it could be under "Embedding a Toolpad page?"

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label May 29, 2023
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label May 30, 2023
@oliviertassinari
Copy link
Member

The image open interaction on https://www.lennysnewsletter.com/p/how-figma-builds-product feels quite nice, with the complementary hover icon on the corner:

Screenshot 2023-05-31 at 19 27 05

@bharatkashyap
Copy link
Member Author

https://deploy-preview-2082--mui-toolpad-docs.netlify.app/toolpad/how-to-guides/customize-datagrid/

You're right, I'll do another pass on all the images to fix the aspect ratio/blurry GIF issues

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Jun 6, 2023

This corresponds to a function that you create on your file system, inside the `toolpad/resources` folder. For example, in `toolpad/resources/functions.ts`

```tsx
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
```tsx
```jsx

@bharatkashyap The docs does not support tsx yet, so better go with jsx to get the proper color for the tokens.

image

Here is the jsx version:

image

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks Jun! Changed it

- `@mui/icons-material`

:::warning
Support for importing any `npm` package is not implemented yet. It's coming.
Copy link
Member

Choose a reason for hiding this comment

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

Is it true that a user can't install any npm package?
Is this also true for custom functions?

Copy link
Member Author

@bharatkashyap bharatkashyap Jun 7, 2023

Choose a reason for hiding this comment

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

This isn't true for custom functions.

About the custom components, I borrowed from the existing docs https://mui.com/toolpad/building-ui/custom-components/#supported-features but I think this shouldn't be true anymore either. I'll change it

Copy link
Member Author

Choose a reason for hiding this comment

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

I've added a new how-to guide showcasing this feature for custom components


Each property of component that may be bound to data present on the page is surrounded by a **Binding** button, which you can click to initiate data binding.

{{"component": "modules/components/DocsImage.tsx", "src": "/static/toolpad/docs/concepts/managing-state/binding-button.png", "alt": "Binding button", "caption": "The binding button", "zoom": false }}
Copy link
Member

Choose a reason for hiding this comment

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

Images of a section of Toolpad should be small. We should maintain the same scale.

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you mean that the image should show the full tab even when talking about a specific section?

Copy link
Member

Choose a reason for hiding this comment

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

No, I mean this image should be smaller. Like the first image in: https://mui.com/toolpad/data-binding/binding-state/

Copy link
Member Author

Choose a reason for hiding this comment

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

Adding a width override to DocsImage so that custom widths can be set to images in cases like this. Capping the width to 300px in this case.

@apedroferreira apedroferreira self-requested a review June 7, 2023 15:27
Copy link
Member

@apedroferreira apedroferreira left a comment

Choose a reason for hiding this comment

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

Other than the blurry gifs it looks good, but if you don't want to block the PR because of the GIFs or there are other issues I guess we can merge and fix after, not sure.

<p class="description">Toolpad apps allow for a display mode configurable per-page</p>

{{"component": "modules/components/DocsImage.tsx", "src": "/static/toolpad/docs/concepts/display-mode/display-mode.png", "alt": "Display mode property ", "caption": "Display mode page property", "zoom": false }}

Copy link
Member

Choose a reason for hiding this comment

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

This image is big too.

1. Find the **rows** property in the inspector. Notice that there's a small **Bind** button to its right. Properties with this button next to them can be bound to state available on the page:

{{"component": "modules/components/DocsImage.tsx", "src": "/static/toolpad/docs/getting-started/first-app/step-5.png", "alt": "Bind data", "caption": "The bindable rows property", "zoom": false, "indent": 1 }}

Copy link
Member

@prakhargupta1 prakhargupta1 Jun 7, 2023

Choose a reason for hiding this comment

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

This image needs to be scaled down.

@Janpot
Copy link
Member

Janpot commented Jun 7, 2023

Shall we center the images in the page?

@bharatkashyap
Copy link
Member Author

Shall we center the images in the page?

Which ones do you mean?

@Janpot
Copy link
Member

Janpot commented Jun 7, 2023

Screenshot 2023-06-07 at 20 06 26

@bharatkashyap
Copy link
Member Author

I've centred the uncentered images and replaced all blurred GIFs

@bharatkashyap bharatkashyap merged commit e638084 into mui:master Jun 7, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[docs] Restructure Visually improve docs images
6 participants