|
14 | 14 | **[View the interactive showcase website β](https://bigBrodyG.github.io/JavaProjects/)** |
15 | 15 |
|
16 | 16 | All projects are automatically compiled and run with each commit. The website displays source code, build status, and program output. |
| 17 | + |
| 18 | +--- |
| 19 | + |
| 20 | +## π Automatic Documentation Generator |
| 21 | + |
| 22 | +This repository includes an **automatic documentation generator** that scans all Java projects and creates a beautiful interactive showcase website. |
| 23 | + |
| 24 | +### β¨ Features |
| 25 | + |
| 26 | +- π **Auto-discovery**: Automatically finds all Java projects in the workspace |
| 27 | +- ποΈ **Auto-compilation**: Compiles and runs each project to capture output |
| 28 | +- π **HTML Generation**: Creates individual interactive pages for each project |
| 29 | +- π¨ **Beautiful UI**: Modern dark theme with syntax highlighting |
| 30 | +- βΆοΈ **Run in Browser**: Execute code with animated output display |
| 31 | +- π **Index Page**: Auto-generated overview of all projects |
| 32 | + |
| 33 | +### π― How It Works |
| 34 | + |
| 35 | +#### When you create a new Java project: |
| 36 | + |
| 37 | +1. Create a new directory (e.g., `MyNewProject/`) |
| 38 | +2. Add the standard structure: |
| 39 | + ``` |
| 40 | + MyNewProject/ |
| 41 | + βββ src/ |
| 42 | + β βββ MyNewProject.java (with main method) |
| 43 | + βββ bin/ |
| 44 | + βββ lib/ |
| 45 | + ``` |
| 46 | + |
| 47 | +3. Run the generator: |
| 48 | + ```bash |
| 49 | + ./generate-docs.py |
| 50 | + ``` |
| 51 | + or |
| 52 | + ```bash |
| 53 | + python3 generate-docs.py |
| 54 | + ``` |
| 55 | + |
| 56 | +4. **That's it!** Your project is automatically: |
| 57 | + - β
Compiled and tested |
| 58 | + - β
Added to the website with its own page |
| 59 | + - β
Listed on the index page |
| 60 | + - β
Output captured and displayed |
| 61 | + |
| 62 | +### π Project Structure |
| 63 | + |
| 64 | +Each Java project should follow this structure: |
| 65 | + |
| 66 | +``` |
| 67 | +ProjectName/ |
| 68 | +βββ src/ # Source files |
| 69 | +β βββ *.java # Your Java files (one must have main method) |
| 70 | +βββ bin/ # Compiled classes (auto-generated) |
| 71 | +βββ lib/ # External libraries (optional) |
| 72 | +βββ README.md # Project documentation (optional) |
| 73 | +``` |
| 74 | + |
| 75 | +### π¨ Project Types |
| 76 | + |
| 77 | +The generator automatically categorizes projects: |
| 78 | + |
| 79 | +- **π Teoria (Theory)**: Basic concepts, classes (e.g., Cerchio, Punto, Rettangolo, Libro) |
| 80 | +- **π¬ Laboratorio (Lab)**: Practical exercises (e.g., mergeArray, vocalcount, OggettoCD) |
| 81 | + |
| 82 | +### π§ Manual Customization |
| 83 | + |
| 84 | +If you want to customize project descriptions or types, edit the script: |
| 85 | + |
| 86 | +```python |
| 87 | +# In generate-docs.py |
| 88 | + |
| 89 | +def generate_project_description(project: Dict) -> str: |
| 90 | + descriptions = { |
| 91 | + 'yourproject': 'Your custom description here', |
| 92 | + # Add more... |
| 93 | + } |
| 94 | +``` |
| 95 | + |
| 96 | +### π¦ Generated Files |
| 97 | + |
| 98 | +After running the generator, you'll find in `docs/`: |
| 99 | + |
| 100 | +``` |
| 101 | +docs/ |
| 102 | +βββ index.html # Main showcase page |
| 103 | +βββ projectname.html # Individual project page |
| 104 | +βββ projectname-output.txt # Captured output |
| 105 | +βββ ... |
| 106 | +``` |
| 107 | + |
| 108 | +### π View the Showcase |
| 109 | + |
| 110 | +Open `docs/index.html` in your browser to see all your projects! |
| 111 | + |
| 112 | +### π οΈ Requirements |
| 113 | + |
| 114 | +- Python 3.6+ |
| 115 | +- Java JDK (javac and java commands available) |
| 116 | +- No additional Python packages required (uses only standard library) |
| 117 | + |
| 118 | +### π‘ Quick Start |
| 119 | + |
| 120 | +1. Create a new Java project in the workspace |
| 121 | +2. Run `./generate-docs.py` |
| 122 | +3. Open `docs/index.html` in browser |
| 123 | +4. Enjoy! π |
| 124 | + |
| 125 | +--- |
0 commit comments