Skip to content

Commit

Permalink
Merge pull request #243 from vordgi/rd-242
Browse files Browse the repository at this point in the history
rd-242 update links in documentation
  • Loading branch information
vordgi authored Oct 1, 2024
2 parents 5b07cb3 + 29769d6 commit b654f18
Show file tree
Hide file tree
Showing 25 changed files with 65 additions and 65 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/01-getting-started/01-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:**

Expand Down
8 changes: 4 additions & 4 deletions docs/01-getting-started/03-initialization.md
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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

Expand All @@ -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.
16 changes: 8 additions & 8 deletions docs/01-getting-started/04-app-organization/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@

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.

However, when using the automatic mode for generating the structure, the documentation file structure should match the desired structure on the site. In manual mode, you can organize the documentation files as you wish, but it is still recommended to reflect the site’s structure.

## 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";
Expand All @@ -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";
Expand Down
8 changes: 4 additions & 4 deletions docs/01-getting-started/04-app-organization/next-js.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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):

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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.
8 changes: 4 additions & 4 deletions docs/01-getting-started/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions docs/02-structure/01-configuration.md
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
16 changes: 8 additions & 8 deletions docs/02-structure/02-items.md
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
],
Expand Down Expand Up @@ -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",
},
],
Expand All @@ -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
{
Expand Down
4 changes: 2 additions & 2 deletions docs/02-structure/03-data-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => ({
Expand All @@ -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.

Expand Down
4 changes: 2 additions & 2 deletions docs/02-structure/README.md
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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).
2 changes: 1 addition & 1 deletion docs/03-customization/01-elements/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
2 changes: 1 addition & 1 deletion docs/03-customization/01-elements/footer.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Loading

0 comments on commit b654f18

Please sign in to comment.