Skip to content

Generating Documentation on Github Pages from Rust Docstrings #35

Description

@bhargavakula01

It might be worth creating a GitHub workflow to generate documentation when pushing into the main branch. I have added the code below that might potentially work:

name: Generate and Deploy Rust Docs

on:
  pull_request:
    branches:
      - main

jobs:
  rust-docs:
    name: Generate Rust Documentation
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable

      - name: Generate documentation
        run: cargo doc --no-deps

      - name: Deploy to GitHub Pages
        if: github.ref == 'refs/heads/main'
        uses: peaceiris/actions-gh-pages@v4
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./target/doc

Metadata

Metadata

Labels

documentationImprovements or additions to documentation

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions