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

# Publishing to GitBook

This repository ships a GitBook-ready documentation site under `docs/`. GitBook syncs from GitHub and renders the table of contents from `SUMMARY.md`.

## Repository layout

| File              | Role                                                |
| ----------------- | --------------------------------------------------- |
| `.gitbook.yaml`   | GitBook root = `./docs/`, readme + summary pointers |
| `docs/README.md`  | Home / introduction page                            |
| `docs/SUMMARY.md` | Table of contents (navigation sidebar)              |
| `docs/**/*.md`    | All documentation pages                             |

## Connect GitBook to GitHub (Git Sync)

GitHub is **not** listed under **Integrations** (OIDC, Reflag, etc.). Repo sync is **Git Sync**, configured from the **space** itself.

### Requirements

* Your GitBook role must be **Admin** or **Creator** (Guests cannot enable Git Sync — this also causes “Access denied” on change requests).
* Merge [PR #1](https://github.com/enejac/HiperSnipeBot_Solana_Python/pull/1) into `main` first, or sync branch `cursor/gitbook-full-docs-6192` temporarily.

### Steps

1. Open your **Hipersnipe Docs** space (not the org Integrations page).
2. Top-right of the space → **Configure** (or **Set up Git Sync**).
3. Choose **GitHub Sync** from the provider list.
4. Authenticate with GitHub and **install the GitBook GitHub App** on `enejac` (or your fork owner).
5. Grant the app access to `HiperSnipeBot_Solana_Python`.
6. Select branch **`main`** (or the docs branch until merged).
7. **Project directory:** leave empty — `.gitbook.yaml` at the repo root already sets `root: ./docs/`.
8. Initial sync direction: **GitHub → GitBook** (import existing markdown from the repo).
9. Complete setup. Future pushes to the branch auto-sync into GitBook.

Official guide: [Enabling GitHub Sync](https://gitbook.com/docs/getting-started/git-sync/enabling-github-sync)

### If the repo does not appear

On GitHub: **Settings → Applications → GitBook → Configure** → add `HiperSnipeBot_Solana_Python` under repository access.

### If you see “Access denied” on change requests

Ask the **Hipersnipe** org owner to upgrade your role to **Admin** or **Creator** under **Members**.

### `.gitbook.yaml` reference

```yaml
root: ./docs/

structure:
  readme: README.md
  summary: SUMMARY.md
```

## Editing workflow

1. Edit markdown under `docs/`
2. Update `docs/SUMMARY.md` when adding or renaming pages
3. Commit and push to the synced branch
4. GitBook rebuilds within a few minutes

### Adding a new page

```bash
# 1. Create the file
docs/user-guide/my-feature.md

# 2. Add to SUMMARY.md under the right section
* [My feature](user-guide/my-feature.md)

# 3. Commit and push
```

## Custom domain (optional)

In GitBook Space settings → **Domains**, attach a custom domain (e.g. `docs.hipersnipe.com`) and add the DNS records GitBook provides.

## Redirects

`.gitbook.yaml` includes a sample redirect:

```yaml
redirects:
  previous/page: introduction.md
```

Add more redirects when renaming pages to preserve old URLs.

## Local preview

GitBook does not require local build tooling — preview by:

* Reading markdown in the repo, or
* Using GitBook's **Preview** in the web editor after sync

## Related

* [Introduction](/readme.md)
* [Contributing](/development/contributing.md)


---

# 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.hipersnipe.com/development/gitbook-publishing.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.
