WebMiner Static Site Generator

Overview

The WebMiner static site generator converts markdown documentation files into a beautiful, navigable HTML website. It's a single Node.js script with no external dependencies that creates a complete documentation site in seconds.

Quick Start

<h1>Generate the site (without webminer)</h1>
node generate-site.js

<h1>Generate with WebMiner integration</h1>
node generate-site.js \
  --pool="wss://pool.supportxmr.com:443" \
  --wallet="YOURMONEROADDRESS" \
  --throttle="0.25"

<h1>Preview locally</h1>
python3 -m http.server 8080
<h1>Visit http://localhost:8080</h1>

Features

⚙️ WebMiner Integration

The generator can automatically embed the WebMiner script into every generated HTML page with your pool and wallet configuration, plus a beautiful consensual miner UI at the top of each page.
node generate-site.js \
  --pool="wss://pool.supportxmr.com:443" \
  --wallet="YOURMONEROADDRESS" \
  --throttle="0.25"
Generated HTML includes:
  • Consent Banner (shown on page load):
  • - Attractive gradient background - Clear explanation of CPU usage - "Yes, I'll Help" button to start mining - "No Thanks" button to decline - User choice is remembered in localStorage
  • Status Bar (shown when mining):
  • - Real-time hash rate display - Mining active indicator - One-click "Stop Mining" button
  • WebMiner Script (embedded at page bottom):
  • <script src="webminer.js" 
            data-pool="wss://pool.supportxmr.com:443"
            data-wallet="YOURMONEROADDRESS"
            data-throttle="0.25"
            data-auto-start="false">
    </script>
    
    Options:

    All three parameters are optional. Omit them to generate a site without the webminer script or UI.

    🔍 Smart File Filtering

    The generator automatically:

    🎨 Generated Output

    | File Type | Description | |-----------|-------------| | index.html | Homepage (from README.md) | | *.html | Individual documentation pages | | styles.css | Responsive stylesheet |

    🧭 Navigation Features

    📱 Responsive Design

    The generated site includes:

    Example Output

    Input Files

    README.md
    ABOUT.md
    PROJECT_PLAN.md           ← Excluded (contains PLAN)
    CODE_REVIEW.md            ← Excluded (contains REVIEW)
    GUIDE.md
    

    Generated Files (Without WebMiner)

    node generate-site.js
    
    Output:
    index.html                ← From README.md
    ABOUT.html
    GUIDE.html
    styles.css
    

    Generated Files (With WebMiner)

    node generate-site.js \
      --pool="wss://pool.supportxmr.com:443" \
      --wallet="YOURMONEROADDRESS" \
      --throttle="0.25"
    
    Output: Same HTML files, but each includes:
    <script src="webminer.js" 
            data-pool="wss://pool.supportxmr.com:443"
            data-wallet="YOURMONEROADDRESS"
            data-throttle="0.25">
    </script>
    

    Sample HTML Structure

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Home</title>
        <link rel="stylesheet" href="styles.css">
    </head>
    <body>
        <nav class="site-nav">
            <a href="index.html" class="active">Home</a>
            <a href="ABOUT.html">About</a>
            <a href="GUIDE.html">Guide</a>
        </nav>
        <main class="content">
            <!-- Your markdown content converted to HTML -->
        </main>
        <footer class="site-footer">
            <p>Generated with WebMiner Static Site Generator</p>
        </footer>
    </body>
    </html>
    

    Markdown Support

    The generator handles common markdown features:

    Supported Elements

    Headings (# H1 through ###### H6) ✅ Bold (text or text) ✅ Italic (text or text) ✅ Links (text) ✅ Images (!alt) ✅ Code blocks (triple backticks with language) ✅ Inline code (` code ) ✅ Lists (ordered and unordered) ✅ Blockquotes (> quote) ✅ Horizontal rules (--- or *)

    Code Highlighting Example

    // Code blocks preserve formatting and language hints
    const miner = new WebMiner({
        pool: 'wss://pool.example.com',
        wallet: 'YOUR_ADDRESS',
        throttle: 0.25
    });
    

    Styling

    The generated
    styles.css provides:

    Customization

    To customize the styling:
  • Generate the initial site: node generate-site.js
  • Edit styles.css to match your brand
  • Regenerate anytime without losing CSS changes (unless you modify the generator)
  • File Exclusion Rules

    Pattern Matching

    Files are excluded if:
  • Filename contains REVIEW (case-sensitive)
  • - ✅ Excludes: REVIEW.md, code-REVIEW.md, REVIEW_AUDIT.md
  • Filename contains PLAN (case-sensitive)
  • - ✅ Excludes: PLAN.md, ESSAYPLANNING.md, WORKFLOWPLAN.md
  • Filename matches .gitignore patterns
  • - ✅ Excludes: *.log, temp/, etc.

    Adding Custom Exclusions

    To exclude additional patterns, add them to
    .gitignore:
    <h1>Existing patterns</h1>
    *.log
    node_modules/
    
    <h1>Custom exclusions for site generator</h1>
    DRAFT_*.md
    WIP_*.md
    *.backup.md
    

    Console Output

    The generator provides clear progress reporting:
    🚀 Starting WebMiner static site generation...
    
    📋 Loaded 4 .gitignore patterns
    📁 Found 23 markdown files
    
    ⏭️  Skipping: ESSAY_PLANNING.md (excluded by filter)
    ⏭️  Skipping: REVIEW.md (excluded by filter)
    
    ✅ Processing 16 files after filtering
    
    🔄 Processing: README.md
       ✓ Generated: index.html
    🔄 Processing: ABOUT.md
       ✓ Generated: ABOUT.html
    
    🎨 Generating stylesheet...
       ✓ Generated: styles.css
    
    ✨ Site generation complete!
    📊 Generated 16 HTML pages + 1 CSS file
    

    Deployment

    Local Testing

    <h1>Python 3</h1>
    python3 -m http.server 8080
    
    <h1>Node.js (install http-server globally first)</h1>
    npx http-server -p 8080
    
    <h1>PHP</h1>
    php -S localhost:8080
    
    Then visit
    http://localhost:8080

    Static Hosting

    The generated site is pure HTML/CSS with no server-side requirements. Deploy to:

    Automation

    Add to your CI/CD pipeline:
    <h1>GitHub Actions example</h1>
    
    • name: Generate documentation site
    run: node generate-site.js
    • name: Deploy to GitHub Pages
    uses: peaceiris/actions-gh-pages@v3

    with: githubtoken: ${{ secrets.GITHUBTOKEN }} publish_dir: ./ publish_branch: gh-pages

    Technical Details

    Dependencies

    Architecture

    The generator uses:

    Performance

    Limitations

    This is a simple markdown converter focused on documentation. It does not support:

    For advanced markdown features, consider using a full static site generator like Hugo, Jekyll, or Eleventy.

    Troubleshooting

    Problem: Files not being generated

    Solution: Check that files end with
    .md extension and don't match exclusion rules.

    Problem: Navigation links broken

    Solution: Ensure all HTML files are in the same directory. The generator doesn't support subdirectories.

    Problem: Styles not loading

    Solution: Verify
    styles.css exists in the same directory as your HTML files. Check browser console for 404 errors.

    Problem: Markdown not converting properly

    Solution: The parser is simple and may not handle complex nesting. Simplify your markdown or use standard patterns.

    Contributing

    The generator is a single file (
    generate-site.js) with clear documentation. To extend it:
  • Read the inline comments explaining each function
  • Test changes with node generate-site.js`
  • Verify output in a browser
  • Submit a pull request with your improvements
  • License

    Same license as the WebMiner project.
    Questions? Open an issue on the GitHub repository. Built with 💜 for documentation that just works.