mirror of
https://github.com/litruv/Docs-Viewer.git
synced 2026-07-24 02:36:07 +10:00
updated readme
This commit is contained in:
64
README.md
64
README.md
@@ -44,37 +44,52 @@ npx live-server
|
|||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
### Document Index
|
Configure your documentation site with a top-level index file named `index.json`. At minimum, include a `title`, a `defaultPage`, and a list of `documents`:
|
||||||
|
|
||||||
Configure your documentation structure in `index.json`:
|
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"title": "Your Documentation Title",
|
"title": "My Documentation Site",
|
||||||
"defaultPage": "welcome",
|
"defaultPage": "welcome",
|
||||||
"documents": [
|
"documents": [
|
||||||
{
|
{
|
||||||
"title": "Getting Started",
|
"title": "Welcome",
|
||||||
"path": "docs/getting-started.md"
|
"path": "docs/welcome.md",
|
||||||
|
"slug": "welcome"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Root Configuration Options
|
> If you want to quickly get started, copy `example.index.json` to `index.json` in the project root of your own repository:
|
||||||
|
|
||||||
| Option | Type | Description |
|
```sh
|
||||||
|--------|------|-------------|
|
cp example.index.json index.json
|
||||||
| `title` | string | The title of your documentation site |
|
```
|
||||||
| `defaultPage` | string | The slug of the page to show when no page is specified |
|
|
||||||
| `documents` | array | Array of document and folder objects |
|
Then adjust the `title`, `defaultPage`, and `documents` array to match your needs.
|
||||||
|
|
||||||
|
After placing your `index.json` in the project root, the application will:
|
||||||
|
|
||||||
|
1. Apply your site `title` to the browser tab and page header.
|
||||||
|
2. Load the `defaultPage` when no slug is specified in the URL.
|
||||||
|
3. Generate a navigation tree from the array of `documents`.
|
||||||
|
|
||||||
|
### Root Configuration Options
|
||||||
|
|
||||||
|
| Option | Type | Description |
|
||||||
|
|---------------|--------|----------------------------------------------------------|
|
||||||
|
| `title` | string | Title of your documentation site |
|
||||||
|
| `defaultPage` | string | Slug of the page to show when no page is specified |
|
||||||
|
| `documents` | array | Array of document or folder entries (see below) |
|
||||||
|
|
||||||
### Folder Organization
|
### Folder Organization
|
||||||
|
|
||||||
Create hierarchical documentation structures with nested folders:
|
Folders can contain nested documents or subfolders. Mark a folder by setting `"type": "folder"`. Example:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
|
"title": "My Documentation Site",
|
||||||
|
"defaultPage": "welcome",
|
||||||
"documents": [
|
"documents": [
|
||||||
{
|
{
|
||||||
"title": "Core Concepts",
|
"title": "Core Concepts",
|
||||||
@@ -85,8 +100,9 @@ Create hierarchical documentation structures with nested folders:
|
|||||||
"slug": "core-concepts",
|
"slug": "core-concepts",
|
||||||
"items": [
|
"items": [
|
||||||
{
|
{
|
||||||
"title": "Architecture",
|
"title": "Getting Started",
|
||||||
"path": "docs/core-concepts/architecture.md"
|
"path": "docs/guides/getting-started.md",
|
||||||
|
"slug": "getting-started"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -96,15 +112,15 @@ Create hierarchical documentation structures with nested folders:
|
|||||||
|
|
||||||
#### Folder Configuration Options
|
#### Folder Configuration Options
|
||||||
|
|
||||||
| Option | Type | Description |
|
| Option | Type | Description |
|
||||||
|--------|------|-------------|
|
|-----------------|----------|----------------------------------------------------|
|
||||||
| `type` | string | Set to `"folder"` for directory nodes |
|
| `type` | string | Set to `"folder"` for a directory node |
|
||||||
| `title` | string | Display name |
|
| `title` | string | Display name of the folder |
|
||||||
| `path` | string? | Optional content file path |
|
| `path` | string? | Optional content file path |
|
||||||
| `slug` | string | URL-friendly identifier (required with `path`) |
|
| `slug` | string | URL-friendly identifier; required if `path` exists|
|
||||||
| `items` | array | Nested documents or folders |
|
| `items` | array | Nested documents or folders |
|
||||||
| `defaultOpen` | boolean? | Auto-expand folder |
|
| `defaultOpen` | boolean? | Automatically expand this folder in the sidebar |
|
||||||
| `icon` | string? | Custom Font Awesome class |
|
| `icon` | string? | Custom Font Awesome classes |
|
||||||
|
|
||||||
## Technology Stack
|
## Technology Stack
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user