Skip to content

Commit

Permalink
docs: fix code block titles (#5733)
Browse files Browse the repository at this point in the history
* docs: fix code block titles

* remove console

* fix build error
  • Loading branch information
shahednasser authored Nov 27, 2023
1 parent de8f748 commit 547b16e
Show file tree
Hide file tree
Showing 110 changed files with 481 additions and 454 deletions.
2 changes: 1 addition & 1 deletion www/apps/api-reference/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"openapi-sampler": "^1.3.1",
"openapi-types": "^12.1.3",
"postcss": "8.4.27",
"prism-react-renderer": "^2.0.6",
"prism-react-renderer": "^2.3.0",
"react": "latest",
"react-dom": "latest",
"react-instantsearch": "^7.0.1",
Expand Down
6 changes: 3 additions & 3 deletions www/apps/docs/content/admin/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ In this document, you'll learn about the different ways you can configure the ad

The `build` command in the admin CLI allows you to manually build the admin dashboard. If you intend to use it, you should typically add it to the `package.json` of the Medusa backend:

```json title=package.json
```json title="package.json"
{
"scripts": {
// other scripts...
Expand All @@ -29,7 +29,7 @@ You can add the following option to the `medusa-admin build` command:

The `develop` command in the admin CLI allows you to run the admin dashboard in development separately from the Medusa backend. If you intend to use it, you should typically add it to the `package.json` of the Medusa backend:

```json title=package.json
```json title="package.json"
{
"scripts": {
// other scripts...
Expand Down Expand Up @@ -84,7 +84,7 @@ This is an advanced feature and requires knowledge of configuring webpack. If co

For example:

```js title=src/admin/webpack.config.js
```js title="src/admin/webpack.config.js"
import { withCustomWebpackConfig } from "@medusajs/admin"

export default withCustomWebpackConfig((config, webpack) => {
Expand Down
40 changes: 20 additions & 20 deletions www/apps/docs/content/admin/onboarding.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Each of the collapsible elements below hold the path to the file that you should
<Details>
<Summary>src/admin/types/icon-type.ts</Summary>

```tsx title=src/admin/types/icon-type.ts
```tsx title="src/admin/types/icon-type.ts"
import React from "react"

type IconProps = {
Expand All @@ -80,7 +80,7 @@ Each of the collapsible elements below hold the path to the file that you should

<!-- eslint-disable max-len -->

```tsx title=src/admin/components/shared/icons/get-started.tsx
```tsx title="src/admin/components/shared/icons/get-started.tsx"
import React from "react"
import IconProps from "../../../types/icon-type"

Expand Down Expand Up @@ -115,7 +115,7 @@ Each of the collapsible elements below hold the path to the file that you should

<!-- eslint-disable max-len -->

```tsx title=src/admin/components/shared/icons/dollar-sign-icon.tsx
```tsx title="src/admin/components/shared/icons/dollar-sign-icon.tsx"
import React from "react"
import IconProps from "../../../types/icon-type"

Expand Down Expand Up @@ -162,7 +162,7 @@ Each of the collapsible elements below hold the path to the file that you should

<!-- eslint-disable max-len -->

```tsx title=src/admin/components/shared/accordion.tsx
```tsx title="src/admin/components/shared/accordion.tsx"
import * as AccordionPrimitive from "@radix-ui/react-accordion"
import React from "react"
import { CheckCircleSolid, CircleMiniSolid } from "@medusajs/icons"
Expand Down Expand Up @@ -295,7 +295,7 @@ Each of the collapsible elements below hold the path to the file that you should
<!-- eslint-disable max-len -->
```tsx title=src/admin/components/shared/card.tsx
```tsx title="src/admin/components/shared/card.tsx"
import { Text, clx } from "@medusajs/ui"
type CardProps = {
Expand Down Expand Up @@ -348,7 +348,7 @@ An [entity](../development/entities/overview.mdx) represents a table in the data

To create the entity, create the file `src/models/onboarding.ts` with the following content:

```ts title=src/models/onboarding.ts
```ts title="src/models/onboarding.ts"
import { BaseEntity } from "@medusajs/medusa"
import { Column, Entity } from "typeorm"

Expand All @@ -367,7 +367,7 @@ export class OnboardingState extends BaseEntity {

Then, create the file `src/repositories/onboarding.ts` that holds the repository of the entity with the following content:

```ts title=src/repositories/onboarding.ts
```ts title="src/repositories/onboarding.ts"
import {
dataSource,
} from "@medusajs/medusa/dist/loaders/database"
Expand Down Expand Up @@ -450,7 +450,7 @@ Start by creating the file `src/types/onboarding.ts` with the following content:
<!-- eslint-disable @typescript-eslint/no-empty-interface -->
```ts title=src/types/onboarding.ts
```ts title="src/types/onboarding.ts"
import { OnboardingState } from "../models/onboarding"

export type UpdateOnboardingStateInput = {
Expand All @@ -472,7 +472,7 @@ Then, create the file `src/services/onboarding.ts` with the following content:
<!-- eslint-disable prefer-rest-params -->
```ts title=src/services/onboarding.ts
```ts title="src/services/onboarding.ts"
import { TransactionBaseService } from "@medusajs/medusa"
import OnboardingRepository from "../repositories/onboarding"
import { OnboardingState } from "../models/onboarding"
Expand Down Expand Up @@ -540,7 +540,7 @@ The last part of this step is to create the [API Routes](../development/api-rout
To add these API Routes, create the file `src/api/admin/onboarding/route.ts` with the following content:
```ts title=src/api/admin/onboarding/route.ts
```ts title="src/api/admin/onboarding/route.ts"
import type {
MedusaRequest,
MedusaResponse,
Expand Down Expand Up @@ -597,7 +597,7 @@ Create the file `src/admin/widgets/onboarding-flow/onboarding-flow.tsx` with the
<!-- eslint-disable @typescript-eslint/ban-types -->
```tsx title=src/admin/widgets/onboarding-flow/onboarding-flow.tsx
```tsx title="src/admin/widgets/onboarding-flow/onboarding-flow.tsx"
import { OrderDetailsWidgetProps, ProductDetailsWidgetProps, WidgetConfig, WidgetProps } from "@medusajs/admin"
import { useAdminCustomPost, useAdminCustomQuery, useMedusa } from "medusa-react"
import React, { useEffect, useState, useMemo, useCallback } from "react"
Expand Down Expand Up @@ -1059,7 +1059,7 @@ const OnboardingFlow = (props: OnboardingWidgetProps) => {
const isCurrent = currentStep === step.id
return (
<Accordion.Item
title={step.title}
title="{step.title}"
value={step.id}
headingSize="medium"
active={isCurrent}
Expand Down Expand Up @@ -1135,7 +1135,7 @@ Notice that as there are two types of flows, you'll be creating the components f
<!-- eslint-disable max-len -->
```tsx title=src/admin/components/onboarding-flow/default/products/products-list.tsx
```tsx title="src/admin/components/onboarding-flow/default/products/products-list.tsx"
import React, { useMemo } from "react"
import {
useAdminCreateProduct,
Expand Down Expand Up @@ -1221,7 +1221,7 @@ Notice that as there are two types of flows, you'll be creating the components f
<!-- eslint-disable max-len -->
```tsx title=src/admin/components/onboarding-flow/default/products/product-detail.tsx
```tsx title="src/admin/components/onboarding-flow/default/products/product-detail.tsx"
import React, { useEffect, useMemo } from "react"
import {
useAdminPublishableApiKeys,
Expand Down Expand Up @@ -1325,7 +1325,7 @@ Notice that as there are two types of flows, you'll be creating the components f
<!-- eslint-disable max-len -->
```tsx title=src/admin/components/onboarding-flow/default/orders/orders-list.tsx
```tsx title="src/admin/components/onboarding-flow/default/orders/orders-list.tsx"
import React from "react"
import {
useAdminProduct,
Expand Down Expand Up @@ -1420,7 +1420,7 @@ Notice that as there are two types of flows, you'll be creating the components f
<!-- eslint-disable max-len -->
```tsx title=src/admin/components/onboarding-flow/default/orders/order-detail.tsx
```tsx title="src/admin/components/onboarding-flow/default/orders/order-detail.tsx"
import React from "react"
import {
ComputerDesktopSolid,
Expand Down Expand Up @@ -1571,7 +1571,7 @@ Notice that as there are two types of flows, you'll be creating the components f
<!-- eslint-disable max-len -->
```tsx title=src/admin/components/onboarding-flow/nextjs/products/products-list.tsx
```tsx title="src/admin/components/onboarding-flow/nextjs/products/products-list.tsx"
import React from "react"
import {
useAdminCreateProduct,
Expand Down Expand Up @@ -1669,7 +1669,7 @@ Notice that as there are two types of flows, you'll be creating the components f
<!-- eslint-disable max-len -->
```tsx title=src/admin/components/onboarding-flow/nextjs/products/product-detail.tsx
```tsx title="src/admin/components/onboarding-flow/nextjs/products/product-detail.tsx"
import { useAdminProduct } from "medusa-react"
import { StepContentProps } from "../../../../widgets/onboarding-flow/onboarding-flow"
import { Button, Text } from "@medusajs/ui"
Expand Down Expand Up @@ -1737,7 +1737,7 @@ Notice that as there are two types of flows, you'll be creating the components f
<!-- eslint-disable max-len -->
```tsx title=src/admin/components/onboarding-flow/nextjs/orders/orders-list.tsx
```tsx title="src/admin/components/onboarding-flow/nextjs/orders/orders-list.tsx"
import React from "react"
import {
useAdminProduct,
Expand Down Expand Up @@ -1817,7 +1817,7 @@ Notice that as there are two types of flows, you'll be creating the components f
<!-- eslint-disable max-len -->
```tsx title=src/admin/components/onboarding-flow/nextjs/orders/order-detail.tsx
```tsx title="src/admin/components/onboarding-flow/nextjs/orders/order-detail.tsx"
import React from "react"
import { CurrencyDollarSolid, NextJs, SquaresPlusSolid } from "@medusajs/icons"
import { IconBadge, Heading, Text } from "@medusajs/ui"
Expand Down
2 changes: 1 addition & 1 deletion www/apps/docs/content/admin/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ npm install @medusajs/admin

In `medusa-config.js`, add the admin plugin into the array of `plugins`:

```js title=medusa-config.js
```js title="medusa-config.js"
const plugins = [
// ...
{
Expand Down
18 changes: 9 additions & 9 deletions www/apps/docs/content/admin/routes.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ These changes may already be available in your Medusa project. They're included

First, update your `tsconfig.json` with the following configurations:

```json title=tsconfig.json
```json title="tsconfig.json"
{
"compilerOptions": {
"target": "es2019",
Expand Down Expand Up @@ -81,7 +81,7 @@ The addition of `"jsx": "react-jsx"` specified how should TypeScript transform J

Next, create the file `tsconfig.server.json` with the following content:

```json title=tsconfig.server.json
```json title="tsconfig.server.json"
{
"extends": "./tsconfig.json",
"compilerOptions": {
Expand All @@ -96,7 +96,7 @@ This is the configuration that will be used to transpile your custom backend cod

Finally, create the file `tsconfig.admin.json` with the following content:

```json title=tsconfig.admin.json
```json title="tsconfig.admin.json"
{
"extends": "./tsconfig.json",
"compilerOptions": {
Expand Down Expand Up @@ -135,7 +135,7 @@ For an admin route to be valid, it must default export a React component. There

For example, you can create the file `src/admin/routes/custom/page.tsx` with the following content:

```tsx title=src/admin/routes/custom/page.tsx
```tsx title="src/admin/routes/custom/page.tsx"
const CustomPage = () => {
return (
<div>
Expand Down Expand Up @@ -217,7 +217,7 @@ The object has one property `link`, which is an object having the following prop

For example, you can change the content of the previous route you created to export a config object:

```tsx title=src/admin/routes/custom/page.tsx
```tsx title="src/admin/routes/custom/page.tsx"
import { RouteConfig } from "@medusajs/admin"
import { CustomIcon } from "../../icons/custom"

Expand Down Expand Up @@ -261,7 +261,7 @@ If you're installing it in a plugin with admin customizations, make sure to incl

For example:

```tsx title=src/admin/routes/custom/[id]/page.tsx
```tsx title="src/admin/routes/custom/[id]/page.tsx"
import { useParams } from "react-router-dom"

const CustomPage = () => {
Expand All @@ -285,7 +285,7 @@ If you want to use routing functionalities such as linking to another page or na

For example, to add a link to another page:

```tsx title=src/admin/routes/custom/page.tsx
```tsx title="src/admin/routes/custom/page.tsx"
import { Link } from "react-router-dom"

const CustomPage = () => {
Expand Down Expand Up @@ -314,7 +314,7 @@ For example, to customize your custom route:

<!-- eslint-disable max-len -->

```tsx title=src/admin/routes/custom/page.tsx
```tsx title="src/admin/routes/custom/page.tsx"
const CustomPage = () => {
return (
<div
Expand All @@ -341,7 +341,7 @@ Make sure to also install the Medusa React package first if you’re intending t

For example, you can retrieve available products and display them in your route:

```tsx title=src/admin/routes/custom/page.tsx
```tsx title="src/admin/routes/custom/page.tsx"
import { useAdminProducts } from "medusa-react"

const CustomPage = () => {
Expand Down
16 changes: 8 additions & 8 deletions www/apps/docs/content/admin/setting-pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ These changes may already be available in your Medusa project. They're included

First, update your `tsconfig.json` with the following configurations:

```json title=tsconfig.json
```json title="tsconfig.json"
{
"compilerOptions": {
"target": "es2019",
Expand Down Expand Up @@ -77,7 +77,7 @@ The addition of `"jsx": "react-jsx"` specified how should TypeScript transform J

Next, create the file `tsconfig.server.json` with the following content:

```json title=tsconfig.server.json
```json title="tsconfig.server.json"
{
"extends": "./tsconfig.json",
"compilerOptions": {
Expand All @@ -92,7 +92,7 @@ This is the configuration that will be used to transpile your custom backend cod

Finally, create the file `tsconfig.admin.json` with the following content:

```json title=tsconfig.admin.json
```json title="tsconfig.admin.json"
{
"extends": "./tsconfig.json",
"compilerOptions": {
Expand Down Expand Up @@ -131,7 +131,7 @@ For a setting page to be valid, it must default export a React component. There

For example, you can create the file `src/admin/settings/custom/page.tsx` with the following content:

```tsx title=src/admin/settings/custom/page.tsx
```tsx title="src/admin/settings/custom/page.tsx"
import type { SettingConfig } from "@medusajs/admin"
import { CustomIcon } from "../../icons/custom"

Expand Down Expand Up @@ -184,7 +184,7 @@ Every route receives props of the type `RouteProps`, which includes the `notify`

For example:

```tsx title=src/admin/settings/custom/page.tsx
```tsx title="src/admin/settings/custom/page.tsx"
import type { SettingConfig } from "@medusajs/admin"
import type { SettingProps } from "@medusajs/admin"

Expand Down Expand Up @@ -226,7 +226,7 @@ For example, to customize the style of your custom setting page:

<!-- eslint-disable max-len -->

```tsx title=src/admin/settings/custom/page.tsx
```tsx title="src/admin/settings/custom/page.tsx"
import type { SettingConfig } from "@medusajs/admin"

const CustomSettingPage = () => {
Expand Down Expand Up @@ -269,7 +269,7 @@ If you're installing it in a plugin with admin customizations, make sure to incl

For example, to add a link to another page:

```tsx title=src/admin/settings/custom/page.tsx
```tsx title="src/admin/settings/custom/page.tsx"
import type { SettingConfig } from "@medusajs/admin"
import { Link } from "react-router-dom"

Expand Down Expand Up @@ -310,7 +310,7 @@ Make sure to also install the Medusa React package first if you’re intending t

For example, you can retrieve available products and display them in your route:

```tsx title=src/admin/settings/custom/page.tsx
```tsx title="src/admin/settings/custom/page.tsx"
import type { SettingConfig } from "@medusajs/admin"
import { useAdminProducts } from "medusa-react"

Expand Down
Loading

3 comments on commit 547b16e

@vercel
Copy link

@vercel vercel bot commented on 547b16e Nov 27, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

docs-ui – ./www/apps/ui

docs-ui-git-develop-medusajs.vercel.app
docs-ui-medusajs.vercel.app
docs-ui.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 547b16e Nov 27, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

medusa-docs – ./www/apps/docs

medusa-docs.vercel.app
medusa-docs-medusajs.vercel.app
medusa-docs-git-develop-medusajs.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 547b16e Nov 27, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

api-reference – ./www/apps/api-reference

api-reference-git-develop-medusajs.vercel.app
docs.medusajs.com
api-reference-delta.vercel.app
api-reference-medusajs.vercel.app

Please sign in to comment.