From 720adb6a17272c0ece3f336de5adba32ae4da45c Mon Sep 17 00:00:00 2001 From: Suyog Tandel Date: Tue, 23 Jun 2026 23:45:11 +0530 Subject: [PATCH] feat: add documentation page for picoforge source code --- .github/workflows/docs.yml | 47 ++++++++++++++++++++++++++++++++++++++ src/device/fido/mod.rs | 2 +- src/device/rescue/mod.rs | 2 +- 3 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..5659eee --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,47 @@ +name: Deploy Documentation + +on: + push: + branches: + - main + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: true + +jobs: + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v7 + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + with: + components: rust-docs + + - name: Generate Documentation + run: cargo doc --no-deps --document-private-items + + - name: Create Redirect Index + run: | + CRATE_NAME=$(sed -n 's/^name = "\(.*\)"/\1/p' Cargo.toml | head -n 1 | tr '-' '_') + echo "" > target/doc/index.html + + - name: Upload Artifact + uses: actions/upload-pages-artifact@v5 + with: + path: target/doc + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v5 diff --git a/src/device/fido/mod.rs b/src/device/fido/mod.rs index d0b3e6c..56f1c5c 100644 --- a/src/device/fido/mod.rs +++ b/src/device/fido/mod.rs @@ -33,7 +33,7 @@ //! agreement, and CBOR serialization. It exposes [`HidTransport`] which the //! rest of the module uses for all device I/O. //! -//! [`mod.rs`] contains the public functions called from [`super::io`]. +//! This module contains the public functions called from [`super::io`]. //! Each function opens an [`HidTransport`], performs the CTAP2 operation, //! and parses the CBOR response into the structs defined in [`super::types`]. //! diff --git a/src/device/rescue/mod.rs b/src/device/rescue/mod.rs index 6514bf9..f687399 100644 --- a/src/device/rescue/mod.rs +++ b/src/device/rescue/mod.rs @@ -130,7 +130,7 @@ //! - PHY configuration tags and bitflags //! - Vendor applet AIDs and instructions (LED, Management) //! -//! [`mod.rs`] contains the public functions called from [`super::io`]: +//! This module contains the public functions called from [`super::io`]: //! - `read_device_details()`: Reads full device status via Rescue //! - `write_config()`: Writes PHY configuration (VID/PID, LED, curves, etc.) //! - `reboot_device()`: Reboots device (normal or BOOTSEL mode)