> For the complete documentation index, see [llms.txt](https://docs.bonsol.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bonsol.org/contributing/contributing-to-docs.md).

# Contributing to Documentation

This guide explains how to contribute to the Bonsol documentation through GitHub. All our documentation is stored in the `gitbook/` directory of our repository and synchronized with GitBook.

## Understanding the Documentation Structure

Our documentation follows this structure:

* `gitbook/README.md` - The main landing page of the documentation
* `gitbook/SUMMARY.md` - Defines the structure and navigation of the documentation
* `gitbook/core-concepts/` - Conceptual information about Bonsol
* `gitbook/getting-started/` - Guides for new users
* `gitbook/developers/` - Resources for developers
* `gitbook/provers/` - Information for provers
* `gitbook/contributing/` - Guidelines for contributors (including this document)

## How to Add or Update Documentation

### 1. Fork and Clone the Repository

1. Fork the Bonsol repository on GitHub
2. Clone your fork locally:

   ```bash
   git clone https://github.com/YOUR-USERNAME/bonsol.git
   cd bonsol
   ```

### 2. Create a New Branch

Create a new branch for your documentation changes:

```bash
git checkout -b docs/your-documentation-change
```

Use a descriptive name that indicates what you're documenting.

### 3. Making Documentation Changes

#### Adding a New Page

1. Create your new markdown file in the appropriate subdirectory in `gitbook/`
2. Add a reference to your new file in `gitbook/SUMMARY.md` to make it appear in the navigation

Example SUMMARY.md addition:

```markdown
## Getting Started

* [Installation](getting-started/installation.md)
* [Quickstart](getting-started/quickstart.md)
* [Your New Page](getting-started/your-new-page.md)
```

#### Updating Existing Content

Simply edit the relevant markdown files in the `gitbook/` directory.

#### Markdown Guidelines

* Use clear headings with proper hierarchy (# for title, ## for sections, etc.)
* Add code examples with proper syntax highlighting:

  ````markdown
  ```rust
  fn main() {
      println!("Hello, Bonsol!");
  }
  ```
  ````
* Use relative links when referencing other documentation pages
* Include screenshots or diagrams when they help explain concepts
* Follow our style guide for consistent documentation

### 4. Preview Your Changes

You can also use standard Markdown previewers to check your content.

### 5. Create a Pull Request

1. Commit your changes:

   ```bash
   git add gitbook/
   git commit -m "docs: add documentation for X feature"
   ```

   Follow our [commit message guidelines](/contributing/contributor-guidelines.md#commit-message-guidelines) with the type "docs".
2. Push to your fork:

   ```bash
   git push origin docs/your-documentation-change
   ```
3. Create a pull request on GitHub
   * Reference any related issues
   * Provide a clear description of what documentation you've added or updated
   * Request review from relevant team members

## Documentation Style Guide

To maintain consistent documentation:

* Use present tense and active voice
* Be concise but thorough
* Include examples where appropriate
* Use sentence case for headings
* Link to relevant documentation sections
* Keep paragraphs short and focused

## GitBook Specific Features

Our documentation takes advantage of several GitBook features:

### Page Icons

You can add an icon to your page by including this at the top of your markdown file:

```markdown
---
icon: name-of-icon
---
```

### Internal Page References

To reference another page in the documentation:

```markdown
[Title of Page](../path/to/page.md "mention")
```

## Questions?

If you have any questions about contributing to documentation, please open an issue on GitHub or contact the team through our community channels.

Thank you for helping improve Bonsol's documentation!


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.bonsol.org/contributing/contributing-to-docs.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
