Skip to main content
ESC

Page

Page is a block responsible for the content of the document itself. It handles displaying markdown-based files as HTML.

/docs/example/page.tsx
import { Page } from "./robindoc";

export const Page = ({ children }) => {
return (
<Page
pathname="/docs/example"
components={{
Example: ({ children }) => <span>{children}</span>,
}}
/>
);
};

Props 

All customization in Robindoc happens through the structure and props of the components.

Base Props 

pathname [string] - the path of the current page. It should be specified completely, including the basePath;

config - the configuration for the Robindoc parser;

config.publicDirs [string[]] - an array of the project's public directories. Addresses of all images from markdown files located in this folder will be converted to absolute paths (for example, with the value [public], an image address like ./public/image.png will become /image.png);

components - an object of allowable JSX or Robin components. Read more on the page Writing MD;

translations [{ [key: string]: string }] - translations for the current block. The key is the term identifier, and the value is the corresponding translation. For the latest list of terms, check the editor hints.

Overwriting Props 

hideContents [boolean] - hide the contents section for the documentation page. By default, it is shown only if the page contains H2 or H3 headers;

breadcrumbs [{ pathname: string; title: string }[]] - overwrite automatically determined breadcrumbs. By default, they are displayed starting from the second nesting level;

editOnGitUri - overwrite the automatically determined git URI for the page. By default, it determines the file path if the source is a remote git repository;

next [{ pathname: string; title: string }] - overwrite the automatically determined next page in the documentation. By default, the next page in the structure is set;

prev [{ pathname: string; title: string }] - overwrite the automatically determined previous page in the documentation. By default, the previous page in the structure is set.

Usage 

Page is rendered on every page and depends on the generated structure.

For more details on using Page, refer to the section App organization.

Previous
Main
Next
RobinProvider
Return to navigation