Skip to content

Commit

Permalink
docs: lint markdown files with mdclint
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz committed Dec 20, 2024
1 parent a27dcae commit ed72d8a
Show file tree
Hide file tree
Showing 26 changed files with 175 additions and 97 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ Nuxt Content reads the `content/` directory in your project, parses `.md`, `.yml
- Powerful query builder on top of SQLite database
- [... and more](https://content3.nuxt.dev)


## 💻 Development

- Clone repository
Expand Down
1 change: 0 additions & 1 deletion docs/content/docs/1.getting-started/3.configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ Content module uses files path to generate the slug, default title and content o

If set to `true`, the path will be prefixed with a leading slash. Default value is `true`.


### `pathMeta.slugifyOptions`

Content module uses [slugify](https://github.com/simov/slugify) to generate the slug, you can customize the behavior of slugify with this option.
Expand Down
3 changes: 1 addition & 2 deletions docs/content/docs/1.getting-started/4.migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const v2Surround = await queryContent(targetPath)

// Content v3 - don't forget to create `content` collection in `content.config.ts`
const v3Surround = await queryCollectionItemSurroundings(
'content',
'content',
targetPath,
{
fields: ['title', 'description', 'navigation']
Expand All @@ -118,4 +118,3 @@ Many `ProsePre` components are thin wrappers around the `ProseCode` component. W
Suggested Changes
1. Your _current_ `ProseCode` logic should be moved to `ProsePre`
2. Rename your `ProseCodeInline` component to `ProseCode`

2 changes: 1 addition & 1 deletion docs/content/docs/2.collections/1.collections.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default defineContentConfig({

Schemas enforce data consistency within a collection and serve as the source of truth for TypeScript types.

On top of the [built-in fields](#built-in-fields), you can define a schema by adding the `schema` property to your collection by using a [`zod`](https://zod.dev) schema:
On top of the built-in fields, you can define a schema by adding the `schema` property to your collection by using a [`zod`](https://zod.dev) schema:

```ts [content.config.ts]
import { defineCollection, defineContentConfig, z } from '@nuxt/content'
Expand Down
18 changes: 9 additions & 9 deletions docs/content/docs/3.files/1.markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ This will be rendered inside the `description` slot.
:::preview-card{icon="i-lucide-eye" label="Preview"}
::::example-hero
My Page Title

#description
This will be rendered inside the `description` slot.
::::
Expand All @@ -235,15 +235,15 @@ You can use Markdown inside your components slots:
A [rich text](/) will be **rendered** by the component.
::
```

```html [MyTitle.vue]
<template>
<h1 class="text-4xl">
<slot mdc-unwrap="p" />
</h1>
</template>
```

::::preview-card{icon="i-lucide-eye" label="Preview"}
:::::example-title
A [rich text](/) will be **rendered** by the component.
Expand Down Expand Up @@ -384,7 +384,7 @@ defineProps({

Attributes are useful for highlighting and modifying part of paragraph. The syntax is nearly similar to inline components and markdown links syntax.

Possible values ​​are all named attributes, classes with the notation `.class-name` and an ID with `#id-name`.
Possible values are all named attributes, classes with the notation `.class-name` and an ID with `#id-name`.

::code-group
```mdc [index.md]
Expand All @@ -402,25 +402,25 @@ In addition to mdc components and `span`, attribute syntax will work on images,
```md [index.md]
Attributes work on:

- ![](/favicon.ico){style="display: inline; margin: 0;"} image,
- ![favicon](/favicon.ico){style="display: inline; margin: 0;"} image,
- [link](#attributes){style="background-color: pink;"}, `code`{style="color: cyan;"},
- _italic_{style="background-color: yellow; color:black;"} and **bold**{style="background-color: lightgreen;"} texts.
```

:::preview-card{prose label="Preview"}
Attributes work on:
- ![](/favicon.ico){style="display: inline; margin: 0;"} image,

- ![favicon](/favicon.ico){style="display: inline; margin: 0;"} image,
- [link](#attributes){style="background-color: pink;"}, `code`,
- _italic_ and **bold** texts.
- *italic* and **bold** texts.
:::
::

## Binding Data in Markdown

You can bind data within your Markdown document using the `{{ $doc.variable || 'defaultValue' }}` syntax. These values can be defined in the YAML front matter at the top of the document, within each MDC component, or injected using the `data` prop of the `<ContentRenderer>` component.

#### Example 1: Define in YAML
### Example 1: Define in YAML

```mdc
---
Expand Down
2 changes: 1 addition & 1 deletion docs/content/docs/3.utils/2.query-collection-navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: The queryCollectionNavigation composable generates the navigation

```ts
function queryCollectionNavigation<T extends keyof PageCollections>(
collection: T,
collection: T,
fields?: Array<keyof PageCollections[T]>
): ChainablePromise<T, ContentNavigationItem[]>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ description: The queryCollectionItemSurroundings composable looks for sibling

```ts
function queryCollectionItemSurroundings<T extends keyof PageCollections>(
collection: T,
path: string,
collection: T,
path: string,
opts?: SurroundOptions<keyof PageCollections[T]>
): ChainablePromise<T, ContentNavigationItem[]>

Expand Down
17 changes: 12 additions & 5 deletions docs/content/docs/4.components/2.prose.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ If you want to use `]` in the filename, you need to escape it with 2 backslashes

:::preview-card{icon="i-lucide-eye" label="Preview"}
`code`

`const code: string = 'highlighted code inline'`
:::
::
Expand All @@ -102,6 +102,7 @@ If you want to use `]` in the filename, you need to escape it with 2 backslashes
```

:::preview-card{.pt-4 label="Preview"}
<!-- markdownlint-disable-next-line -->
# H1 Heading
:::
::
Expand All @@ -114,6 +115,7 @@ If you want to use `]` in the filename, you need to escape it with 2 backslashes
```

:::preview-card{icon="i-lucide-eye" label="Preview"}
<!-- markdownlint-disable-next-line -->
## H2 Heading
:::
::
Expand All @@ -126,6 +128,7 @@ If you want to use `]` in the filename, you need to escape it with 2 backslashes
```

:::preview-card{icon="i-lucide-eye" label="Preview"}
<!-- markdownlint-disable-next-line -->
### H3 Heading
:::
::
Expand All @@ -138,6 +141,7 @@ If you want to use `]` in the filename, you need to escape it with 2 backslashes
```

:::preview-card{icon="i-lucide-eye" label="Preview"}
<!-- markdownlint-disable-next-line -->
#### H4 Heading
:::
::
Expand All @@ -150,6 +154,7 @@ If you want to use `]` in the filename, you need to escape it with 2 backslashes
```

:::preview-card{icon="i-lucide-eye" label="Preview"}
<!-- markdownlint-disable-next-line -->
##### H5 Heading
:::
::
Expand All @@ -162,6 +167,7 @@ If you want to use `]` in the filename, you need to escape it with 2 backslashes
```

:::preview-card{icon="i-lucide-eye" label="Preview"}
<!-- markdownlint-disable-next-line -->
###### H6 Heading
:::
::
Expand All @@ -179,9 +185,9 @@ Divider above.

:::preview-card{icon="i-lucide-eye" label="Preview"}
Divider under.

---

Divider above.
:::
::
Expand Down Expand Up @@ -292,12 +298,13 @@ _Just an italic paragraph._
```

:::preview-card{icon="i-lucide-eye" label="Preview"}
| | | |
| --- | --------- | ----------- |

| Key | Type | Description |
| --- | --------- | ----------- |
| 1 | Wonderful | Table |
| 2 | Wonderful | Data |
| 3 | Wonderful | Website |

:::
::

Expand Down
4 changes: 3 additions & 1 deletion docs/content/docs/7.studio/1.setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ The `__studio.json` file is generated but you encounter a `Forbidden error: inva
This information should be populated automatically in most cases. We support most popular providers (Vercel, Netlify, etc.), but if you're using a non supported provider or a custom one, it may not be fetched correctly.
::

<!-- markdownlint-disable-next-line -->
2. You can manually override this data by setting those configs in your `nuxt.config.ts`:

```ts [nuxt.config.ts]
Expand All @@ -90,11 +91,12 @@ export default defineNuxtConfig({
gitInfo: {
name: 'Your repository name',
owner: 'Your repository owner/organization',
url: 'Your GitHub repository URL'
url: 'Your GitHub repository URL'
}
}
}
})
```

<!-- markdownlint-disable-next-line -->
3. By ensuring these fields are correctly set, you can resolve the `Forbidden error` and successfully enable your site preview on Nuxt Studio. If not, please contact us on the [Discord server](https://discord.gg/sBXDm6e8SP).
3 changes: 2 additions & 1 deletion docs/content/docs/7.studio/3.content.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ seo:

Nuxt Studio offers a versatile workspace for both developers and content writers, giving them the freedom to choose between our differents editors:

- [Notion-like editor](#markdown-editor-markdown-files) for `Markdown` files
- [Notion-like editor](#notion-like-editor-markdown-files) for `Markdown` files
- [Form editor](#form-editor-yaml-and-json-files) for `YAML` and `JSON` files
- [Code editor](#code-editor) for any kind of files (for technical users only)

Expand Down Expand Up @@ -55,6 +55,7 @@ One of this editor standout features is its ability to integrate and customize a
In other terms, a developer can create any kind of visually complex components and editors will be able to use them and focus on the content. An editor can also tweak the component properties, styles, and behavior to fit its specific requirements as long as the developer made it customizable.

::steps{level="4"}

#### Create your component

You can create Vue components and integrate them into Markdown. They just need to be located in the `/components/content` folder to be available.
Expand Down
2 changes: 1 addition & 1 deletion docs/content/docs/7.studio/5.config.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default defineAppConfig({})

To create a customized editing experience for your `app.config.ts` in Studio, you need to create a `nuxt.schema.ts` file in your project. This schema serves as a representation of your `app.config.ts`.

#### Helpers
### Helpers

- The `group` method allows you to customize parent objects.
- The `field` method allows you to customize inputs (aka leaf).
Expand Down
8 changes: 5 additions & 3 deletions docs/content/docs/7.studio/6.debug.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ It can help if:
## Tutorial

::steps
### Start by importing your project on Studio.

### Clone your repository on local.
### Start by importing your project on Studio

### Clone your repository on local

### Enable the Studio module in development

Expand All @@ -48,7 +49,8 @@ npx nuxt dev --tunnel

`__studio.json` file should accessible from `https://your-localtunnel-url/__studio.json`

### Copy the tunnel URL and copy it in the self-hosting section of the deployment tab on Studio platform.
### Copy the tunnel URL and copy it in the self-hosting section of the deployment tab on Studio platform

::

::tip
Expand Down
Loading

0 comments on commit ed72d8a

Please sign in to comment.