Skip to content

Commit

Permalink
docs(mdbook): initialize documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
QaidVoid committed Nov 3, 2024
1 parent 3cef007 commit 6fa129b
Show file tree
Hide file tree
Showing 29 changed files with 749 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A fast, modern package manager for Linux systems.

[![Under Development](https://img.shields.io/badge/status-under%20development-orange)](https://github.com/QaidVoid/soar)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

[![Documentation](https://img.shields.io/badge/docs-soar.qaidvoid.dev-blue)](https://soar.qaidvoid.dev)

> **Note**: Soar is currently under rapid development.
Expand Down
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
book
11 changes: 11 additions & 0 deletions docs/book.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[book]
authors = ["Rabindra Dhakal"]
language = "en"
multilingual = false
src = "src"
title = "soar documentation"

[output.html]
default-theme = "ayu"
preferred-dark-theme = "ayu"
git-repository-url = "https://github.com/QaidVoid/soar"
16 changes: 16 additions & 0 deletions docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Summary

- [Introduction](./introduction.md)
- [Installation](./installation.md)
- [Configuration](./configuration.md)
- [Package Management](./package-management.md)
- [Install Packages](./install.md)
- [Remove Packages](./remove.md)
- [Update Packages](./update.md)
- [Search Packages](./search.md)
- [List Packages](./list.md)
- [Use Package](./use.md)
- [Run Package](./run.md)
- [Miscellaneous](./misc.md)
- [Download Files](./download.md)
- [Health Check](./health.md)
89 changes: 89 additions & 0 deletions docs/src/configuration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Configuration

Soar offers flexible configuration options to customize its behavior according to your needs. This section explains how to configure Soar and details all available configuration options.

## Configuration File

Soar uses a configuration file located at `~/.config/soar/config.json`. If this file doesn't exist, Soar will create one with default settings on first run.



## Configuration Options

### Global Settings

| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `soar_path` | String | `~/.soar` | Directory where Soar stores package data |
| `parallel` | Boolean | `true` | Enable/disable parallel downloads |
| `parallel_limit` | Integer | `2` | Maximum number of concurrent downloads |

### Repository Configuration

Each repository in the `repositories` array can be configured with the following options:

| Option | Type | Description |
|--------|------|-------------|
| `name` | String | Repository identifier |
| `url` | String | Base URL of the repository |
| `metadata` | String (Optional) | Custom metadata file name |
| `sources` | Object | Collection-specific download sources (used to fetch default icons) |

## Example Configurations

### Basic Configuration

```json
{
"soar_path": "/path/to/soar/data",
"parallel": true,
"parallel_limit": 4,
"repositories": [
{
"name": "main",
"url": "https://example.com/repo",
"metadata": "metadata.json",
"sources": {
"bin": "https://example.com/repo/bin",
"base": "https://example.com/repo/base",
"pkg": "https://example.com/repo/pkg"
}
}
]
}
```

<div class="warning">
<strong>Note:</strong> Changes to the configuration file take effect immediately for new operations.
</div>

## Validation

Soar automatically validates your configuration file when loading it. If there are any issues, it will display helpful error messages indicating what needs to be corrected.

Common validation checks include:
- Valid URLs for repositories
- Unique repository names
- Valid parallel_limit values (must be positive)
- Accessible soar_path directory

## Troubleshooting

### Common Configuration Issues

1. **Invalid JSON Syntax**
- Missing or extra commas
- Unclosed brackets or braces
- Missing quotation marks around strings

2. **Invalid Repository URL**
- Ensure URLs are properly formatted and accessible
- Check for trailing slashes in URLs

3. **Permission Issues**
- Verify write permissions for soar_path
- Check file permissions for the config file

4. **Duplicate Repository Names**
- Ensure each repository has a unique name
- Check for case-sensitive duplicates
35 changes: 35 additions & 0 deletions docs/src/download.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Download Files

Soar provides the ability to download arbitrary files from the internet.

<div class="video-wrapper">
<video src="/video/download.mp4" controls></video>
</div>

## Basic Usage

To download a file, use the `download` command or the `dl:` alias:

```sh
soar download <url>
```

Example: Download Soar nightly
```sh
soar download https://github.com/QaidVoid/soar/releases/download/nightly/soar-nightly-x86_64-linux
```

To set the output filename, use the `-o` flag:

```sh
soar download https://github.com/QaidVoid/soar/releases/download/nightly/soar-nightly-x86_64-linux -o soar-nightly
```

Example: Download multiple files and save them to the `downloads` directory
```sh
soar download https://github.com/QaidVoid/soar/releases/download/nightly/soar-nightly-x86_64-linux https://github.com/QaidVoid/soar/releases/download/nightly/soar-nightly-aarch64-linux -o downloads/
```

<div class="warning">
It currently doesn't support multiple custom output filenames. So if you specify an output filename, it will be used for all downloads, meaning only the last download will be saved if you specify multiple URLs.
</div>
11 changes: 11 additions & 0 deletions docs/src/health.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Health Check

Soar provides a health check system to verify the integrity of your package installations and system configuration. This helps identify and resolve potential issues before they become problems. The health checks are performed to ensure that AppImages and other self-contained executables can function properly on the system. These checks are critical for applications that rely on user namespaces and FUSE (Filesystem in Userspace) to operate in a confined environment without requiring root privileges.

## Basic Usage

To run a health check:

```sh
soar health
```
96 changes: 96 additions & 0 deletions docs/src/install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Installing Packages

Soar provides several flexible ways to install packages. This guide covers all installation methods and options.

<div class="video-wrapper">
<video src="/video/install.mp4" controls></video>
</div>

## Basic Installation

To install a package, use either the `install` command or its aliases:

```sh
# Using install command
soar install <package>

# Using shorter alias
soar i <package>

# Using add alias
soar add <package>
```

Example: Install the `soar` package
```sh
soar install soar
```

### Installing from Specific Families

Packages can be organized into families (like categories). To install a package from a specific family:

```sh
soar install <family>/<package>
```

Example: Install the `cat` package from the `busybox` family
```sh
soar install busybox/cat
```

### Installing from Specific Collections

Packages can also be organized into collections. To install a package from a specific collection:

```sh
soar install <package>#<collection>
```

Example: Install the `7z` package from the `bin` collection
```sh
soar install 7z#bin
```

### Installing Multiple Packages

To install multiple packages, list them after the command:

```sh
soar install <package1> <package2> <package3>
```

Example: Install the `bat` and `7z` packages
```sh
soar install bat 7z
```

### Force Installation

To force installation even if the package already exists, use the `--force` flag:

```sh
soar install <package> --force
```

Example: Install the `bat` package even if it already exists
```sh
soar install bat --force
```

### Non-Interactive Installation

By default, Soar prompts for confirmation before installing packages if multiple packages are found. To skip this prompt, use the `--yes` flag:

```sh
soar install <package> --yes
```

Example: Install the `cat` package without confirmation
```sh
soar install cat --yes
```

<div class="warning">
<strong>Note:</strong> The `--yes` flag is useful for non-interactive installations, but it's generally recommended to use it with caution. It will install the first package if multiple packages are found.
</div>
79 changes: 79 additions & 0 deletions docs/src/installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Installation

There are several ways to install Soar on your Linux system. Choose the method that best suits your needs.

<div class="video-wrapper">
<video src="/video/installation.mp4" controls></video>
</div>

## Quick Installation

The fastest way to install Soar is using our installation script:

```sh
curl -fsSL https://soar.qaidvoid.dev/install.sh | sh
```

Or if you prefer using wget:

```sh
wget -qO- https://soar.qaidvoid.dev/install.sh | sh
```


## Manual Installation

### From Binary Releases

1. Visit the [releases page](https://github.com/QaidVoid/soar/releases)
2. Download the appropriate binary for your architecture:
- `soar-x86_64-linux` for 64-bit Intel/AMD systems
- `soar-aarch64-linux` for 64-bit ARM systems

3. Make the binary executable:
```sh
chmod +x soar
```

4. Move the binary to your desired location, for example `/usr/local/bin`:
```sh
sudo mv soar /usr/local/bin/soar
```

5. Verify the installation by running `soar --version`:
```sh
soar --version
```
This should output the version number of the installed Soar binary.

## From Source

To install Soar from source, you need to have Rust and Cargo installed. Follow these steps:

1. Clone the Soar repository:
```sh
git clone https://github.com/QaidVoid/soar.git
```

2. Navigate to the Soar directory:
```sh
cd soar
```

3. Build and install the project:
```sh
cargo install --path .
```

4. Verify the installation by running `soar --version`:
```sh
soar --version
```
This should output the version number of the installed Soar binary.

## Next Steps

After installing Soar, you might want to:
1. [Configure Soar](./configuration.md) for your specific needs
2. Learn about [package management](./package-management.md)
3. Try [installing your first package](./install.md)
Loading

0 comments on commit 6fa129b

Please sign in to comment.