|
| 1 | +# ✏️ Edit this page |
| 2 | + |
| 3 | +Display an "Edit this page" link allowing readers to contribute fixes directly on your repository. |
| 4 | + |
| 5 | +## Configuration |
| 6 | + |
| 7 | +Configure edit links via `html_context` in `conf.py`. Breeze supports GitHub, GitLab, and Bitbucket out of the box. |
| 8 | + |
| 9 | +### GitHub |
| 10 | + |
| 11 | +```python |
| 12 | +html_context = { |
| 13 | + "github_user": "your-username", |
| 14 | + "github_repo": "your-repo", |
| 15 | + "github_version": "main", |
| 16 | + "doc_path": "docs", |
| 17 | +} |
| 18 | +``` |
| 19 | + |
| 20 | +### GitLab |
| 21 | + |
| 22 | +```python |
| 23 | +html_context = { |
| 24 | + "gitlab_user": "your-username", |
| 25 | + "gitlab_repo": "your-repo", |
| 26 | + "gitlab_version": "main", |
| 27 | + "doc_path": "docs", |
| 28 | +} |
| 29 | +``` |
| 30 | + |
| 31 | +### Bitbucket |
| 32 | + |
| 33 | +```python |
| 34 | +html_context = { |
| 35 | + "bitbucket_user": "your-username", |
| 36 | + "bitbucket_repo": "your-repo", |
| 37 | + "bitbucket_version": "main", |
| 38 | + "doc_path": "docs", |
| 39 | +} |
| 40 | +``` |
| 41 | + |
| 42 | +## Configuration options |
| 43 | + |
| 44 | +| Key | Description | |
| 45 | +|-----|-------------| |
| 46 | +| `{provider}_user` | Your username or organization name | |
| 47 | +| `{provider}_repo` | Repository name | |
| 48 | +| `{provider}_version` | Branch name (defaults to `main`) | |
| 49 | +| `doc_path` | Path to documentation folder within your repository | |
| 50 | + |
| 51 | +## Custom source URL |
| 52 | + |
| 53 | +For self-hosted instances or other providers, use a custom URL pattern with `%s` as placeholder for the file path: |
| 54 | + |
| 55 | +```python |
| 56 | +html_context = { |
| 57 | + "source_url": "https://git.example.com/user/repo/edit/main/docs/%s", |
| 58 | +} |
| 59 | +``` |
| 60 | + |
| 61 | +The `%s` placeholder is replaced with the full path to the source file (e.g., `user_guide/quickstart.md`). |
0 commit comments