Skip to content

Commit 573239c

Browse files
committed
Docs: Add complete bilingual demo documentation content (EN/FR)
1 parent 60894b5 commit 573239c

File tree

14 files changed

+340
-4
lines changed

14 files changed

+340
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/vendor
22
/site
3+
/assets
34
.idea
45
.vscode
56
litedocs.phar

config/nav.yaml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,17 @@
11
en:
2-
- Home: index.md
2+
- Introduction: index.md
3+
- Getting Started:
4+
- Installation: guide/installation.md
5+
- Configuration: guide/configuration.md
6+
- Plugins: guide/plugins.md
7+
- Advanced:
8+
- Custom Theme: advanced/theming.md
9+
10+
fr:
11+
- Introduction: index.md
12+
- Commencer:
13+
- Installation: guide/installation.md
14+
- Configuration: guide/configuration.md
15+
- Plugins: guide/plugins.md
16+
- Avancé:
17+
- Thèmes: advanced/theming.md

config/plugins.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1+
# Displays reading time
12
LiteDocs\Plugin\ReadingTimePlugin: ~
23

4+
# Automatic Table of Contents
35
LiteDocs\Plugin\TableOfContentsPlugin: ~
46

7+
# Syntax highlighting
58
LiteDocs\Plugin\SyntaxHighlightPlugin: ~
69

10+
# JS Search Engine
711
LiteDocs\Plugin\SearchPlugin: ~

docs/en/advanced/theming.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Theming
2+
3+
LiteDocs uses **Twig** as a templating engine. You can easily customize the look and feel.
4+
5+
## Creating a Theme
6+
7+
1. Create a folder in `themes/` (e.g., `themes/my-theme`).
8+
2. Create a `base.html.twig` file inside.
9+
3. Create an `assets/` folder for your CSS and JS.
10+
11+
## Available Variables
12+
13+
In your Twig templates, you have access to:
14+
15+
* `content`: The HTML content of the page.
16+
* `nav`: The navigation tree.
17+
* `page_title`: The current page title.
18+
* `config`: The full configuration array.
19+
* `trans`: Translations (based on current language).
20+
21+
## Overriding Translations
22+
23+
You can override any text by creating a `translations/en.yaml` file at the root of your project:
24+
25+
```yaml
26+
core:
27+
ui:
28+
navigation: "Main Menu"
29+
```

docs/en/guide/configuration.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Configuration
2+
3+
LiteDocs uses a single YAML file named `litedocs.yml` at the root of your project.
4+
5+
## Basic Structure
6+
7+
Here is a complete example of a configuration file:
8+
9+
```yaml
10+
site_name: "My Documentation"
11+
site_url: "[https://example.com](https://example.com)"
12+
13+
# Directories
14+
docs_dir: "docs"
15+
site_dir: "site"
16+
17+
# Branding
18+
logo: "assets/logo.png"
19+
favicon: "assets/favicon.ico"
20+
21+
# Theme
22+
theme:
23+
name: lite
24+
25+
# Imports (Recommended for large projects)
26+
nav: "config/nav.yml"
27+
plugins: "config/plugins.yml"
28+
```
29+
30+
## Navigation Configuration
31+
32+
You can separate your navigation logic into `config/nav.yml`:
33+
34+
35+
```yaml
36+
en:
37+
- Home: index.md
38+
- Guide:
39+
- Setup: guide/installation.md
40+
```

docs/en/guide/installation.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Installation
2+
3+
## Requirements
4+
5+
Before using LiteDocs, ensure your environment meets these requirements:
6+
7+
* **PHP:** 8.4 or higher
8+
* **Composer:** installed globally (optional if using PHAR)
9+
* **Extensions:** `php-xml`, `php-mbstring`
10+
11+
## Option 1: Using the PHAR (Recommended)
12+
13+
You can download the standalone executable directly. This is the easiest way to get started.
14+
15+
```bash
16+
# Download the latest release
17+
wget [https://github.com/ezar101/litedocs/releases/latest/download/litedocs.phar](https://github.com/ezar101/litedocs/releases/latest/download/litedocs.phar)
18+
19+
# Make it executable
20+
chmod +x litedocs.phar
21+
22+
# Move to bin (optional)
23+
sudo mv litedocs.phar /usr/local/bin/litedocs
24+
```
25+
## Option 2: Using Composer
26+
27+
You can also install it as a global dependency:
28+
29+
```bash
30+
composer global require ezar101/litedocs
31+
```

docs/en/guide/plugins.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Plugins System
2+
3+
LiteDocs comes with a robust plugin system based on Symfony EventDispatcher.
4+
5+
## Built-in Plugins
6+
7+
We include several powerful plugins out of the box:
8+
9+
| Plugin Name | Description |
10+
| :--- | :--- |
11+
| **SearchPlugin** | Adds a client-side search engine (JS). |
12+
| **ReadingTimePlugin** | Displays estimated reading time. |
13+
| **TableOfContentsPlugin** | Generates a table of contents on the right side. |
14+
| **SyntaxHighlightPlugin** | Adds colors to your code blocks using Highlight.js. |
15+
16+
## Activation
17+
18+
To activate a plugin, add it to your `config/plugins.yml` file:
19+
20+
```yaml
21+
LiteDocs\Plugin\ReadingTimePlugin: ~
22+
23+
LiteDocs\Plugin\SyntaxHighlightPlugin:
24+
custom_script: "my-custom-js.js"
25+
```

docs/en/index.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,33 @@
11
# Welcome to LiteDocs
22

3-
This is a static site generator made in **PHP**.
3+
**LiteDocs** is a lightweight, modern static site generator written in PHP. It is designed to be fast, extensible, and easy to use for technical documentation.
4+
5+
## Why LiteDocs?
6+
7+
* **⚡ Fast:** Generates static HTML files in seconds.
8+
* **🔌 Extensible:** Plugin system to add features easily.
9+
* **🎨 Theming:** Modern default theme (Sylius/GitBook style).
10+
* **🌍 Multilingual:** Native support for multiple languages.
11+
* **🔍 Search:** Built-in client-side search engine.
12+
13+
## Quick Start
14+
15+
Run the following command to build your documentation:
16+
17+
```bash
18+
php bin/litedocs build
19+
```
20+
21+
## Quick Example
22+
23+
Here is how you initialize the kernel in PHP:
24+
25+
```php
26+
use LiteDocs\Core\Kernel;
27+
28+
$kernel = new Kernel(__DIR__);
29+
$kernel->boot();
30+
$kernel->build();
31+
32+
<div data-search-ignore style="background: #e0f7fa; color: #006064; padding: 15px; border-radius: 4px; margin-top: 20px;"> <strong>Tip:</strong> This block uses the <code>data-search-ignore</code> attribute. It will be visible to the user but ignored by the search bar indexer. </div>
33+
```

docs/fr/advanced/theming.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Thèmes
2+
3+
LiteDocs utilise **Twig** comme moteur de template. Vous pouvez facilement personnaliser l'apparence.
4+
5+
## Créer un Thème
6+
7+
1. Créez un dossier dans `themes/` (ex: `themes/mon-theme`).
8+
2. Créez un fichier `base.html.twig` à l'intérieur.
9+
3. Créez un dossier `assets/` pour vos CSS et JS.
10+
11+
## Variables Disponibles
12+
13+
Dans vos templates Twig, vous avez accès à :
14+
15+
* `content` : Le contenu HTML de la page.
16+
* `nav` : L'arbre de navigation.
17+
* `page_title` : Le titre de la page courante.
18+
* `config` : Le tableau complet de configuration.
19+
* `trans` : Les traductions (basées sur la langue actuelle).
20+
21+
## Surcharger les Traductions
22+
23+
Vous pouvez surcharger n'importe quel texte en créant un fichier `translations/fr.yaml` à la racine de votre projet :
24+
25+
```yaml
26+
core:
27+
ui:
28+
navigation: "Menu Principal"
29+
```

docs/fr/guide/configuration.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Configuration
2+
3+
LiteDocs utilise un seul fichier YAML nommé `litedocs.yml` à la racine de votre projet.
4+
5+
## Structure de Base
6+
7+
Voici un exemple complet de fichier de configuration :
8+
9+
```yaml
10+
site_name: "Ma Documentation"
11+
site_url: "[https://exemple.com](https://exemple.com)"
12+
13+
# Dossiers
14+
docs_dir: "docs"
15+
site_dir: "site"
16+
17+
# Branding
18+
logo: "assets/logo.png"
19+
favicon: "assets/favicon.ico"
20+
21+
# Thème
22+
theme:
23+
name: lite
24+
25+
# Imports (Recommandé pour les gros projets)
26+
nav: "config/nav.yml"
27+
plugins: "config/plugins.yml"
28+
```
29+
30+
## Configuration de la Navigation
31+
32+
Vous pouvez séparer votre logique de navigation dans `config/nav.yml`:
33+
34+
35+
```yaml
36+
fr:
37+
- Accueil: index.md
38+
- Guide:
39+
- Installation: guide/installation.md
40+
```

0 commit comments

Comments
 (0)