From 88e909559cd80a67638df8ffc79b64084cb2ec87 Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Wed, 31 Jan 2024 15:40:45 +0100 Subject: [PATCH 1/6] [base-ui][docs] Improve Base UI traffic from Material UI --- packages/markdown/prepareMarkdown.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/markdown/prepareMarkdown.js b/packages/markdown/prepareMarkdown.js index c03dd54f871b57..772f7de999bf81 100644 --- a/packages/markdown/prepareMarkdown.js +++ b/packages/markdown/prepareMarkdown.js @@ -63,7 +63,8 @@ function prepareMarkdown(config) { const { filename, markdown, userLanguage } = translation; const headers = getHeaders(markdown); const location = headers.filename || `/${fileRelativeContext}/${filename}`; - const title = headers.title || getTitle(markdown); + const markdownH1 = getTitle(markdown); + const title = headers.title || markdownH1; const description = headers.description || getDescription(markdown); if (title == null || title === '') { @@ -102,9 +103,8 @@ function prepareMarkdown(config) { contents.push(` ## Unstyled -:::success -[Base UI](/base-ui/) provides a headless ("unstyled") version of this [${title}](${headers.unstyled}). Try it if you need more flexibility in customization and a smaller bundle size. -::: +A version of this component is available without any styles: [Base UI ${markdownH1}](${headers.unstyled}). +Use this component for heavily customization or smaller bundle size. `); } From 4c90d9a6002d0c8a7d8831f3fed365d5fb88244f Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Wed, 31 Jan 2024 15:47:26 +0100 Subject: [PATCH 2/6] fix typo --- packages/markdown/prepareMarkdown.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/markdown/prepareMarkdown.js b/packages/markdown/prepareMarkdown.js index 772f7de999bf81..2e6749711e3a4d 100644 --- a/packages/markdown/prepareMarkdown.js +++ b/packages/markdown/prepareMarkdown.js @@ -104,7 +104,7 @@ function prepareMarkdown(config) { ## Unstyled A version of this component is available without any styles: [Base UI ${markdownH1}](${headers.unstyled}). -Use this component for heavily customization or smaller bundle size. +Use this component for heavy customizations or smaller bundle sizes. `); } From 824dc01b1fffd5fcfc5b81610d4a7e4b40b0884f Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Thu, 1 Feb 2024 01:36:04 +0100 Subject: [PATCH 3/6] Danilo's review Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Signed-off-by: Olivier Tassinari --- packages/markdown/prepareMarkdown.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/markdown/prepareMarkdown.js b/packages/markdown/prepareMarkdown.js index 2e6749711e3a4d..299e6007001b1d 100644 --- a/packages/markdown/prepareMarkdown.js +++ b/packages/markdown/prepareMarkdown.js @@ -103,7 +103,7 @@ function prepareMarkdown(config) { contents.push(` ## Unstyled -A version of this component is available without any styles: [Base UI ${markdownH1}](${headers.unstyled}). +To completely own the design, without having to customize parting from Material Design, use the [Base UI ${markdownH1}](${headers.unstyled}) for an unstyled version of this component Use this component for heavy customizations or smaller bundle sizes. `); } From 6da648173af2e6b1d06683c88a001a26f7edef37 Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Thu, 1 Feb 2024 01:57:01 +0100 Subject: [PATCH 4/6] polish --- packages/markdown/prepareMarkdown.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/markdown/prepareMarkdown.js b/packages/markdown/prepareMarkdown.js index 299e6007001b1d..83afc618923221 100644 --- a/packages/markdown/prepareMarkdown.js +++ b/packages/markdown/prepareMarkdown.js @@ -1,3 +1,4 @@ +/* eslint-disable no-irregular-whitespace */ const fs = require('fs'); const path = require('path'); const kebabCase = require('lodash/kebabCase'); @@ -100,11 +101,17 @@ function prepareMarkdown(config) { const contents = getContents(markdown); if (headers.unstyled) { + // TODO v7: + // contents.push(` + // ## Unstyled + + // To completely own the design, without having to customize the built-in styles of Material UI, use the [Base UI ${markdownH1}](${headers.unstyled}). It's the unstyled version of the same component Material UI is built on top of. It's great for heavy customizations or smaller bundle sizes. + // `); + contents.push(` ## Unstyled -To completely own the design, without having to customize parting from Material Design, use the [Base UI ${markdownH1}](${headers.unstyled}) for an unstyled version of this component -Use this component for heavy customizations or smaller bundle sizes. +To completely own the design, without having to customize the built-in styles of Material UI, use the [Base UI ${markdownH1}](${headers.unstyled}). It's the unstyled version of the same component. It's great for heavy customizations or smaller bundle sizes. `); } From 533af1c8c4e93a89f8e719b3237b324234b815e4 Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Sat, 3 Feb 2024 17:34:51 +0100 Subject: [PATCH 5/6] Sam's review --- packages/markdown/prepareMarkdown.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/packages/markdown/prepareMarkdown.js b/packages/markdown/prepareMarkdown.js index 83afc618923221..54976862b68580 100644 --- a/packages/markdown/prepareMarkdown.js +++ b/packages/markdown/prepareMarkdown.js @@ -101,17 +101,11 @@ function prepareMarkdown(config) { const contents = getContents(markdown); if (headers.unstyled) { - // TODO v7: - // contents.push(` - // ## Unstyled - - // To completely own the design, without having to customize the built-in styles of Material UI, use the [Base UI ${markdownH1}](${headers.unstyled}). It's the unstyled version of the same component Material UI is built on top of. It's great for heavy customizations or smaller bundle sizes. - // `); - contents.push(` ## Unstyled -To completely own the design, without having to customize the built-in styles of Material UI, use the [Base UI ${markdownH1}](${headers.unstyled}). It's the unstyled version of the same component. It's great for heavy customizations or smaller bundle sizes. +Use the [Base UI ${markdownH1}](${headers.unstyled}) for complete ownership of the component's design, with no Material UI styles to override. +This unstyled version of the component is the ideal choice for heavy customization with a smaller bundle size. `); } From 8c24b60634d0a8133d1189bf5f2a321d52642ca6 Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Sat, 3 Feb 2024 17:46:03 +0100 Subject: [PATCH 6/6] fix breakline --- packages/markdown/prepareMarkdown.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/markdown/prepareMarkdown.js b/packages/markdown/prepareMarkdown.js index 54976862b68580..bce1eff29d8764 100644 --- a/packages/markdown/prepareMarkdown.js +++ b/packages/markdown/prepareMarkdown.js @@ -104,7 +104,7 @@ function prepareMarkdown(config) { contents.push(` ## Unstyled -Use the [Base UI ${markdownH1}](${headers.unstyled}) for complete ownership of the component's design, with no Material UI styles to override. +Use the [Base UI ${markdownH1}](${headers.unstyled}) for complete ownership of the component's design, with no Material UI styles to override. This unstyled version of the component is the ideal choice for heavy customization with a smaller bundle size. `); }