RepoPilotOpen in app →

ralfbiedert/cheats.rs

Rust Language Cheat Sheet - https://cheats.rs

Mixed

Missing license — unclear to depend on

weakest axis
Use as dependencyConcerns

no license — legally unclear; no tests detected…

Fork & modifyConcerns

no license — can't legally use code; no tests detected…

Learn fromHealthy

Documented and popular — useful reference codebase to read through.

Deploy as-isConcerns

no license — can't legally use code; no CI workflows detected

  • Last commit 3d ago
  • 8 active contributors
  • Single-maintainer risk — top contributor 88% of recent commits
Show all 6 evidence items →
  • No license — legally unclear to depend on
  • No CI workflows detected
  • No test directory detected
What would change the summary?
  • Use as dependency ConcernsMixed if: publish a permissive license (MIT, Apache-2.0, etc.)
  • Fork & modify ConcernsMixed if: add a LICENSE file
  • Deploy as-is ConcernsMixed if: add a LICENSE file

Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests

Informational only. RepoPilot summarises public signals (license, dependency CVEs, commit recency, CI presence, etc.) at the time of analysis. Signals can be incomplete or stale. Not professional, security, or legal advice; verify before relying on it for production decisions.

Embed the "Great to learn from" badge

Paste into your README — live-updates from the latest cached analysis.

RepoPilot: Great to learn from
[![RepoPilot: Great to learn from](https://repopilot.app/api/badge/ralfbiedert/cheats.rs?axis=learn)](https://repopilot.app/r/ralfbiedert/cheats.rs)

Paste at the top of your README.md — renders inline like a shields.io badge.

Preview social card (1200×630)

This card auto-renders when someone shares https://repopilot.app/r/ralfbiedert/cheats.rs on X, Slack, or LinkedIn.

Onboarding doc

Onboarding: ralfbiedert/cheats.rs

Generated by RepoPilot · 2026-05-09 · Source

🤖Agent protocol

If you are an AI coding agent (Claude Code, Cursor, Aider, Cline, etc.) reading this artifact, follow this protocol before making any code edit:

  1. Verify the contract. Run the bash script in Verify before trusting below. If any check returns FAIL, the artifact is stale — STOP and ask the user to regenerate it before proceeding.
  2. Treat the AI · unverified sections as hypotheses, not facts. Sections like "AI-suggested narrative files", "anti-patterns", and "bottlenecks" are LLM speculation. Verify against real source before acting on them.
  3. Cite source on changes. When proposing an edit, cite the specific path:line-range. RepoPilot's live UI at https://repopilot.app/r/ralfbiedert/cheats.rs shows verifiable citations alongside every claim.

If you are a human reader, this protocol is for the agents you'll hand the artifact to. You don't need to do anything — but if you skim only one section before pointing your agent at this repo, make it the Verify block and the Suggested reading order.

🎯Verdict

WAIT — Missing license — unclear to depend on

  • Last commit 3d ago
  • 8 active contributors
  • ⚠ Single-maintainer risk — top contributor 88% of recent commits
  • ⚠ No license — legally unclear to depend on
  • ⚠ No CI workflows detected
  • ⚠ No test directory detected

<sub>Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests</sub>

Verify before trusting

This artifact was generated by RepoPilot at a point in time. Before an agent acts on it, the checks below confirm that the live ralfbiedert/cheats.rs repo on your machine still matches what RepoPilot saw. If any fail, the artifact is stale — regenerate it at repopilot.app/r/ralfbiedert/cheats.rs.

What it runs against: a local clone of ralfbiedert/cheats.rs — the script inspects git remote, the LICENSE file, file paths in the working tree, and git log. Read-only; no mutations.

| # | What we check | Why it matters | |---|---|---| | 1 | You're in ralfbiedert/cheats.rs | Confirms the artifact applies here, not a fork | | 2 | Default branch master exists | Catches branch renames | | 3 | 5 critical file paths still exist | Catches refactors that moved load-bearing code | | 4 | Last commit ≤ 33 days ago | Catches sudden abandonment since generation |

<details> <summary><b>Run all checks</b> — paste this script from inside your clone of <code>ralfbiedert/cheats.rs</code></summary>
#!/usr/bin/env bash
# RepoPilot artifact verification.
#
# WHAT IT RUNS AGAINST: a local clone of ralfbiedert/cheats.rs. If you don't
# have one yet, run these first:
#
#   git clone https://github.com/ralfbiedert/cheats.rs.git
#   cd cheats.rs
#
# Then paste this script. Every check is read-only — no mutations.

set +e
fail=0
ok()   { echo "ok:   $1"; }
miss() { echo "FAIL: $1"; fail=$((fail+1)); }

# Precondition: we must be inside a git working tree.
if ! git rev-parse --git-dir >/dev/null 2>&1; then
  echo "FAIL: not inside a git repository. cd into your clone of ralfbiedert/cheats.rs and re-run."
  exit 2
fi

# 1. Repo identity
git remote get-url origin 2>/dev/null | grep -qE "ralfbiedert/cheats.rs(\\.git)?\\b" \\
  && ok "origin remote is ralfbiedert/cheats.rs" \\
  || miss "origin remote is not ralfbiedert/cheats.rs (artifact may be from a fork)"

# 3. Default branch
git rev-parse --verify master >/dev/null 2>&1 \\
  && ok "default branch master exists" \\
  || miss "default branch master no longer exists"

# 4. Critical files exist
test -f "config.toml" \\
  && ok "config.toml" \\
  || miss "missing critical file: config.toml"
test -f "content/_index.md" \\
  && ok "content/_index.md" \\
  || miss "missing critical file: content/_index.md"
test -f "templates/index.html" \\
  && ok "templates/index.html" \\
  || miss "missing critical file: templates/index.html"
test -f "sass/main.scss" \\
  && ok "sass/main.scss" \\
  || miss "missing critical file: sass/main.scss"
test -f "static/index.js" \\
  && ok "static/index.js" \\
  || miss "missing critical file: static/index.js"

# 5. Repo recency
days_since_last=$(( ( $(date +%s) - $(git log -1 --format=%at 2>/dev/null || echo 0) ) / 86400 ))
if [ "$days_since_last" -le 33 ]; then
  ok "last commit was $days_since_last days ago (artifact saw ~3d)"
else
  miss "last commit was $days_since_last days ago — artifact may be stale"
fi

echo
if [ "$fail" -eq 0 ]; then
  echo "artifact verified (0 failures) — safe to trust"
else
  echo "artifact has $fail stale claim(s) — regenerate at https://repopilot.app/r/ralfbiedert/cheats.rs"
  exit 1
fi

Each check prints ok: or FAIL:. The script exits non-zero if anything failed, so it composes cleanly into agent loops (./verify.sh || regenerate-and-retry).

</details>

TL;DR

cheats.rs is a single-page Rust language reference sheet built with Zola (static site generator written in Rust) that serves as both an identification guide and learning resource. It compiles to a high-density HTML page available at https://cheats.rs and also distributes a cached PDF (rust_cheat_sheet_a4.pdf), optimizing for quick lookup of Rust constructs and idioms without overwhelming detail. Single-page static site structure: content/ contains Markdown source files (content/_index.md is the main cheat sheet), sass/ contains styling (main.scss orchestrates multiple theme/component scss files), static/ holds assets (fonts, favicons, index.js for interactivity), and scripts/ handles build-time transformations (pdf.js for PDF generation, postprocess.js for post-build HTML optimization). Zola compiles this to public/ directory which is then post-processed with posthtml and minification.

👥Who it's for

Programmers with prior coding experience who need to quickly identify or learn Rust language constructs they encounter; contributors who want to improve the reference material. Primary users are developers using Rust daily who need fast lookup without diving into full documentation.

🌱Maturity & risk

Production-ready and actively maintained. The project has a robust CI/CD pipeline (.gitea/workflows/deploy.yml), pinned Zola version (.zolaversion), and organized contribution process. Multiple contributors across the project history indicate stable, community-backed development. Single-maintainer model (ralfbiedert) but with active pull requests and issue handling suggests healthy ongoing maintenance.

Low risk overall. The project has minimal dependencies (posthtml, playwright, postcss tooling in package.json are all stable, mature npm packages), no compiled Rust code to maintain, and a straightforward static site model. Main risk is reliance on a single maintainer (ralfbiedert) for deployment and final approval, though the contribution model accepts PRs directly for bug fixes. No breaking changes expected since this is reference documentation.

Active areas of work

No specific recent activity visible in the file list provided, but the repo actively accepts contributions and bug fixes via pull requests. The .gitea/workflows/deploy.yml indicates continuous deployment on commits. Given the README actively directs users to file issues and PRs on GitHub, ongoing refinements to cheat sheet content and occasional tooling updates are the expected workflow.

🚀Get running

git clone https://github.com/ralfbiedert/cheats.rs.git
cd cheats.rs
# Download the Zola version specified in .zolaversion (check that file for exact version)
# E.g., if .zolaversion contains 0.17.0:
zola serve
# Server runs on http://127.0.0.1:1111 by default

Daily commands:

# Development:
zola serve

# Production build:
zola build
npm run posthtml

# Generate PDF:
npm run pdf

🗺️Map of the codebase

  • config.toml — Zola site configuration defining the entire site structure, metadata, and build behavior—all content organization flows from here.
  • content/_index.md — Root content file that defines the main cheat sheet page structure and all high-level sections contributors must understand.
  • templates/index.html — Primary HTML template rendering the cheat sheet; any layout or structural changes require modification here.
  • sass/main.scss — Central stylesheet importing all component styles; visual consistency and responsive design depend on this.
  • static/index.js — Client-side interactivity for tabs, search, and theme switching—essential for UX functionality.
  • scripts/postprocess.js — Post-build processing step that optimizes and finalizes HTML output; critical for deployment pipeline.
  • .posthtmlrc — PostHTML configuration controlling asset inlining and image optimization during build.

🛠️How to make changes

Add a new cheat sheet section

  1. Edit content/_index.md and add a new markdown section with heading, examples, and content (content/_index.md)
  2. Use shortcodes like {{ ex() }}, {{ note() }}, {{ bad() }} to annotate examples and callouts (templates/shortcodes/ex.html)
  3. Add corresponding styling to sass/_page.scss if needed for custom section layout (sass/_page.scss)
  4. Run zola serve locally to preview, then commit and push to trigger CI deployment (.gitea/workflows/deploy.yml)

Add a new tabbed content block

  1. In content/_index.md, use {{ tab(label='tab name') }} shortcode to create tab groups (content/_index.md)
  2. Verify static/index.js handles tab switching (already implemented; review if adding new tab features) (static/index.js)
  3. Review and update sass/tabs.scss if custom tab styling is needed (sass/tabs.scss)

Update visual theme or styling

  1. Modify sass/_html.scss for global HTML element styles or sass/_page.scss for layout (sass/_html.scss)
  2. Update dark theme in sass/prism-night.scss or light theme in sass/prism-day.scss (sass/prism-night.scss)
  3. Run zola serve to verify styles compile and apply correctly (config.toml)

Generate updated PDF from current site

  1. Ensure all content changes are final in content/_index.md (content/_index.md)
  2. Run npm run pdf to invoke scripts/pdf.js which uses Playwright to render HTML to PDF (scripts/pdf.js)
  3. PDF is output to public/ directory and can be deployed as a static asset (package.json)

🔧Why these technologies

  • Zola (Rust static site generator) — Fast zero-overhead builds, everything-in-one-tool philosophy, written in Rust (ate-our-own-dogfood for a Rust cheat sheet)
  • SCSS/Sass — Enables maintainable stylesheets with variables, mixins, and nested syntax; separate day/night themes for syntax highlighting
  • PostHTML + cssnano + htmlnano — Post-build optimization pipeline inlines assets, minifies HTML/CSS, and reduces final payload for instant page load
  • Playwright for PDF generation — Headless browser automation enables high-fidelity PDF rendering of the complete HTML page with exact styling
  • Prism.js for syntax highlighting — Lightweight, client-side code highlighting with support for Rust and many other languages without server overhead

⚖️Trade-offs already made

  • Static site (no server-side rendering, no database)

    • Why: Simplicity, performance, cost, and zero security surface; cheat sheet is reference material that doesn't require dynamic updates
    • Consequence: Content changes require rebuild and redeployment; no real-time personalization or user accounts
  • Single-page layout in content/_index.md

    • Why: High information density as core design principle; all constructs visible/searchable at once
    • Consequence: Large markdown file; slower initial load time before optimization; difficult to navigate without anchor links
  • PostHTML post-processing instead of build-time inlining

    • Why: Allows iteration and preview without re-running Zola; applies transformations only to final output
    • Consequence: Additional build step and complexity; harder to debug asset references during authoring
  • Client-side tab and theme switching in JavaScript

    • Why: No server round-trips needed; instant response; users control visual appearance
    • Consequence: Slight JavaScript bundle overhead; requires careful state management to preserve tab/theme preference across sessions

🚫Non-goals (don't propose these)

  • Real-time collaborative editing of cheat sheet content
  • User accounts, authentication, or personalization
  • Multilingual support or localization
  • Interactive Rust code execution or REPL
  • Comment threads, user feedback collection, or ratings
  • Mobile-first responsive design (optimized for desktop reference density)

🪤Traps & gotchas

  1. Zola version must match .zolaversion exactly — mismatched versions can cause build failures or output inconsistencies. 2. npm dependencies are required for post-processing, not optional — npm install must run before npm run posthtml after zola build. 3. PDF generation requires Playwright browsers (headless Chromium) — first run of npm run pdf downloads ~300MB of browser binaries; CI scripts (ci_pack_public.sh, ci_fix_permissions.sh) must run in correct order. 4. config.toml base_url must match deployment — if deploying to a subdomain, this must be updated or relative links break. 5. Content is evaluated as Markdown with Zola shortcodes — raw HTML in .md files may not render as expected without proper escaping.

🏗️Architecture

💡Concepts to learn

  • Static Site Generation (SSG) — cheats.rs is built entirely with Zola SSG, meaning understanding how content compiles to static HTML/CSS at build time (not runtime) is essential for modifying the build pipeline and deployment strategy
  • PostHTML and PostCSS plugins — The post-build optimization step (scripts/postprocess.js) uses posthtml-inline-assets and htmlnano for minification and asset inlining; contributors modifying build output must understand this plugin system
  • Responsive Typography & Information Density — cheats.rs deliberately maximizes information density on a single page while maintaining readability; the Sass structure and responsive design in sass/_page.scss balance these competing goals
  • Headless Browser Automation (Playwright) — scripts/pdf.js uses Playwright to generate a PDF snapshot of the HTML page; understanding this is required for maintaining or improving PDF generation and ensuring visual consistency
  • Sass/SCSS modular architecture — The sass/ directory uses multiple feature-specific .scss files (tabs.scss, visuals.scss, prism-day/night.scss) imported into main.scss; this modular pattern is key to maintaining stylesheets as content grows
  • Gitea CI/CD workflows — The .gitea/workflows/deploy.yml defines the entire deployment pipeline; understanding this YAML syntax is necessary for modifying build or deployment steps
  • Font subsetting and WOFF2 compression — static/fonts/ contains pre-optimized WOFF2 font files (FiraCode, OpenSans); these are a major part of page load performance and require specific tools to update or replace
  • rust-lang/rust-by-example — Official Rust learning reference with runnable examples; complementary to cheats.rs for learning-oriented users rather than quick lookup
  • jlevy/the-art-of-command-line — Inspiration for the single-page, high-density reference sheet format that cheats.rs emulates
  • getzola/zola — The static site generator that powers cheats.rs; contributing to Zola directly benefits this project
  • rust-lang/rust — Official Rust compiler and standard library repository; cheats.rs references and relies on stability of Rust language features documented there
  • The-Book-Programmers/The-Rust-Programming-Language-2nd-Edition — The official Rust book; cheats.rs explicitly cites tables from The Book as source material for its reference content

🪄PR ideas

To work on one of these in Claude Code or Cursor, paste: Implement the "<title>" PR idea from CLAUDE.md, working through the checklist as the task list.

Add automated PDF generation CI workflow in .gitea/workflows

The repo has a scripts/pdf.js script and package.json defines a 'pdf' script, but there's no automated workflow to regenerate the PDF on content changes. The current .gitea/workflows/deploy.yml likely doesn't include PDF generation. This would ensure the cached PDF at cheats.rs/dl/rust_cheat_sheet_a4.pdf stays in sync with content updates, improving reliability for users who download the PDF version.

  • [ ] Examine .gitea/workflows/deploy.yml to understand current deployment pipeline
  • [ ] Add a build step that runs 'npm run pdf' after 'zola build' in the workflow
  • [ ] Configure the workflow to upload the generated PDF artifact to the appropriate static location
  • [ ] Test the workflow triggers correctly on pushes to main/master branch affecting content/ or scripts/pdf.js

Add LinkChecker or htmltest validation to CI pipeline

With extensive content in content/_index.md and many shortcodes (templates/shortcodes/*.html), internal and external links can break. The repo lacks automated link validation in its CI. This would catch broken references early and improve site reliability, especially critical for a reference/cheat sheet where accurate links are essential.

  • [ ] Add a new GitHub Actions/Gitea workflow job or extend deploy.yml to run link checking on the built 'public/' directory
  • [ ] Configure htmltest or lychee to validate all href/src attributes in generated HTML
  • [ ] Exclude external domains that are flaky or require authentication from validation
  • [ ] Document in README.md how to run link validation locally before pushing

Refactor postprocessing scripts into modular Node utilities

The scripts/ directory contains scripts/postprocess.js and scripts/pdf.js that likely contain overlapping build logic. Given the complexity of the build pipeline (Zola → PostHTML → PostCSS → postprocess → PDF), these scripts would benefit from being split into reusable modules (e.g., scripts/lib/asset-inliner.js, scripts/lib/pdf-builder.js) to reduce duplication and improve maintainability for future contributors.

  • [ ] Analyze scripts/postprocess.js and scripts/pdf.js to identify common operations (HTML manipulation, asset handling, optimization)
  • [ ] Create scripts/lib/ directory with focused modules for major operations
  • [ ] Refactor postprocess.js and pdf.js to import and use these utilities
  • [ ] Update package.json scripts to ensure they still work and verify output equivalence

🌿Good first issues

  • Add a table of contents generator to content/_index.md using Zola's automatic heading ID feature; many users report wanting to jump to specific sections (e.g., 'ownership rules', 'trait bounds') without scrolling. Review sass/_page.scss for anchor link styling.
  • Expand content/faq.md with an entry for 'How do I convert between String and &str?' with code examples — this is one of the most frequently asked questions on r/learnrust but is not explicitly covered in the current FAQ.
  • Add dark mode toggle persistence using localStorage in static/index.js — currently the theme switcher likely resets on page reload. Store selected theme in localStorage and apply it on page load, matching the CSS theme classes already defined in sass/prism-day.scss and sass/prism-night.scss.

Top contributors

Click to expand

📝Recent commits

Click to expand
  • f153e8e — Fix line wrap. (ralfbiedert)
  • 2988f12 — fix: use dyn compatibility (jackssrt)
  • c3ccf9b — better link (Its-Just-Nans)
  • 0fa990a — reverse fmt (Its-Just-Nans)
  • d603f76 — fix href (Its-Just-Nans)
  • 444c02d — fix withlink (Its-Just-Nans)
  • 3f1aa45 — add the method to doc (Its-Just-Nans)
  • 5cd9cda — Fix wrong hexe (Its-Just-Nans)
  • dc3dc7c — Fix signature. (ralfbiedert)
  • 52df420 — Follow M-INIT-BUILDER (ralfbiedert)

🔒Security observations

The cheats.rs project is a static site generator with moderate security concerns. Primary risks stem from outdated NPM dependencies (Playwright, PostCSS, and others) which may contain known vulnerabilities. The build pipeline includes several custom scripts that should be audited for input validation and command injection risks. The project would benefit from: (1) updating

  • High · Outdated Playwright Dependency — package.json - dependencies.playwright. The project uses Playwright ^1.41.2, which is significantly outdated (released in late 2023). Playwright receives regular security updates, and using an old version may expose the application to known vulnerabilities in browser automation, especially when generating PDFs which involve rendering untrusted content. Fix: Update Playwright to the latest version. Run 'npm update playwright' and test the PDF generation workflow to ensure compatibility.
  • High · Outdated PostCSS Dependency — package.json - dependencies.postcss. PostCSS ^8.4.19 is outdated and may contain known security vulnerabilities. PostCSS is a critical build tool that processes CSS and can be a vector for code injection if not properly maintained. Fix: Update PostCSS to the latest version (^8.4.31 or higher). Run 'npm update postcss' and verify all build scripts still function correctly.
  • Medium · Insecure Posthtml-inline-assets Usage — package.json - dependencies.posthtml-inline-assets, .posthtmlrc configuration. The posthtml-inline-assets plugin (^3.0.0) inlines assets directly into HTML. If not properly configured, this could lead to XSS vulnerabilities if malicious assets or data URIs are processed without sanitization. The project uses this in a post-processing pipeline. Fix: Review the .posthtmlrc configuration to ensure only trusted assets are inlined. Implement content validation and sanitization for any user-generated or external assets before inlining.
  • Medium · Multiple Outdated NPM Dependencies — package.json - multiple dependencies. Several dependencies have outdated versions: cssnano (^5.1.14), htmlnano (^0.2.5), svgo (^3.0.2), and terser (^5.14.1). While these are build tools, they can still be vectors for supply chain attacks and may contain known vulnerabilities. Fix: Audit all dependencies using 'npm audit' and update to the latest versions. Run 'npm update' and thoroughly test the build pipeline, particularly the CSS minification and HTML/SVG optimization workflows.
  • Medium · Scripts Directory Execution Risk — scripts/ directory, particularly scripts/pdf.js and scripts/postprocess.js. The scripts directory contains shell scripts (ci_fix_permissions.sh, ci_pack_public.sh) and Node.js scripts (pdf.js, postprocess.js) that are executed during CI/CD. If these scripts accept user input or process untrusted data, they could be vulnerable to command injection or arbitrary code execution. Fix: Audit all scripts in the scripts/ directory for input validation. Ensure no user input or environment variables are directly interpolated into shell commands. Use parameterized approaches and sanitize all inputs.
  • Low · Missing Security Headers Configuration — config.toml, server configuration. While this is a static site, there is no visible configuration for security headers (CSP, X-Frame-Options, X-Content-Type-Options, etc.) in the static site configuration or server configuration files. Fix: Implement security headers either in the Zola configuration or in the deployment infrastructure (nginx/web server). At minimum, configure: Content-Security-Policy, X-Frame-Options: DENY, X-Content-Type-Options: nosniff, Strict-Transport-Security.
  • Low · No Package Lock File Visible — Project root (package-lock.json missing or not shown). The security analysis does not show package-lock.json or yarn.lock, which are critical for ensuring reproducible builds and preventing dependency version drift. Without a lock file, builds may pull different versions of dependencies. Fix: Ensure package-lock.json is committed to the repository. This guarantees reproducible builds and makes it easier to track when dependencies were updated. Use 'npm ci' instead of 'npm install' in CI/CD pipelines.

LLM-derived; treat as a starting point, not a security audit.


Generated by RepoPilot. Verdict based on maintenance signals — see the live page for receipts. Re-run on a new commit to refresh.

Mixed signals · ralfbiedert/cheats.rs — RepoPilot