diff --git a/README.md b/README.md
index d0c475c3..8d745f32 100644
--- a/README.md
+++ b/README.md
@@ -14,18 +14,16 @@ Read the documentation in a convenient interface at [robindoc.com/docs](https://
Robindoc is a framework for automatically creating documentation websites based on markdown files, built on React.js Server Components.
```tsx filename="app/docs/page.tsx"
-export const Documentation = () => {
- return (
-
- } />
-
-
-
-
-
-
- );
-};
+const DocumentationPage = () => (
+
+ } />
+
+
+
+
+
+
+);
```
The main goal of Robindoc is to create a system where you can fully reuse the existing markdown documentation within your projects.
diff --git a/docs/01-getting-started/02-writing-md.md b/docs/01-getting-started/02-writing-md.md
index eddee8d3..359d3352 100644
--- a/docs/01-getting-started/02-writing-md.md
+++ b/docs/01-getting-started/02-writing-md.md
@@ -33,6 +33,8 @@ const Page = () => (
}}
/>
);
+
+export default Page;
```
The content of custom components (`children`) will be passed as parsed Markdown.
diff --git a/docs/01-getting-started/04-app-organization.md b/docs/01-getting-started/04-app-organization.md
index e67cd836..ae74d04f 100644
--- a/docs/01-getting-started/04-app-organization.md
+++ b/docs/01-getting-started/04-app-organization.md
@@ -3,9 +3,9 @@
Robindoc can be considered to consist of several parts:
- Documentation Structure ([more about documentation structure](../02-structure/README.md));
-- Robindoc Initialization ([more about initialization](../03-initialization.md));
+- Robindoc Initialization ([more about initialization](./03-initialization.md));
- Page Markup and Configuration ([more about customization](../03-customization/README.md));
-- Documentation Markdown Files ([more about writing MD](../02-writing-md.md)).
+- Documentation Markdown Files ([more about writing MD](./02-writing-md.md)).
## Organizing Documentation Files
@@ -31,11 +31,13 @@ Next.js supports dynamic routes, so it is recommended to set up one [dynamic seg
```tsx filename="app/docs/[[...path]]/page.tsx"
import { Page, Sidebar, getMeta, getPages } from "../robindoc";
-export const Page: React.FC<{ params: { path?: string[] } }> = ({ params }) => {
+const Page: React.FC<{ params: { path?: string[] } }> = ({ params }) => {
const pathname = "/docs/" + (params.path?.join("/") || "");
return ;
};
+
+export default Page;
```
For more details about the props, refer to the [`Page`](../03-customization/01-elements/page.md) element page.
@@ -99,18 +101,18 @@ import Logo from "./logo";
import "robindoc/lib/styles.css";
-export const Layout: React.FC = ({ children }) => {
- return (
-
- } />
-
-
- {children}
-
-
-
- );
-};
+const Layout: React.FC = ({ children }) => (
+
+ } />
+
+
+ {children}
+
+
+
+);
+
+export default Layout;
```
For more details on configuring elements, refer to the [`RobinProvider`](../03-customization/01-elements/robin-provider.md), [`Header`](../03-customization/01-elements/header.md), [`Sidebar`](../03-customization/01-elements/sidebar.md), [`Footer`](../03-customization/01-elements/footer.md), and [`Containers`](../03-customization/01-elements/containers.md) block pages.
@@ -136,25 +138,25 @@ export const GET = async (request: Request) => {
```
```tsx switcher filename="app/docs/layout.tsx" tab="TypeScript"
-export const Layout: React.FC = ({ children }) => {
- return (
-
- } searcher="/api/search" />
- {/* ... */}
-
- );
-};
+const Layout: React.FC = ({ children }) => (
+
+ } searcher="/api/search" />
+ {/* ... */}
+
+);
+
+export default Layout;
```
```js switcher filename="app/docs/layout.js" tab="JavaScript"
-export const Layout: React.FC = ({ children }) => {
- return (
-
- } searcher="/api/search" />
- {/* ... */}
-
- );
-};
+const Layout = ({ children }) => (
+
+ } searcher="/api/search" />
+ {/* ... */}
+
+);
+
+export default Layout;
```
### Vercel
diff --git a/docs/03-customization/01-elements/containers.md b/docs/03-customization/01-elements/containers.md
index eeadc6e0..6ac4556f 100644
--- a/docs/03-customization/01-elements/containers.md
+++ b/docs/03-customization/01-elements/containers.md
@@ -10,6 +10,8 @@ A special container designed for custom pages
import { PageContainer } from "robindoc";
const HomePage = () => {/* ... */};
+
+export default HomePage;
```
## DocsContainer
@@ -22,6 +24,8 @@ import { DocsContainer } from "robindoc";
const DocsLayout: React.FC = ({ children }) => (
{children};
);
+
+export default DocsLayout;
```
## BlogContainer
@@ -36,6 +40,8 @@ import { BlogContainer } from "robindoc";
const BlogLayout: React.FC = ({ children }) => (
{children};
);
+
+export default BlogLayout;
```
## Usage
diff --git a/docs/03-customization/01-elements/footer.md b/docs/03-customization/01-elements/footer.md
index 8c3b8d1e..c8036a29 100644
--- a/docs/03-customization/01-elements/footer.md
+++ b/docs/03-customization/01-elements/footer.md
@@ -5,14 +5,14 @@
```tsx filename="app/layout.tsx"
import { RobinProvider, Footer } from "robindoc";
-export const Layout: React.FC = ({ children }) => {
- return (
-
- {/* ... */}
-
-
- );
-};
+const Layout: React.FC = ({ children }) => (
+
+ {/* ... */}
+
+
+);
+
+export default Layout;
```
## Props
diff --git a/docs/03-customization/01-elements/header.md b/docs/03-customization/01-elements/header.md
index f7836f6e..492e744e 100644
--- a/docs/03-customization/01-elements/header.md
+++ b/docs/03-customization/01-elements/header.md
@@ -5,14 +5,14 @@
```tsx filename="app/layout.tsx"
import { RobinProvider, Header } from "robindoc";
-export const Layout: React.FC = ({ children }) => {
- return (
-
- } />
- {/* ... */}
-
- );
-};
+const Layout: React.FC = ({ children }) => (
+
+ } />
+ {/* ... */}
+
+);
+
+export default Layout;
```
## Props
diff --git a/docs/03-customization/01-elements/keylinks.md b/docs/03-customization/01-elements/keylinks.md
index dbc8af8f..77d33408 100644
--- a/docs/03-customization/01-elements/keylinks.md
+++ b/docs/03-customization/01-elements/keylinks.md
@@ -20,6 +20,8 @@ const RootLayout: React.FC = ({ children }) => (