This directory contains the GitHub Pages documentation site for fake-rs.
Once deployed, the site will be available at: https://cksac.github.io/fake-rs/
docs/
├── index.html # Main documentation page
├── styles.css # Styling
├── script.js # Interactive features
└── README.md # This file
- Go to your repository settings on GitHub
- Navigate to "Pages" section
- Under "Source", select:
- Source: Deploy from a branch
- Branch: main (or master)
- Folder: /docs
- Click "Save"
Your site will be published at https://cksac.github.io/fake-rs/
You can also use GitHub Actions for deployment. Create .github/workflows/pages.yml:
name: Deploy GitHub Pages
on:
push:
branches: [ main ]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: './docs'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2- Responsive Design: Mobile-friendly layout
- Dark Theme: Modern dark color scheme
- Interactive Search: Real-time faker search functionality
- Code Highlighting: Syntax highlighting for Rust, Bash, and TOML
- Copy Buttons: One-click code copying
- Smooth Scrolling: Enhanced navigation experience
- Keyboard Shortcuts:
/- Focus searchESC- Clear search
- Comprehensive Coverage: All 100+ fakers documented
- Multi-language Support: Documentation of all 12 supported locales
- Feature Documentation: Complete feature flag reference
The documentation uses a data-driven architecture for easy maintenance:
data/locales.js- All supported locales ⭐data/features.js- All feature flags ⭐data/fakers.js- All faker categories and items ⭐data/examples.js- All code examples ⭐styles.css- Visual stylingscript.js- Interactive featuresindex.html- Page structure
Adding a new locale? Just edit data/locales.js:
{ name: "Finnish", code: "FI_FI" }Adding a new feature? Just edit data/features.js:
{ code: "new_feature", description: "What it enables" }Adding a new faker? Just edit data/fakers.js:
{ code: "NewFaker()", desc: "What it does" }Adding an example? Just edit data/examples.js:
{ title: "Title", language: "rust", code: `...` }Changing colors? Edit styles.css variables:
:root {
--primary-color: #ff6b35;
--secondary-color: #004e89;
--accent-color: #1a659e;
}📝 See MAINTENANCE.md for complete maintenance guide
Simply open index.html in a web browser, or use a local server:
# Using Python
python -m http.server 8000
# Using Node.js http-server
npx http-server
# Using PHP
php -S localhost:8000Then visit http://localhost:8000
The site uses CDN-hosted libraries:
- Highlight.js (v11.9.0): Code syntax highlighting
- Rust, Bash, and TOML language support
No build process or npm packages required!
To update the documentation:
- Add/Update Locales: Edit
data/locales.js⭐ - Add/Update Features: Edit
data/features.js⭐ - Add/Update Fakers: Edit
data/fakers.js⭐ - Add/Update Examples: Edit
data/examples.js⭐ - Change Styling: Edit
styles.css - Add Functionality: Edit
script.js - Update Structure: Edit
index.html - Test locally
- Commit and push to GitHub
- GitHub Pages will automatically rebuild (may take a few minutes)
See MAINTENANCE.md for detailed instructions.
- Check GitHub Pages settings in repository settings
- Ensure the
docs/folder is on the correct branch - Wait a few minutes after pushing changes
- Clear browser cache
- Check browser console for errors
- Verify all CSS/JS files are in the
docs/directory
- Ensure JavaScript is enabled
- Check browser console for errors
- Verify
script.jsloaded correctly
The documentation uses a data-driven architecture for maintainability:
✅ Easy Updates: Add new content by editing data files
✅ No HTML Changes: Just update the relevant data/*.js files
✅ Consistent Formatting: Automatic styling and structure
✅ Search Included: New content automatically searchable
Keep in sync with fake-rs:
- New locales → Update
data/locales.js - New features → Update
data/features.js - New fakers → Update
data/fakers.js - New examples → Update
data/examples.js
📚 Full guide: MAINTENANCE.md
To contribute to the documentation:
- Fork the repository
- Make changes in the
docs/directory - Test locally
- Submit a pull request
The documentation site follows the same license as fake-rs: MIT OR Apache-2.0