docs: fix code block titles (#5733)

* docs: fix code block titles

* remove console

* fix build error
This commit is contained in:
Shahed Nasser
2023-11-27 16:08:10 +00:00
committed by GitHub
parent de8f748674
commit 547b16ead5
110 changed files with 483 additions and 456 deletions
@@ -30,7 +30,7 @@ npm install medusa-plugin-discount-generator
Finally, add the plugin to the `plugins` array in `medusa-config.js`:
```js title=medusa-config.js
```js title="medusa-config.js"
const plugins = [
// ...
{
@@ -65,7 +65,7 @@ The `DiscountGeneratorService` has one method `generateDiscount`. This method re
Here's an example of using the service in an API Route:
```ts title=src/api/store/generate-discount-code/route.ts
```ts title="src/api/store/generate-discount-code/route.ts"
import type {
MedusaRequest,
MedusaResponse,
@@ -44,7 +44,7 @@ Where `<YOUR_ACCESS_KEY>` is your ipstack accounts access key. Its availab
Finally, add the IP lookup plugin into the plugins array exported as part of the Medusa configuration in `medusa-config.js`:
```js title=medusa-config.js
```js title="medusa-config.js"
const plugins = [
// other plugins...
{
@@ -80,7 +80,7 @@ You can learn more about creating an API Route [here](../../development/api-rout
:::
```ts title=src/api/store/customer-region/route.ts
```ts title="src/api/store/customer-region/route.ts"
import type {
MedusaRequest,
MedusaResponse,
@@ -124,7 +124,7 @@ For example, you can attach it to all `/store` routes to ensure the customers
<!-- eslint-disable @typescript-eslint/no-var-requires -->
```ts title=src/api/middlewares.ts
```ts title="src/api/middlewares.ts"
import type { MiddlewaresConfig } from "@medusajs/medusa"
const { preCartCreation } = require(
"medusa-plugin-ip-lookup/api/medusa-middleware"
@@ -44,7 +44,7 @@ npm install medusa-plugin-restock-notification
Then, add the plugin into the plugins array exported as part of the Medusa configuration in `medusa-config.js`:
```js title=medusa-config.js
```js title="medusa-config.js"
const plugins = [
// other plugins...
{
@@ -116,7 +116,7 @@ The SendGrid plugin already listens to and handles the `restock-notification.res
Here's an example of a [subscriber](../../development/events/subscribers.mdx) that listens to the `restock-notification.restocked` event and uses the [SendGrid plugin](../notifications/sendgrid.mdx) to send the subscribed customers an email:
```ts title=src/subscribers/restock-notification.ts
```ts title="src/subscribers/restock-notification.ts"
import {
type SubscriberConfig,
type SubscriberArgs,
@@ -37,7 +37,7 @@ npm install medusa-plugin-wishlist
Finally, add the plugin to the `plugins` array in `medusa-config.js`:
```js title=medusa-config.js
```js title="medusa-config.js"
const plugins = [
// ...
{