Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
fuma-nama committed Mar 6, 2024
1 parent c342d2c commit b9e99df
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 50 deletions.
4 changes: 2 additions & 2 deletions apps/docs/content/docs/mdx/search-index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ You can access them with `JSON.parse`.
import type { SearchIndex } from 'fumadocs-mdx';

const indexes = JSON.parse(
readFileSync('./.next/server/chunks/fumadocs_search.json').toString()
readFileSync('./.next/server/chunks/fumadocs_search.json').toString(),
) as SearchIndex[];
```
```
8 changes: 4 additions & 4 deletions apps/docs/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ const config = {
const withMDX = createMDX({
buildSearchIndex: {
filter: (v) => {
if (v.match(/.+\.model\.mdx/)) return false
return true
}
if (v.match(/.+\.model\.mdx/)) return false;

return true;
},
},
mdxOptions: {
rehypeCodeOptions: {
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/utils/source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ export const utils = loader({
});

export type Page = InferPageType<typeof utils>;
export type Meta = InferMetaType<typeof utils>;
export type Meta = InferMetaType<typeof utils>;
26 changes: 13 additions & 13 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@

````md
```ts /config/ {1}
const config = "Hello";
const config = 'Hello';

something.call(config);
```
Expand All @@ -85,7 +85,7 @@
````md
```ts
// [!code word:config]
const config = "Hello"; // [!code highlight]
const config = 'Hello'; // [!code highlight]

something.call(config);
```
Expand Down Expand Up @@ -144,13 +144,13 @@
It's no longer encouraged to access `allDocs` directly because they will not include `url` property anymore. Please consider `getPages` instead.

```ts
import { allDocs, allMeta } from "contentlayer/generated";
import { createContentlayerSource } from "next-docs-zeta/contentlayer";
import { loader } from "next-docs-zeta/source";
import { allDocs, allMeta } from 'contentlayer/generated';
import { createContentlayerSource } from 'next-docs-zeta/contentlayer';
import { loader } from 'next-docs-zeta/source';

export const { getPage, pageTree, getPages } = loader({
baseUrl: "/docs",
rootDir: "docs",
baseUrl: '/docs',
rootDir: 'docs',
source: createContentlayerSource(allMeta, allDocs),
});
```
Expand All @@ -171,13 +171,13 @@
The interface is now unified, you can easily plug in a content source.

```ts
import { map } from "@/.map";
import { createMDXSource } from "next-docs-mdx";
import { loader } from "next-docs-zeta/source";
import { map } from '@/.map';
import { createMDXSource } from 'next-docs-mdx';
import { loader } from 'next-docs-zeta/source';

export const { getPage, getPages, pageTree } = loader({
baseUrl: "/docs",
rootDir: "docs",
baseUrl: '/docs',
rootDir: 'docs',
source: createMDXSource(map),
});
```
Expand Down Expand Up @@ -221,7 +221,7 @@
If you want to include other document types, or override the output configuration, the `create` function can return the fields and document types you need.

```ts
import { create } from "next-docs-zeta/contentlayer/configuration";
import { create } from 'next-docs-zeta/contentlayer/configuration';

const config = create(options);

Expand Down
24 changes: 12 additions & 12 deletions packages/mdx/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
Become:

```mdx
import img_banner from "../../public/image.png";
import img_banner from '../../public/image.png';

<img alt="banner" src={img_banner} />
```
Expand Down Expand Up @@ -146,13 +146,13 @@
`fromMap` has been removed. Please use `createMDXSource` instead.

```ts
import { map } from "@/.map";
import { createMDXSource } from "next-docs-mdx";
import { loader } from "next-docs-zeta/source";
import { map } from '@/.map';
import { createMDXSource } from 'next-docs-mdx';
import { loader } from 'next-docs-zeta/source';

export const { getPage, getPages, pageTree } = loader({
baseUrl: "/docs",
rootDir: "docs",
baseUrl: '/docs',
rootDir: 'docs',
source: createMDXSource(map),
});
```
Expand All @@ -166,7 +166,7 @@
```js
const withNextDocs = createNextDocs({
mdxOptions: {
lastModifiedTime: "git",
lastModifiedTime: 'git',
},
});
```
Expand Down Expand Up @@ -215,7 +215,7 @@

```ts
const utils = fromMap(map, {
rootDir: "ui",
rootDir: 'ui',
schema: {
frontmatter: frontmatterSchema,
},
Expand Down Expand Up @@ -246,11 +246,11 @@
The `validate` options is now renamed to `schema`.

```ts
import { defaultSchemas, fromMap } from "next-docs-mdx/map";
import { defaultSchemas, fromMap } from 'next-docs-mdx/map';

const utils = fromMap(map, {
rootDir: "docs/ui",
baseUrl: "/docs/ui",
rootDir: 'docs/ui',
baseUrl: '/docs/ui',
schema: {
frontmatter: defaultSchemas.frontmatter.extend({
preview: z.string().optional(),
Expand All @@ -269,7 +269,7 @@

```js
const withNextDocs = createNextDocs({
rootContentPath: "./content/docs",
rootContentPath: './content/docs',
});
```

Expand Down
36 changes: 18 additions & 18 deletions packages/ui/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@
<I18nProvider
translations={{
cn: {
name: "Chinese", // required
search: "Translated Content",
name: 'Chinese', // required
search: 'Translated Content',
},
}}
></I18nProvider>
Expand All @@ -156,15 +156,15 @@
migrate: Use `createPreset` instead

```js
const { createPreset } = require("fumadocs-ui/tailwind-plugin");
const { createPreset } = require('fumadocs-ui/tailwind-plugin');

/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
"./components/**/*.{ts,tsx}",
"./app/**/*.{ts,tsx}",
"./content/**/*.mdx",
"./node_modules/fumadocs-ui/dist/**/*.js",
'./components/**/*.{ts,tsx}',
'./app/**/*.{ts,tsx}',
'./content/**/*.mdx',
'./node_modules/fumadocs-ui/dist/**/*.js',
],
presets: [createPreset()],
};
Expand All @@ -177,15 +177,15 @@
Before:

```tsx
import { CodeBlock, Pre } from "fumadocs-ui/mdx/pre";
import { CodeBlock, Pre } from 'fumadocs-ui/mdx/pre';

<Pre title={title} allowCopy {...props} />;
```

After:

```tsx
import { CodeBlock, Pre } from "fumadocs-ui/components/codeblock";
import { CodeBlock, Pre } from 'fumadocs-ui/components/codeblock';

<CodeBlock title={title} allowCopy>
<Pre {...props} />
Expand Down Expand Up @@ -306,14 +306,14 @@
Add theme presets for the Tailwind CSS plugin, the default and ocean presets are available now.

```js
const { docsUi, docsUiPlugins } = require("next-docs-ui/tailwind-plugin");
const { docsUi, docsUiPlugins } = require('next-docs-ui/tailwind-plugin');

/** @type {import('tailwindcss').Config} */
module.exports = {
plugins: [
...docsUiPlugins,
docsUi({
preset: "ocean",
preset: 'ocean',
}),
],
};
Expand Down Expand Up @@ -349,7 +349,7 @@
Same as Docs Layout but doesn't include a sidebar. It can be used outside of the docs, a page tree is not required.

```jsx
import { Layout } from "next-docs-ui/layout";
import { Layout } from 'next-docs-ui/layout';

export default function HomeLayout({ children }) {
return <Layout>{children}</Layout>;
Expand Down Expand Up @@ -406,16 +406,16 @@
If you are using Tailwind CSS for your docs, it's now recommended to use the official plugin instead.

```js
const { docsUi, docsUiPlugins } = require("next-docs-ui/tailwind-plugin");
const { docsUi, docsUiPlugins } = require('next-docs-ui/tailwind-plugin');

/** @type {import('tailwindcss').Config} */
module.exports = {
darkMode: "class",
darkMode: 'class',
content: [
"./components/**/*.{ts,tsx}",
"./app/**/*.{ts,tsx}",
"./content/**/*.mdx",
"./node_modules/next-docs-ui/dist/**/*.js",
'./components/**/*.{ts,tsx}',
'./app/**/*.{ts,tsx}',
'./content/**/*.mdx',
'./node_modules/next-docs-ui/dist/**/*.js',
],
plugins: [...docsUiPlugins, docsUi],
};
Expand Down

0 comments on commit b9e99df

Please sign in to comment.