mirror of
https://github.com/lukaszraczylo/homebrew-taps.git
synced 2026-06-05 23:23:54 +00:00
Add page.
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
name: Update Documentation
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'Casks/**'
|
||||
- 'Formula/**'
|
||||
- '.github/workflows/docs.yml'
|
||||
- 'scripts/generate-docs.sh'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
jobs:
|
||||
update-docs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Generate documentation
|
||||
run: |
|
||||
chmod +x scripts/generate-docs.sh
|
||||
./scripts/generate-docs.sh
|
||||
|
||||
- name: Check for changes
|
||||
id: check-changes
|
||||
run: |
|
||||
if git diff --quiet docs/index.html; then
|
||||
echo "changed=false" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "changed=true" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Commit and push changes
|
||||
if: steps.check-changes.outputs.changed == 'true'
|
||||
run: |
|
||||
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git config --local user.name "github-actions[bot]"
|
||||
git add docs/
|
||||
git commit -m "docs: auto-update documentation from casks"
|
||||
git push
|
||||
|
||||
deploy-pages:
|
||||
needs: update-docs
|
||||
runs-on: ubuntu-latest
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: main
|
||||
|
||||
- name: Setup Pages
|
||||
uses: actions/configure-pages@v4
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
path: 'docs'
|
||||
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v4
|
||||
@@ -1,18 +1,47 @@
|
||||
# Lukaszraczylo Brew-taps
|
||||
# Homebrew Tap
|
||||
|
||||
## How do I install these formulae?
|
||||
Custom Homebrew tap for macOS and Linux tools by Lukasz Raczylo.
|
||||
|
||||
`brew install lukaszraczylo/homebrew-taps/<formula>`
|
||||
## Available Casks
|
||||
|
||||
Or `brew tap lukaszraczylo/homebrew-taps` and then `brew install <formula>`.
|
||||
| Cask | Description |
|
||||
|------|-------------|
|
||||
| [kportal](https://github.com/lukaszraczylo/kportal) | Modern Kubernetes port-forward manager with interactive TUI |
|
||||
| [lolcathost](https://github.com/lukaszraczylo/lolcathost) | Dynamic hosts file manager with interactive terminal UI |
|
||||
| [semver-generator](https://github.com/lukaszraczylo/semver-generator) | Automatic semantic version generator based on git commit messages |
|
||||
|
||||
Or, in a `brew bundle` `Brewfile`:
|
||||
## Installation
|
||||
|
||||
### Add the tap
|
||||
|
||||
```bash
|
||||
brew tap lukaszraczylo/taps
|
||||
```
|
||||
|
||||
### Install a cask
|
||||
|
||||
```bash
|
||||
brew install --cask lukaszraczylo/taps/<cask-name>
|
||||
```
|
||||
|
||||
Or install directly:
|
||||
|
||||
```bash
|
||||
brew install --cask lukaszraczylo/taps/kportal
|
||||
```
|
||||
|
||||
### Using Brewfile
|
||||
|
||||
Add to your Brewfile:
|
||||
|
||||
```ruby
|
||||
tap "lukaszraczylo/homebrew-taps"
|
||||
brew "<formula>"
|
||||
tap "lukaszraczylo/taps"
|
||||
cask "kportal"
|
||||
cask "lolcathost"
|
||||
cask "semver-generator"
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
`brew help`, `man brew` or check [Homebrew's documentation](https://docs.brew.sh).
|
||||
- [Full Documentation](https://lukaszraczylo.github.io/homebrew-taps/)
|
||||
- [Homebrew Documentation](https://docs.brew.sh)
|
||||
|
||||
+276
@@ -0,0 +1,276 @@
|
||||
<!doctype html>
|
||||
<html lang="en" class="scroll-smooth">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Homebrew Tap - lukaszraczylo</title>
|
||||
<meta
|
||||
name="description"
|
||||
content="Homebrew tap for macOS and Linux tools by Lukasz Raczylo. Install developer tools easily with brew."
|
||||
/>
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<script>
|
||||
tailwind.config = {
|
||||
darkMode: 'class'
|
||||
}
|
||||
</script>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css"
|
||||
/>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
<style>
|
||||
body { font-family: "Inter", sans-serif; }
|
||||
code, pre { font-family: "JetBrains Mono", monospace; }
|
||||
.theme-transition {
|
||||
transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
|
||||
}
|
||||
@keyframes fadeInUp {
|
||||
from { opacity: 0; transform: translateY(20px); }
|
||||
to { opacity: 1; transform: translateY(0); }
|
||||
}
|
||||
@keyframes float {
|
||||
0%, 100% { transform: translateY(0px); }
|
||||
50% { transform: translateY(-10px); }
|
||||
}
|
||||
.animate-fade-in-up { animation: fadeInUp 0.6s ease-out; }
|
||||
.animate-float { animation: float 3s ease-in-out infinite; }
|
||||
.glass {
|
||||
background: rgba(255, 255, 255, 0.7);
|
||||
backdrop-filter: blur(10px);
|
||||
-webkit-backdrop-filter: blur(10px);
|
||||
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
.dark .glass {
|
||||
background: rgba(17, 24, 39, 0.7);
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
.gradient-text {
|
||||
background: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
background-clip: text;
|
||||
}
|
||||
.dark .gradient-text {
|
||||
background: linear-gradient(135deg, #34d399 0%, #60a5fa 100%);
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
background-clip: text;
|
||||
}
|
||||
.shadow-modern { box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.1); }
|
||||
.dark .shadow-modern { box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.4); }
|
||||
html { scroll-behavior: smooth; }
|
||||
</style>
|
||||
<script>
|
||||
if (localStorage.theme === "dark" || (!("theme" in localStorage) && window.matchMedia("(prefers-color-scheme: dark)").matches)) {
|
||||
document.documentElement.classList.add("dark");
|
||||
} else {
|
||||
document.documentElement.classList.remove("dark");
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body class="bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 theme-transition">
|
||||
<!-- Navigation -->
|
||||
<nav class="fixed w-full glass shadow-modern z-50 theme-transition">
|
||||
<div class="max-w-6xl mx-auto px-4 sm:px-6">
|
||||
<div class="flex justify-between h-16 items-center">
|
||||
<a href="#" class="flex items-center hover:opacity-80 transition-opacity duration-300 gap-2">
|
||||
<i class="fas fa-beer text-2xl text-amber-500"></i>
|
||||
<span class="text-2xl font-bold gradient-text">brew-taps</span>
|
||||
</a>
|
||||
<div class="hidden md:flex space-x-6">
|
||||
<a href="#casks" class="text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-gray-100 font-medium">Available Casks</a>
|
||||
<a href="#installation" class="text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-gray-100 font-medium">Installation</a>
|
||||
</div>
|
||||
<div class="flex items-center space-x-4">
|
||||
<button id="theme-toggle" class="text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-gray-100 p-2 min-w-[44px] min-h-[44px] flex items-center justify-center" aria-label="Toggle theme">
|
||||
<i class="fas fa-moon dark:hidden text-xl"></i>
|
||||
<i class="fas fa-sun hidden dark:inline text-xl"></i>
|
||||
</button>
|
||||
<a href="https://github.com/lukaszraczylo/homebrew-taps" target="_blank" class="text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-gray-100 p-2 min-w-[44px] min-h-[44px] flex items-center justify-center" aria-label="View on GitHub">
|
||||
<i class="fab fa-github text-xl"></i>
|
||||
</a>
|
||||
<button id="mobile-menu-toggle" class="md:hidden text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-gray-100 p-2 min-w-[44px] min-h-[44px] flex items-center justify-center" aria-label="Toggle menu">
|
||||
<i class="fas fa-bars text-xl" id="menu-open-icon"></i>
|
||||
<i class="fas fa-times text-xl hidden" id="menu-close-icon"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="mobile-menu" class="hidden md:hidden border-t border-gray-200 dark:border-gray-700">
|
||||
<div class="px-4 py-3 space-y-1 bg-white dark:bg-gray-800">
|
||||
<a href="#casks" class="block px-3 py-3 text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-gray-100 hover:bg-gray-50 dark:hover:bg-gray-700 rounded font-medium">Available Casks</a>
|
||||
<a href="#installation" class="block px-3 py-3 text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-gray-100 hover:bg-gray-50 dark:hover:bg-gray-700 rounded font-medium">Installation</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<!-- Hero Section -->
|
||||
<section class="relative pt-24 sm:pt-32 pb-12 sm:pb-20 overflow-hidden">
|
||||
<div class="absolute inset-0 bg-gradient-to-br from-emerald-50 via-blue-50 to-purple-50 dark:from-gray-900 dark:via-emerald-900/20 dark:to-blue-900/20 theme-transition"></div>
|
||||
<div class="absolute top-0 -left-4 w-72 h-72 bg-emerald-300 dark:bg-emerald-500 rounded-full mix-blend-multiply dark:mix-blend-soft-light filter blur-xl opacity-20 animate-float"></div>
|
||||
<div class="absolute top-0 -right-4 w-72 h-72 bg-blue-300 dark:bg-blue-500 rounded-full mix-blend-multiply dark:mix-blend-soft-light filter blur-xl opacity-20 animate-float" style="animation-delay: 1s;"></div>
|
||||
<div class="absolute -bottom-8 left-20 w-72 h-72 bg-purple-300 dark:bg-purple-500 rounded-full mix-blend-multiply dark:mix-blend-soft-light filter blur-xl opacity-20 animate-float" style="animation-delay: 2s;"></div>
|
||||
|
||||
<div class="relative max-w-6xl mx-auto px-4 sm:px-6">
|
||||
<div class="text-center">
|
||||
<div class="mb-8 sm:mb-10 flex justify-center animate-fade-in-up">
|
||||
<i class="fas fa-beer text-8xl sm:text-9xl text-amber-500 animate-float"></i>
|
||||
</div>
|
||||
<h1 class="text-3xl sm:text-4xl md:text-5xl lg:text-6xl font-bold text-gray-900 dark:text-gray-100 mb-4 sm:mb-6 leading-tight animate-fade-in-up" style="animation-delay: 0.1s;">
|
||||
Homebrew<br /><span class="gradient-text">Tap</span>
|
||||
</h1>
|
||||
<p class="text-base sm:text-lg md:text-xl text-gray-600 dark:text-gray-300 mb-8 sm:mb-10 max-w-2xl mx-auto leading-relaxed px-4 animate-fade-in-up" style="animation-delay: 0.2s;">
|
||||
Developer tools for macOS and Linux. Install powerful CLI utilities with a single command.
|
||||
</p>
|
||||
<div class="flex flex-col sm:flex-row gap-3 sm:gap-4 justify-center mb-8 sm:mb-12 px-4 animate-fade-in-up" style="animation-delay: 0.3s;">
|
||||
<a href="#installation" class="group relative bg-gradient-to-r from-emerald-500 to-blue-600 hover:from-emerald-600 hover:to-blue-700 text-white px-8 py-3 rounded-lg font-medium transition-all duration-300 min-h-[48px] flex items-center justify-center shadow-lg hover:shadow-xl hover:scale-105">
|
||||
<span class="relative z-10">Get Started</span>
|
||||
</a>
|
||||
<a href="https://github.com/lukaszraczylo/homebrew-taps" class="group glass hover:shadow-lg text-gray-900 dark:text-gray-100 px-8 py-3 rounded-lg font-medium transition-all duration-300 min-h-[48px] flex items-center justify-center hover:scale-105">
|
||||
<i class="fab fa-github mr-2"></i>View on GitHub
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Available Casks Section -->
|
||||
<section id="casks" class="py-12 sm:py-16 md:py-20 bg-white dark:bg-gray-900 theme-transition">
|
||||
<div class="max-w-6xl mx-auto px-4 sm:px-6">
|
||||
<div class="text-center mb-8 sm:mb-12">
|
||||
<h2 class="text-2xl sm:text-3xl md:text-4xl font-bold text-gray-900 dark:text-gray-100 mb-3 sm:mb-4">Available Casks</h2>
|
||||
<p class="text-base sm:text-lg text-gray-600 dark:text-gray-300 px-4">Install any of these tools with Homebrew</p>
|
||||
</div>
|
||||
<div class="grid md:grid-cols-2 lg:grid-cols-3 gap-6" id="casks-container">
|
||||
<!-- CASKS_START -->
|
||||
|
||||
<!-- kportal -->
|
||||
<div class="glass p-6 rounded-xl group hover:shadow-lg transition-all duration-300">
|
||||
<div class="flex items-start gap-4 mb-4">
|
||||
<div class="w-12 h-12 rounded-xl bg-gradient-to-br from-blue-500 to-purple-600 flex items-center justify-center flex-shrink-0 group-hover:scale-110 transition-transform duration-300">
|
||||
<i class="fas fa-ship text-white text-lg"></i>
|
||||
</div>
|
||||
<div class="flex-1">
|
||||
<h3 class="font-bold text-gray-900 dark:text-gray-100 text-lg">kportal</h3>
|
||||
<span class="text-xs text-gray-500 dark:text-gray-400">v0.2.46</span>
|
||||
</div>
|
||||
</div>
|
||||
<p class="text-sm text-gray-600 dark:text-gray-400 mb-4">Modern Kubernetes port-forward manager with interactive TUI</p>
|
||||
<div class="flex flex-wrap gap-2 mb-4">
|
||||
<span class="px-2 py-1 bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 rounded text-xs">Kubernetes</span>
|
||||
<span class="px-2 py-1 bg-purple-100 dark:bg-purple-900/30 text-purple-700 dark:text-purple-300 rounded text-xs">TUI</span>
|
||||
</div>
|
||||
<div class="flex gap-2">
|
||||
<a href="https://kportal.raczylo.com" target="_blank" class="flex-1 text-center px-3 py-2 bg-gray-100 dark:bg-gray-800 hover:bg-gray-200 dark:hover:bg-gray-700 rounded-lg text-sm font-medium transition-colors">
|
||||
<i class="fas fa-book mr-1"></i>Docs
|
||||
</a>
|
||||
<a href="https://github.com/lukaszraczylo/kportal" target="_blank" class="flex-1 text-center px-3 py-2 bg-gray-100 dark:bg-gray-800 hover:bg-gray-200 dark:hover:bg-gray-700 rounded-lg text-sm font-medium transition-colors">
|
||||
<i class="fab fa-github mr-1"></i>GitHub
|
||||
</a>
|
||||
</div>
|
||||
<pre class="mt-4 bg-gray-900 text-gray-100 p-3 rounded-lg text-xs overflow-x-auto"><code>brew install --cask lukaszraczylo/taps/kportal</code></pre>
|
||||
</div>
|
||||
|
||||
<!-- CASKS_END -->
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Installation Section -->
|
||||
<section id="installation" class="py-12 sm:py-16 md:py-20 bg-gray-50 dark:bg-gray-800 theme-transition">
|
||||
<div class="max-w-6xl mx-auto px-4 sm:px-6">
|
||||
<div class="text-center mb-8 sm:mb-12">
|
||||
<h2 class="text-2xl sm:text-3xl md:text-4xl font-bold text-gray-900 dark:text-gray-100 mb-3 sm:mb-4">Installation</h2>
|
||||
<p class="text-base sm:text-lg text-gray-600 dark:text-gray-300 px-4">Get started in seconds</p>
|
||||
</div>
|
||||
<div class="max-w-3xl mx-auto space-y-6">
|
||||
<div class="glass p-6 rounded-xl">
|
||||
<h3 class="font-semibold text-gray-900 dark:text-gray-100 mb-3 flex items-center">
|
||||
<i class="fas fa-plus-circle mr-2 text-emerald-500"></i>
|
||||
Add the Tap
|
||||
</h3>
|
||||
<pre class="bg-gray-900 text-gray-100 p-4 rounded-lg overflow-x-auto"><code>brew tap lukaszraczylo/taps</code></pre>
|
||||
</div>
|
||||
<div class="glass p-6 rounded-xl">
|
||||
<h3 class="font-semibold text-gray-900 dark:text-gray-100 mb-3 flex items-center">
|
||||
<i class="fas fa-download mr-2 text-blue-500"></i>
|
||||
Install a Cask
|
||||
</h3>
|
||||
<pre class="bg-gray-900 text-gray-100 p-4 rounded-lg overflow-x-auto"><code>brew install --cask lukaszraczylo/taps/<cask-name></code></pre>
|
||||
<p class="text-sm text-gray-600 dark:text-gray-400 mt-3">Or install directly without tapping first:</p>
|
||||
<pre class="bg-gray-900 text-gray-100 p-4 rounded-lg overflow-x-auto mt-2"><code>brew install --cask lukaszraczylo/taps/kportal</code></pre>
|
||||
</div>
|
||||
<div class="glass p-6 rounded-xl">
|
||||
<h3 class="font-semibold text-gray-900 dark:text-gray-100 mb-3 flex items-center">
|
||||
<i class="fas fa-file-code mr-2 text-purple-500"></i>
|
||||
Using Brewfile
|
||||
</h3>
|
||||
<p class="text-gray-600 dark:text-gray-400 mb-3">Add to your Brewfile:</p>
|
||||
<pre class="bg-gray-900 text-gray-100 p-4 rounded-lg overflow-x-auto"><code>tap "lukaszraczylo/taps"
|
||||
cask "kportal"
|
||||
cask "lolcathost"
|
||||
cask "semver-generator"</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Footer -->
|
||||
<footer class="py-8 bg-white dark:bg-gray-900 border-t border-gray-200 dark:border-gray-800 theme-transition">
|
||||
<div class="max-w-6xl mx-auto px-4 sm:px-6">
|
||||
<div class="flex flex-col md:flex-row justify-between items-center gap-4">
|
||||
<div class="flex items-center gap-2">
|
||||
<i class="fas fa-beer text-2xl text-amber-500"></i>
|
||||
<span class="text-xl font-bold gradient-text">brew-taps</span>
|
||||
</div>
|
||||
<div class="flex items-center space-x-6">
|
||||
<a href="https://github.com/lukaszraczylo/homebrew-taps" class="text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100">
|
||||
<i class="fab fa-github text-xl"></i>
|
||||
</a>
|
||||
<a href="https://github.com/lukaszraczylo/homebrew-taps/issues" class="text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 text-sm">Issues</a>
|
||||
</div>
|
||||
<p class="text-gray-500 dark:text-gray-400 text-sm">MIT License</p>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<script>
|
||||
// Theme toggle
|
||||
document.getElementById('theme-toggle').addEventListener('click', function() {
|
||||
if (document.documentElement.classList.contains('dark')) {
|
||||
document.documentElement.classList.remove('dark');
|
||||
localStorage.theme = 'light';
|
||||
} else {
|
||||
document.documentElement.classList.add('dark');
|
||||
localStorage.theme = 'dark';
|
||||
}
|
||||
});
|
||||
|
||||
// Mobile menu toggle
|
||||
document.getElementById('mobile-menu-toggle').addEventListener('click', function() {
|
||||
const menu = document.getElementById('mobile-menu');
|
||||
const openIcon = document.getElementById('menu-open-icon');
|
||||
const closeIcon = document.getElementById('menu-close-icon');
|
||||
|
||||
menu.classList.toggle('hidden');
|
||||
openIcon.classList.toggle('hidden');
|
||||
closeIcon.classList.toggle('hidden');
|
||||
});
|
||||
|
||||
// Close mobile menu on link click
|
||||
document.querySelectorAll('#mobile-menu a').forEach(link => {
|
||||
link.addEventListener('click', function() {
|
||||
document.getElementById('mobile-menu').classList.add('hidden');
|
||||
document.getElementById('menu-open-icon').classList.remove('hidden');
|
||||
document.getElementById('menu-close-icon').classList.add('hidden');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Executable
+178
@@ -0,0 +1,178 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
# Generate documentation from Casks
|
||||
# This script parses .rb files in Casks/ and updates docs/index.html
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
ROOT_DIR="$(dirname "$SCRIPT_DIR")"
|
||||
CASKS_DIR="$ROOT_DIR/Casks"
|
||||
DOCS_DIR="$ROOT_DIR/docs"
|
||||
INDEX_FILE="$DOCS_DIR/index.html"
|
||||
TEMP_FILE="$DOCS_DIR/casks_temp.html"
|
||||
|
||||
# Get metadata for a cask
|
||||
get_icon() {
|
||||
case "$1" in
|
||||
kportal) echo "fa-ship" ;;
|
||||
lolcathost) echo "fa-cat" ;;
|
||||
semver-generator) echo "fa-code-branch" ;;
|
||||
graphql-monitoring-proxy) echo "fa-chart-line" ;;
|
||||
*) echo "fa-cube" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
get_colors() {
|
||||
case "$1" in
|
||||
kportal) echo "from-blue-500 to-purple-600" ;;
|
||||
lolcathost) echo "from-pink-500 to-purple-600" ;;
|
||||
semver-generator) echo "from-emerald-500 to-teal-600" ;;
|
||||
graphql-monitoring-proxy) echo "from-rose-500 to-orange-600" ;;
|
||||
*) echo "from-gray-500 to-gray-600" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
get_tag1() {
|
||||
case "$1" in
|
||||
kportal) echo "Kubernetes" ;;
|
||||
lolcathost) echo "Hosts" ;;
|
||||
semver-generator) echo "Git" ;;
|
||||
graphql-monitoring-proxy) echo "GraphQL" ;;
|
||||
*) echo "CLI" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
get_tag1_color() {
|
||||
case "$1" in
|
||||
kportal) echo "blue" ;;
|
||||
lolcathost) echo "pink" ;;
|
||||
semver-generator) echo "emerald" ;;
|
||||
graphql-monitoring-proxy) echo "rose" ;;
|
||||
*) echo "gray" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
get_tag2() {
|
||||
case "$1" in
|
||||
kportal) echo "TUI" ;;
|
||||
lolcathost) echo "TUI" ;;
|
||||
semver-generator) echo "Versioning" ;;
|
||||
graphql-monitoring-proxy) echo "Monitoring" ;;
|
||||
*) echo "" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
get_tag2_color() {
|
||||
case "$1" in
|
||||
kportal) echo "purple" ;;
|
||||
lolcathost) echo "purple" ;;
|
||||
semver-generator) echo "teal" ;;
|
||||
graphql-monitoring-proxy) echo "orange" ;;
|
||||
*) echo "gray" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
get_docs_url() {
|
||||
case "$1" in
|
||||
kportal) echo "https://kportal.raczylo.com" ;;
|
||||
lolcathost) echo "https://lolcathost.raczylo.com" ;;
|
||||
graphql-monitoring-proxy) echo "https://graphql-monitoring-proxy.raczylo.com" ;;
|
||||
*) echo "" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
generate_cask_card() {
|
||||
local name="$1"
|
||||
local version="$2"
|
||||
local desc="$3"
|
||||
|
||||
local icon=$(get_icon "$name")
|
||||
local colors=$(get_colors "$name")
|
||||
local tag1=$(get_tag1 "$name")
|
||||
local tag1_color=$(get_tag1_color "$name")
|
||||
local tag2=$(get_tag2 "$name")
|
||||
local tag2_color=$(get_tag2_color "$name")
|
||||
local docs_url=$(get_docs_url "$name")
|
||||
local github_url="https://github.com/lukaszraczylo/$name"
|
||||
|
||||
local tags_html="<span class=\"px-2 py-1 bg-${tag1_color}-100 dark:bg-${tag1_color}-900/30 text-${tag1_color}-700 dark:text-${tag1_color}-300 rounded text-xs\">${tag1}</span>"
|
||||
if [ -n "$tag2" ]; then
|
||||
tags_html="$tags_html
|
||||
<span class=\"px-2 py-1 bg-${tag2_color}-100 dark:bg-${tag2_color}-900/30 text-${tag2_color}-700 dark:text-${tag2_color}-300 rounded text-xs\">${tag2}</span>"
|
||||
fi
|
||||
|
||||
local buttons_html=""
|
||||
if [ -n "$docs_url" ]; then
|
||||
buttons_html="<a href=\"$docs_url\" target=\"_blank\" class=\"flex-1 text-center px-3 py-2 bg-gray-100 dark:bg-gray-800 hover:bg-gray-200 dark:hover:bg-gray-700 rounded-lg text-sm font-medium transition-colors\">
|
||||
<i class=\"fas fa-book mr-1\"></i>Docs
|
||||
</a>
|
||||
<a href=\"$github_url\" target=\"_blank\" class=\"flex-1 text-center px-3 py-2 bg-gray-100 dark:bg-gray-800 hover:bg-gray-200 dark:hover:bg-gray-700 rounded-lg text-sm font-medium transition-colors\">
|
||||
<i class=\"fab fa-github mr-1\"></i>GitHub
|
||||
</a>"
|
||||
else
|
||||
buttons_html="<a href=\"$github_url\" target=\"_blank\" class=\"flex-1 text-center px-3 py-2 bg-gray-100 dark:bg-gray-800 hover:bg-gray-200 dark:hover:bg-gray-700 rounded-lg text-sm font-medium transition-colors\">
|
||||
<i class=\"fab fa-github mr-1\"></i>GitHub
|
||||
</a>"
|
||||
fi
|
||||
|
||||
cat << CARD_EOF
|
||||
<!-- $name -->
|
||||
<div class="glass p-6 rounded-xl group hover:shadow-lg transition-all duration-300">
|
||||
<div class="flex items-start gap-4 mb-4">
|
||||
<div class="w-12 h-12 rounded-xl bg-gradient-to-br $colors flex items-center justify-center flex-shrink-0 group-hover:scale-110 transition-transform duration-300">
|
||||
<i class="fas $icon text-white text-lg"></i>
|
||||
</div>
|
||||
<div class="flex-1">
|
||||
<h3 class="font-bold text-gray-900 dark:text-gray-100 text-lg">$name</h3>
|
||||
<span class="text-xs text-gray-500 dark:text-gray-400">v$version</span>
|
||||
</div>
|
||||
</div>
|
||||
<p class="text-sm text-gray-600 dark:text-gray-400 mb-4">$desc</p>
|
||||
<div class="flex flex-wrap gap-2 mb-4">
|
||||
$tags_html
|
||||
</div>
|
||||
<div class="flex gap-2">
|
||||
$buttons_html
|
||||
</div>
|
||||
<pre class="mt-4 bg-gray-900 text-gray-100 p-3 rounded-lg text-xs overflow-x-auto"><code>brew install --cask lukaszraczylo/taps/$name</code></pre>
|
||||
</div>
|
||||
|
||||
CARD_EOF
|
||||
}
|
||||
|
||||
# Main
|
||||
echo "Generating documentation from Casks..."
|
||||
|
||||
if [ ! -f "$INDEX_FILE" ]; then
|
||||
echo "Error: $INDEX_FILE not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Generate casks HTML to temp file
|
||||
echo "" > "$TEMP_FILE"
|
||||
|
||||
for cask_file in "$CASKS_DIR"/*.rb; do
|
||||
if [ -f "$cask_file" ]; then
|
||||
name=$(basename "$cask_file" .rb)
|
||||
version=$(grep -m1 'version "' "$cask_file" | sed 's/.*version "\([^"]*\)".*/\1/' 2>/dev/null || echo "latest")
|
||||
desc=$(grep -m1 'desc "' "$cask_file" | sed 's/.*desc "\([^"]*\)".*/\1/' 2>/dev/null || echo "A Homebrew cask")
|
||||
|
||||
generate_cask_card "$name" "$version" "$desc" >> "$TEMP_FILE"
|
||||
fi
|
||||
done
|
||||
|
||||
# Now rebuild the index.html with the new casks content
|
||||
# Read and process the file
|
||||
{
|
||||
# Print everything up to and including CASKS_START
|
||||
sed -n '1,/<!-- CASKS_START -->/p' "$INDEX_FILE"
|
||||
# Print the generated casks
|
||||
cat "$TEMP_FILE"
|
||||
# Print everything from CASKS_END onwards
|
||||
sed -n '/<!-- CASKS_END -->/,$p' "$INDEX_FILE"
|
||||
} > "${INDEX_FILE}.new"
|
||||
|
||||
mv "${INDEX_FILE}.new" "$INDEX_FILE"
|
||||
rm -f "$TEMP_FILE"
|
||||
|
||||
echo "Documentation updated successfully!"
|
||||
Reference in New Issue
Block a user