From 29769d6f2686c2e71de6373454e0bfee4ed3396a Mon Sep 17 00:00:00 2001 From: Vordgi Date: Tue, 1 Oct 2024 14:32:54 +0400 Subject: [PATCH] rd-242 update links in documentation --- README.md | 10 +++++----- docs/01-getting-started/01-installation.md | 2 +- docs/01-getting-started/03-initialization.md | 8 ++++---- .../04-app-organization/README.md | 16 ++++++++-------- .../04-app-organization/next-js.md | 8 ++++---- docs/01-getting-started/README.md | 8 ++++---- docs/02-structure/01-configuration.md | 4 ++-- docs/02-structure/02-items.md | 16 ++++++++-------- docs/02-structure/03-data-source.md | 4 ++-- docs/02-structure/README.md | 4 ++-- docs/03-customization/01-elements/README.md | 2 +- docs/03-customization/01-elements/footer.md | 2 +- docs/03-customization/01-elements/header.md | 4 ++-- docs/03-customization/01-elements/main.md | 2 +- docs/03-customization/01-elements/page.md | 4 ++-- .../01-elements/robin-provider.md | 2 +- docs/03-customization/01-elements/sidebar.md | 2 +- docs/03-customization/02-tools/README.md | 2 +- docs/03-customization/02-tools/get-meta.md | 6 +++--- .../02-tools/get-page-content.md | 4 ++-- docs/03-customization/02-tools/get-pages.md | 4 ++-- docs/03-customization/03-search.md | 6 +++--- docs/03-customization/README.md | 6 +++--- site/src/app/docs/[[...path]]/page.tsx | 2 +- site/src/app/docs/[[...path]]/robindoc.ts | 2 +- 25 files changed, 65 insertions(+), 65 deletions(-) diff --git a/README.md b/README.md index b897caf1..8c91b69a 100644 --- a/README.md +++ b/README.md @@ -34,11 +34,11 @@ No additional configuration is needed, while preserving the accessibility and cl ## Advantages -- Works on React.js Server Components (RSC). The framework choice is up to you. More details in the section "[App Organization](./docs/getting-started/app-organization/README.md)"; -- Requires no configuration of the project, bundler, or markdown documents. More details in the section "[Customization](./docs/customization/README.md)"; -- Supports loading content from various sources, including GitHub. More details in the section "[Data Source](./docs/structure/data-source.md)"; -- Supports fully automatic documentation generation, as well as custom generation. More details in the section "[Structure](./docs/structure/README.md)"; -- Supports JSX/HTML and special Robin components for all sources. More details in the section "[Writing MD](./docs/getting-started/writing-md.md)"; +- Works on React.js Server Components (RSC). The framework choice is up to you. More details in the section "[App Organization](./docs/01-getting-started/04-app-organization/README.md)"; +- Requires no configuration of the project, bundler, or markdown documents. More details in the section "[Customization](./docs/03-customization/README.md)"; +- Supports loading content from various sources, including GitHub. More details in the section "[Data Source](./docs/02-structure/03-data-source.md)"; +- Supports fully automatic documentation generation, as well as custom generation. More details in the section "[Structure](./docs/02-structure/README.md)"; +- Supports JSX/HTML and special Robin components for all sources. More details in the section "[Writing MD](./docs/01-getting-started/02-writing-md.md)"; - Optimized for metrics and accessibility. ## Additional diff --git a/docs/01-getting-started/01-installation.md b/docs/01-getting-started/01-installation.md index db15425d..3e4c14c9 100644 --- a/docs/01-getting-started/01-installation.md +++ b/docs/01-getting-started/01-installation.md @@ -4,7 +4,7 @@ Robindoc is simply a helper framework, meaning it does not include React itself If you do not yet have an application, initialize it according to the instructions of the framework you are comfortable with (that supports RSC). -If you already have an application on a framework that supports RSC, simply install the `robindoc` package. After that, you can fully integrate it into your application by [initializing Robindoc](./initialization.md). +If you already have an application on a framework that supports RSC, simply install the `robindoc` package. After that, you can fully integrate it into your application by [initializing Robindoc](./03-initialization.md). **Using npm:** diff --git a/docs/01-getting-started/03-initialization.md b/docs/01-getting-started/03-initialization.md index aa33d1d1..51c05f2e 100644 --- a/docs/01-getting-started/03-initialization.md +++ b/docs/01-getting-started/03-initialization.md @@ -1,10 +1,10 @@ # Initialization -To use Robindoc with all its features, you need to initialize it. To do this, you should call the `initializeRobindoc` function, passing your structure configuration. For more about the structure and how to work with it, read the "[Structure](../structure/README.md)" section. +To use Robindoc with all its features, you need to initialize it. To do this, you should call the `initializeRobindoc` function, passing your structure configuration. For more about the structure and how to work with it, read the "[Structure](../02-structure/README.md)" section. ## Calling the Method -The method will return dynamic components [`Page`](../customization/elements/page.md) and [`Sidebar`](../customization/elements/sidebar.md), as well as the methods [`getPages`](../customization/tools/get-pages.md), [`getMeta`](../customization/tools/get-meta.md), and [`getPageContent`](../customization/tools/get-page-content.md). +The method will return dynamic components [`Page`](../03-customization/01-elements/page.md) and [`Sidebar`](../03-customization/01-elements/sidebar.md), as well as the methods [`getPages`](../03-customization/02-tools/get-pages.md), [`getMeta`](../03-customization/02-tools/get-meta.md), and [`getPageContent`](../03-customization/02-tools/get-page-content.md). ```ts import { initializeRobindoc } from "robindoc"; @@ -20,7 +20,7 @@ export const { Page, Sidebar, getPages, getMeta, getPageContent } = }); ``` -Now, use these elements in the necessary places. For more details, read the "[App Organization](./app-organization/README.md)" section. +Now, use these elements in the necessary places. For more details, read the "[App Organization](./04-app-organization/README.md)" section. ## File Location @@ -30,4 +30,4 @@ However, it is recommended to place these files near the pages of the section fo Initialization can be performed multiple times in different locations. If needed, you can create multiple structures within a single project — such as one configuration for documentation and a completely different one for a blog. -This way, you can combine multiple documentations from different sources into one site. For more on loading from different sources, read the "[Data Source](../structure/data-source.md)" page. +This way, you can combine multiple documentations from different sources into one site. For more on loading from different sources, read the "[Data Source](../02-structure/03-data-source.md)" page. diff --git a/docs/01-getting-started/04-app-organization/README.md b/docs/01-getting-started/04-app-organization/README.md index d71f09d4..52a0c2da 100644 --- a/docs/01-getting-started/04-app-organization/README.md +++ b/docs/01-getting-started/04-app-organization/README.md @@ -2,14 +2,14 @@ Robindoc can be considered to consist of several parts: -- Documentation Structure ([more about documentation structure](../../structure/README.md)); -- Robindoc Initialization ([more about initialization](../initialization.md)); -- Page Markup and Configuration ([more about customization](../../customization/README.md)); -- Documentation Markdown Files ([more about writing MD](../writing-md.md)). +- Documentation Structure ([more about documentation structure](../../02-structure/README.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)). ## Organizing Documentation Files -One of the main advantages of Robindoc is that documentation files can reside in any source — whether they are files outside the current directory or a remote git repository (more about sources on the "[Data Source](../../structure/data-source.md)" page). +One of the main advantages of Robindoc is that documentation files can reside in any source — whether they are files outside the current directory or a remote git repository (more about sources on the "[Data Source](../../02-structure/03-data-source.md)" page). Robindoc’s main approach is that you don’t adjust the location of markdown files for Robindoc; instead, Robindoc builds the site from your markdown files. In other words, you place files so that they can be read in GitHub, and Robindoc serves as a convenient interface. @@ -17,9 +17,9 @@ However, when using the automatic mode for generating the structure, the documen ## Application Setup and Configuration -After initialization, you will receive Sidebar, Page, getPages, getMeta, and getPageContent. Read more on the [Initialization](../initialization.md) page. +After initialization, you will receive Sidebar, Page, getPages, getMeta, and getPageContent. Read more on the [Initialization](../03-initialization.md) page. -Global elements - [`RobinProvider`](../../customization/elements/robin-provider.md), [`Header`](../../customization/elements/header.md), [`Footer`](../../customization/elements/footer.md), and [`Main`](../../customization/elements/main.md) - should ideally be placed above all pages and reused across all. +Global elements - [`RobinProvider`](../../03-customization/01-elements/robin-provider.md), [`Header`](../../03-customization/01-elements/header.md), [`Footer`](../../03-customization/01-elements/footer.md), and [`Main`](../../03-customization/01-elements/main.md) - should ideally be placed above all pages and reused across all. ```tsx import { RobinProvider, Header, Footer, Main } from "robindoc"; @@ -36,7 +36,7 @@ export const Layout = ({ children }) => { }; ``` -[Sidebar](../../customization/elements/sidebar.md) and [Page](../../customization/elements/page.md) are used for each page. +[Sidebar](../../03-customization/01-elements/sidebar.md) and [Page](../../03-customization/01-elements/page.md) are used for each page. ```tsx import { Page, Sidebar } from "./robindoc"; diff --git a/docs/01-getting-started/04-app-organization/next-js.md b/docs/01-getting-started/04-app-organization/next-js.md index bf1ba238..92b0e73e 100644 --- a/docs/01-getting-started/04-app-organization/next-js.md +++ b/docs/01-getting-started/04-app-organization/next-js.md @@ -2,7 +2,7 @@ Currently, Robindoc works only with the App Router. Once RSC is available for the Pages Router, Robindoc will automatically support it as well. -You can initialize Robindoc on any subpath of your site, as long as you specify the [`basePath`](../../structure/configuration.md) in the project initialization and pass the correct path in the Robindoc components. +You can initialize Robindoc on any subpath of your site, as long as you specify the [`basePath`](../../02-structure/01-configuration.md) in the project initialization and pass the correct path in the Robindoc components. ## Page Setup @@ -23,7 +23,7 @@ export const Page: React.FC<{ params: { path?: string[] } }> = ({ params }) => { }; ``` -For more details about the props, refer to the [`Sidebar`](../../customization/elements/sidebar.md) and [`Page`](../../customization/elements/page.md) block pages. +For more details about the props, refer to the [`Sidebar`](../../03-customization/01-elements/sidebar.md) and [`Page`](../../03-customization/01-elements/page.md) block pages. You should also set up metadata generation and static parameters generation (if you want to use SSG, which is highly recommended): @@ -88,7 +88,7 @@ export const Layout = ({ children }) => { }; ``` -For more details on configuring elements, refer to the [`RobinProvider`](../../customization/elements/robin-provider.md), [`Header`](../../customization/elements/header.md), [`Footer`](../../customization/elements/footer.md), and [`Main`](../../customization/elements/main.md) block pages. +For more details on configuring elements, refer to the [`RobinProvider`](../../03-customization/01-elements/robin-provider.md), [`Header`](../../03-customization/01-elements/header.md), [`Footer`](../../03-customization/01-elements/footer.md), and [`Main`](../../03-customization/01-elements/main.md) block pages. ## Search Setup @@ -138,4 +138,4 @@ export const Layout = ({ children }) => { }; ``` -For more details on search configuration, refer to the [Search](../../customization/search.md) page. +For more details on search configuration, refer to the [Search](../../03-customization/03-search.md) page. diff --git a/docs/01-getting-started/README.md b/docs/01-getting-started/README.md index 261d4a22..faa43eb1 100644 --- a/docs/01-getting-started/README.md +++ b/docs/01-getting-started/README.md @@ -2,12 +2,12 @@ To start using Robindoc, follow these steps: -1. [Install Robindoc](./installation.md); +1. [Install Robindoc](./01-installation.md); -2. [Initialize Robindoc](./initialization.md); +2. [Initialize Robindoc](./03-initialization.md); -3. [Configure documentation pages for your framework](./app-organization/README.md) - - [Organizing an application with Next.js](./app-organization/next-js.md) +3. [Configure documentation pages for your framework](./04-app-organization/README.md) + - [Organizing an application with Next.js](./04-app-organization/next-js.md) ## Requirements diff --git a/docs/02-structure/01-configuration.md b/docs/02-structure/01-configuration.md index c5ec610e..aacbe517 100644 --- a/docs/02-structure/01-configuration.md +++ b/docs/02-structure/01-configuration.md @@ -1,10 +1,10 @@ # Configuration -`sourceRoot` - the root path for the documentation files. This can be either a relative path to a local directory or a git URL. Learn more about [Data Source](./data-source.md); +`sourceRoot` - the root path for the documentation files. This can be either a relative path to a local directory or a git URL. Learn more about [Data Source](./03-data-source.md); `basePath` - the path where the site will be available to users (for example, if the documentation is located at `robindoc.com/docs`, `basePath` will be `/docs`); -`gitToken` - a token with access to the git project. Required if you are loading documentation from a remote git repository. Learn more about [Data Source](./data-source.md); +`gitToken` - a token with access to the git project. Required if you are loading documentation from a remote git repository. Learn more about [Data Source](./03-data-source.md); `fetcher` - a method that will load data from remote sources. Can be useful if you want to set up custom caching; diff --git a/docs/02-structure/02-items.md b/docs/02-structure/02-items.md index 601208fc..5e59554a 100644 --- a/docs/02-structure/02-items.md +++ b/docs/02-structure/02-items.md @@ -28,19 +28,19 @@ export const { Page, Sidebar } = initializeRobindoc({ { title: "Structure", type: "heading", - href: "/structure", + href: "/02-structure", items: [ // ... { title: "Data Source", - href: "/structure/data-source", + href: "/02-structure/03-data-source", }, ], }, { title: "Elements", type: "heading", - href: "/elements", + href: "/01-elements", items: "auto", }, ], @@ -86,19 +86,19 @@ export const { Page, Sidebar } = initializeRobindoc({ { title: "Structure", type: "heading", - href: "/structure", + href: "/02-structure", items: [ // ... { title: "Data Source", - href: "/structure/data-source", + href: "/02-structure/03-data-source", }, ], }, { title: "Elements", type: "heading", - href: "/elements", + href: "/01-elements", items: "auto", }, ], @@ -107,13 +107,13 @@ export const { Page, Sidebar } = initializeRobindoc({ In automatic mode, Robindoc first looks for a `structure.json` file in the current directory. -If the `structure.json` file is not in the current directory, Robindoc will try to create the structure on its own based on the files in the directory. In this case, it will determine all paths, slugs, as well as the header for the sidebar link. The header is formed according to the same principles as the meta-header. Learn more about getting metadata on the [Get Meta](../customization/tools/get-meta.md) page. +If the `structure.json` file is not in the current directory, Robindoc will try to create the structure on its own based on the files in the directory. In this case, it will determine all paths, slugs, as well as the header for the sidebar link. The header is formed according to the same principles as the meta-header. Learn more about getting metadata on the [Get Meta](../03-customization/02-tools/get-meta.md) page. ## structure.json `structure.json` - a file with basic instructions for the current level of documentation. It is stored next to the markdown documentation files. -`/blog/structure.json` +`/blog/02-structure.json` ```json { diff --git a/docs/02-structure/03-data-source.md b/docs/02-structure/03-data-source.md index 609821cb..33064b3c 100644 --- a/docs/02-structure/03-data-source.md +++ b/docs/02-structure/03-data-source.md @@ -4,7 +4,7 @@ One of the main advantages of Robindoc is that data can be loaded not only from Currently, full support for the file system and GitHub is built-in. If you want another remote resource, you can create your own provider, but this is not recommended at the moment. Please, in such cases, create an issue in Robindoc. -By default, documentation is built from the current directory. To reconfigure Robindoc to another source, simply change the `sourceRoot` in the required branch of the structure ([learn more about structure configuration](./configuration.md)). +By default, documentation is built from the current directory. To reconfigure Robindoc to another source, simply change the `sourceRoot` in the required branch of the structure ([learn more about structure configuration](./01-configuration.md)). ```ts export const { Page, Sidebar } = initializeRobindoc(async () => ({ @@ -21,7 +21,7 @@ export const { Page, Sidebar } = initializeRobindoc(async () => ({ })); ``` -Just specify the path to the data source (relative path or Git repository URL) in your structure, and Robindoc will determine the source itself. The built-in solutions are fully configured to generate all necessary data - including [automatic structure generation](./items.md), [fetching all available pages](../customization/tools/README.md), and [generating the content itself](../getting-started/README.md). +Just specify the path to the data source (relative path or Git repository URL) in your structure, and Robindoc will determine the source itself. The built-in solutions are fully configured to generate all necessary data - including [automatic structure generation](./02-items.md), [fetching all available pages](../03-customization/02-tools/README.md), and [generating the content itself](../01-getting-started/README.md). In the case of a remote Git repository, you can specify URLs for individual branches or commits. For both public and private projects. For private ones, you need to additionally provide a `gitToken`. It is also recommended to provide a `gitToken` for public projects, as GitHub has very low limits for anonymous requests. diff --git a/docs/02-structure/README.md b/docs/02-structure/README.md index c625b7c3..3b764a83 100644 --- a/docs/02-structure/README.md +++ b/docs/02-structure/README.md @@ -1,6 +1,6 @@ # Structure -The structure is the core component of Robindoc. Here you can describe all possible documentation pages and configure the main information for them. Robindoc fully supports both automatic structure generation and custom methods for assembling it. For more details, read the [Items](./items.md) page. +The structure is the core component of Robindoc. Here you can describe all possible documentation pages and configure the main information for them. Robindoc fully supports both automatic structure generation and custom methods for assembling it. For more details, read the [Items](./02-items.md) page. ```ts import { initializeRobindoc } from "robindoc"; @@ -15,4 +15,4 @@ export const { Page, Sidebar } = initializeRobindoc({ }); ``` -In the end, the structure is a tree, each branch of which includes [configuration instructions](./configuration.md) for the current branch and its [items](./items.md). +In the end, the structure is a tree, each branch of which includes [configuration instructions](./01-configuration.md) for the current branch and its [items](./02-items.md). diff --git a/docs/03-customization/01-elements/README.md b/docs/03-customization/01-elements/README.md index c42b9ea2..5b41e80a 100644 --- a/docs/03-customization/01-elements/README.md +++ b/docs/03-customization/01-elements/README.md @@ -24,4 +24,4 @@ The documentation layout consists of several elements: `Layout`, `Main`, `Keylin `Page` and `Sidebar` are dynamic elements and should be added to each page. -The specific usage of the elements depends on the chosen framework. For more details on using these elements, refer to the section [App organization](../../getting-started/app-organization/README.md). +The specific usage of the elements depends on the chosen framework. For more details on using these elements, refer to the section [App organization](../../01-getting-started/04-app-organization/README.md). diff --git a/docs/03-customization/01-elements/footer.md b/docs/03-customization/01-elements/footer.md index 8a16677f..ab58c920 100644 --- a/docs/03-customization/01-elements/footer.md +++ b/docs/03-customization/01-elements/footer.md @@ -29,4 +29,4 @@ All customization in Robindoc happens through the structure and props of the com `Footer` is an independent component and doesn't rely on any specific page. It's assumed you can use it once across the entire project or section. -The specific usage of the component depends on the chosen framework. For more details on using `Footer`, refer to the section [App organization](../../getting-started/app-organization/README.md). +The specific usage of the component depends on the chosen framework. For more details on using `Footer`, refer to the section [App organization](../../01-getting-started/04-app-organization/README.md). diff --git a/docs/03-customization/01-elements/header.md b/docs/03-customization/01-elements/header.md index 846ca17c..9b8b7d02 100644 --- a/docs/03-customization/01-elements/header.md +++ b/docs/03-customization/01-elements/header.md @@ -27,7 +27,7 @@ All customization in Robindoc happens through the structure and props of the com `link` [`React.ElementType`] - the link component of the framework or router being used. If this component is not provided, the default `` tag will be used everywhere; -`searcher` - the route for search functionality or a client-side async callback. If this field is not provided, search functionality will not be available. Read more on the "[Search](../search.md)" page; +`searcher` - the route for search functionality or a client-side async callback. If this field is not provided, search functionality will not be available. Read more on the "[Search](../03-search.md)" page; `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_; @@ -39,4 +39,4 @@ All customization in Robindoc happens through the structure and props of the com `Header` is an independent component and doesn't rely on any specific page. It's assumed you can use it once across the entire project or section. -The specific usage of the component depends on the chosen framework. For more details on using `Header`, refer to the section [App organization](../../getting-started/app-organization/README.md). +The specific usage of the component depends on the chosen framework. For more details on using `Header`, refer to the section [App organization](../../01-getting-started/04-app-organization/README.md). diff --git a/docs/03-customization/01-elements/main.md b/docs/03-customization/01-elements/main.md index af8a8541..56112818 100644 --- a/docs/03-customization/01-elements/main.md +++ b/docs/03-customization/01-elements/main.md @@ -14,4 +14,4 @@ export const Main = ({ children }) => { `Main` is an independent component and doesn't rely on any specific page. It's assumed you can use it once across the entire project or section. -The specific usage of the component depends on the chosen framework. For more details on using `Main`, refer to the section [App organization](../../getting-started/app-organization/README.md). +The specific usage of the component depends on the chosen framework. For more details on using `Main`, refer to the section [App organization](../../01-getting-started/04-app-organization/README.md). diff --git a/docs/03-customization/01-elements/page.md b/docs/03-customization/01-elements/page.md index 079bb698..7ea9f151 100644 --- a/docs/03-customization/01-elements/page.md +++ b/docs/03-customization/01-elements/page.md @@ -34,7 +34,7 @@ All customization in Robindoc happens through the structure and props of the com `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](../../getting-started/writing-md.md); +`components` - an object of allowable JSX or Robin components. Read more on the page [Writing MD](../../01-getting-started/02-writing-md.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_. @@ -54,4 +54,4 @@ All customization in Robindoc happens through the structure and props of the com `Page` is rendered on every page and depends on the generated structure. -The specific usage of the component depends on the chosen framework. For more details on using `Page`, refer to the section [App organization](../../getting-started/app-organization/README.md). +The specific usage of the component depends on the chosen framework. For more details on using `Page`, refer to the section [App organization](../../01-getting-started/04-app-organization/README.md). diff --git a/docs/03-customization/01-elements/robin-provider.md b/docs/03-customization/01-elements/robin-provider.md index ad4493a8..7d2e1427 100644 --- a/docs/03-customization/01-elements/robin-provider.md +++ b/docs/03-customization/01-elements/robin-provider.md @@ -12,4 +12,4 @@ export const Layout = ({ children }) => { ## Usage -The specific usage of the element depends on the chosen framework. For more details on using `RobinProvider`, refer to the section [App organization](../../getting-started/app-organization/README.md). +The specific usage of the element depends on the chosen framework. For more details on using `RobinProvider`, refer to the section [App organization](../../01-getting-started/04-app-organization/README.md). diff --git a/docs/03-customization/01-elements/sidebar.md b/docs/03-customization/01-elements/sidebar.md index 92a008e0..0f900b8c 100644 --- a/docs/03-customization/01-elements/sidebar.md +++ b/docs/03-customization/01-elements/sidebar.md @@ -29,4 +29,4 @@ All customization in Robindoc happens through the structure and props of the com `Sidebar` is rendered on every page and depends on the generated structure. -The specific usage of the element depends on the chosen framework. For more details on using `Sidebar`, refer to the section [App organization](../../getting-started/app-organization/README.md). +The specific usage of the element depends on the chosen framework. For more details on using `Sidebar`, refer to the section [App organization](../../01-getting-started/04-app-organization/README.md). diff --git a/docs/03-customization/02-tools/README.md b/docs/03-customization/02-tools/README.md index ea6496ff..d3e4e988 100644 --- a/docs/03-customization/02-tools/README.md +++ b/docs/03-customization/02-tools/README.md @@ -2,7 +2,7 @@ When initializing Robindoc, in addition to the core elements, you will also receive special utilities. -These utilities work based on the structure and documentation files. They are needed to fine-tune page generation, and their specific usage will vary depending on the chosen framework. For more details on page configuration, refer to the [App Organization](../../getting-started/app-organization/README.md) page. +These utilities work based on the structure and documentation files. They are needed to fine-tune page generation, and their specific usage will vary depending on the chosen framework. For more details on page configuration, refer to the [App Organization](../../01-getting-started/04-app-organization/README.md) page. ```ts import { initializeRobindoc } from "robindoc"; diff --git a/docs/03-customization/02-tools/get-meta.md b/docs/03-customization/02-tools/get-meta.md index 947a3b10..8b704891 100644 --- a/docs/03-customization/02-tools/get-meta.md +++ b/docs/03-customization/02-tools/get-meta.md @@ -17,9 +17,9 @@ If you do not provide a front-matter title, the first-level heading of the page ## Usage -`getMeta` is obtained as a result of [initializing Robindoc](../../getting-started/initialization.md). +`getMeta` is obtained as a result of [initializing Robindoc](../../01-getting-started/03-initialization.md). -The specific usage depends on the chosen framework and needs. For more details on using the utility in your application, refer to the section [App Organization](../../getting-started/app-organization/README.md). +The specific usage depends on the chosen framework and needs. For more details on using the utility in your application, refer to the section [App Organization](../../01-getting-started/04-app-organization/README.md). You can get the metadata object for a specific page using the following method: @@ -34,4 +34,4 @@ export const getPageMetadata = async (pathname: string) => { ## Arguments -`pathname` - the full path of the current page (e.g., `/docs/tools/get-meta`) must be provided to obtain the metadata. +`pathname` - the full path of the current page (e.g., `/docs/02-tools/get-meta`) must be provided to obtain the metadata. diff --git a/docs/03-customization/02-tools/get-page-content.md b/docs/03-customization/02-tools/get-page-content.md index 4f420274..c2dc2dcd 100644 --- a/docs/03-customization/02-tools/get-page-content.md +++ b/docs/03-customization/02-tools/get-page-content.md @@ -4,9 +4,9 @@ ## Usage -`getPageContent` is obtained as a result of [initializing Robindoc](../../getting-started/initialization.md). +`getPageContent` is obtained as a result of [initializing Robindoc](../../01-getting-started/03-initialization.md). -It can be used, for example, for search functionality. For more details on general search configuration, refer to the [Search](../search.md) page. For framework-specific setup, refer to the [App Organization](../../getting-started/app-organization/README.md) page. +It can be used, for example, for search functionality. For more details on general search configuration, refer to the [Search](../03-search.md) page. For framework-specific setup, refer to the [App Organization](../../01-getting-started/04-app-organization/README.md) page. ```ts const searchResults = []; diff --git a/docs/03-customization/02-tools/get-pages.md b/docs/03-customization/02-tools/get-pages.md index 0a76f502..e18cad40 100644 --- a/docs/03-customization/02-tools/get-pages.md +++ b/docs/03-customization/02-tools/get-pages.md @@ -4,9 +4,9 @@ ## Usage -`getPages` is obtained as a result of [initializing Robindoc](../../getting-started/initialization.md). +`getPages` is obtained as a result of [initializing Robindoc](../../01-getting-started/03-initialization.md). -The specific usage depends on the chosen framework and needs. For more details on using the utility in your application, refer to the [App Organization](../../getting-started/app-organization/README.md) page. +The specific usage depends on the chosen framework and needs. For more details on using the utility in your application, refer to the [App Organization](../../01-getting-started/04-app-organization/README.md) page. You can obtain an array of objects with the list of segments for each page using the following method: diff --git a/docs/03-customization/03-search.md b/docs/03-customization/03-search.md index 1e74cc79..c7343dc1 100644 --- a/docs/03-customization/03-search.md +++ b/docs/03-customization/03-search.md @@ -4,10 +4,10 @@ You can configure search in two ways: by providing the path to the search API ro ## API Route -To use an API route for search, pass the path to the search endpoint in the `searcher` prop of the [`Header`](./elements/header.md) component. The search API should return an array of results with the following keys: +To use an API route for search, pass the path to the search endpoint in the `searcher` prop of the [`Header`](./01-elements/header.md) component. The search API should return an array of results with the following keys: - `title` - the title of the page (e.g., `Introduction`, `Search`); -- `href` - the link to the page (e.g., `/docs/introduction`, `/docs/search`); +- `href` - the link to the page (e.g., `/docs/introduction`, `/docs/03-search`); - `description` - an optional additional field with search results related to the page content. Here’s an example of how to configure the `Header` component with a search API route: @@ -77,4 +77,4 @@ export const GET = async (request: Request) => { }; ``` -For more information about configuring search, refer to the page on [App Organization](../getting-started/app-organization/README.md). +For more information about configuring search, refer to the page on [App Organization](../01-getting-started/04-app-organization/README.md). diff --git a/docs/03-customization/README.md b/docs/03-customization/README.md index 8411a2bf..bf2328d4 100644 --- a/docs/03-customization/README.md +++ b/docs/03-customization/README.md @@ -1,6 +1,6 @@ # Customization -Page layout consists of [special blocks](./elements/README.md). For additional customization, you may use [special utilities](./tools/README.md). +Page layout consists of [special blocks](./01-elements/README.md). For additional customization, you may use [special utilities](./02-tools/README.md). All styles are collected separately and are included once for the entire application from `robindoc/lib/styles.css`: @@ -23,10 +23,10 @@ export const Documentation = () => { }; ``` -Framework-based logic configuration - link component, search API route, and the current page path - is up to you. For more details, read the [App Organization](../getting-started/app-organization/README.md) page. +Framework-based logic configuration - link component, search API route, and the current page path - is up to you. For more details, read the [App Organization](../01-getting-started/04-app-organization/README.md) page. Robindoc works entirely on React.js (and only on it). The choice of framework (next.js/remix/react router, etc.) is entirely up to you. At the same time, Robindoc does not require any modifications to the bundler. The framework is fully built on the capabilities of RSC, allowing you to build documentation as a static site or generate pages dynamically. As a result, Robindoc does not affect other pages of the service. Essentially, these are just regular components that build large blocks based on markdown files and instructions. Conversely, you can easily integrate Robindoc into any site that supports RSC. -Despite the bundler-free generation, Robindoc supports markup (both through jsx/html inside md/mdx files and through special Robin components). For more details, read the [Writing MD](../getting-started/writing-md.md) page. +Despite the bundler-free generation, Robindoc supports markup (both through jsx/html inside md/mdx files and through special Robin components). For more details, read the [Writing MD](../01-getting-started/02-writing-md.md) page. diff --git a/site/src/app/docs/[[...path]]/page.tsx b/site/src/app/docs/[[...path]]/page.tsx index 7d4e1b58..e4236293 100644 --- a/site/src/app/docs/[[...path]]/page.tsx +++ b/site/src/app/docs/[[...path]]/page.tsx @@ -33,6 +33,6 @@ export const generateMetadata = async ({params}: {params: {path?: string[]}}) => }; export const generateStaticParams = async () => { - const pages = await getPages('/docs/'); + const pages = await getPages('/docs'); return pages.map(page => ({ path: page.split('/').slice(2) })); } diff --git a/site/src/app/docs/[[...path]]/robindoc.ts b/site/src/app/docs/[[...path]]/robindoc.ts index 0f79bfae..24076a2c 100644 --- a/site/src/app/docs/[[...path]]/robindoc.ts +++ b/site/src/app/docs/[[...path]]/robindoc.ts @@ -13,7 +13,7 @@ export const { Page, Sidebar, getPages, getMeta, getPageContent, getPageData } = type: 'heading', href: '/', configuration: { - sourceRoot: '..', + sourceRoot: 'https://github.com/vordgi/robindoc/tree/main/README.md', } }, "auto-spreaded"