Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Deploy Documentation to GitHub Pages

on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
name: Build Documentation
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: 🦀 Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y pkg-config libssl-dev

- name: Cache Cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-pages-${{ hashFiles('**/Cargo.lock') }}

- name: 📦 Build project
run: cargo build --release

- name: 📚 Generate documentation
run: |
# Set environment variables to prevent browser opening
export GIT_EDITOR_NO_BROWSER=1
export NO_BROWSER=1

# Create docs directory
mkdir -p docs-site

# Generate the documentation HTML
cargo run --release -- --docs

# Copy the generated HTML to docs-site directory
cp /tmp/git-editor-docs.html docs-site/index.html
Comment on lines +60 to +61

Copilot AI Sep 28, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hardcoded path /tmp/git-editor-docs.html creates a tight coupling between the documentation generation logic and the GitHub Actions workflow. If the temp file location changes in the future, this workflow will break. Consider making the temp file location configurable or using a more predictable location.

Copilot uses AI. Check for mistakes.

# Create a simple robots.txt for better SEO
echo -e "User-agent: *\nAllow: /" > docs-site/robots.txt

# Create a .nojekyll file to bypass Jekyll processing
touch docs-site/.nojekyll

- name: Setup Pages
uses: actions/configure-pages@v4

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './docs-site'

deploy:
name: Deploy to GitHub Pages
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
# Only deploy on pushes to main/master, not on PRs
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
37 changes: 37 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ url = "2.5.4"
uuid = { version = "1.17.0", features = ["v4"] }
crossterm = "0.27"
tempfile = "3.0"
open = "5.0"

[dev-dependencies]
serial_test = "3.0"
Expand Down
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,28 @@ cargo build --release
# The binary will be available at target/release/git-editor
```

## Documentation

📚 **Comprehensive documentation is available online:** [rohansen856.github.io/git-editor](https://rohansen856.github.io/git-editor)

The online documentation includes:
- Complete command reference with examples
- Technical implementation details
- Architecture overview and development guidelines
- Interactive copy-to-clipboard code examples
- Troubleshooting guide and FAQ
- Advanced usage patterns and best practices

### Quick Access to Documentation

You can also access the documentation directly from the command line:

```bash
git-editor --docs
```

This command will generate and open the comprehensive documentation in your default browser.

## Usage

Git Editor supports five main modes of operation:
Expand Down
Loading
Loading