9 releases
Uses new Rust 2024
| 0.1.9 | Nov 7, 2025 |
|---|---|
| 0.1.8 | Nov 7, 2025 |
| 0.1.6 | Oct 30, 2025 |
#331 in Parser implementations
265 downloads per month
90KB
2.5K
SLoC
github-discussions-mirror
A tool to:
- continuously mirror a GitHub discussions page into a folder of JSON
- download all images referenced in discussions, optionally
- generate a static site from that folder, optionally
For a demo, see https://github.com/untitaker/rayhunter-discussions-mirror
Installation
cargo build --release
# or
cargo install github-discussions-mirror
Usage
Syncing data
export GITHUB_TOKEN=your_token_here
./target/release/github-discussions-mirror sync -r owner/repo
Your data is in ./data. JSON and images.
You can periodically rerun this command and it will sync new changes from
GitHub to ./data efficiently.
Generating a static site
Based on the files in ./data, you can now generate a static site:
./target/release/github-discussions-mirror generate
The HTML files are now in ./site.
Static site generation is entirely based on ./data's contents, i.e. fully
offline. It generates the entire site from scratch each time.
To have a live mirror, you have to retain the ./data folder, sync it
periodically, then generate the static site from it each time.
Re-doing sync
For various reasons you may want to re-do the data sync. Mostly when bugs are fixed in this tool.
You can pass --force to sync to sync entirely from scratch.
You can also do --since-days=4 to reset the checkpoint by 4 days and refetch
only discussions that have seen activity since 4 days before the last sync.
License
MIT (see Cargo.toml and LICENSE)
Dependencies
~15–32MB
~471K SLoC