WebCodeOptimizer is a tool designed to optimize web code by compressing HTML, CSS, and JavaScript files and removing unused images from your project. The optimization process ensures that your code remains error-free and bug-free while improving performance by reducing file sizes and eliminating unnecessary resources.
- HTML, CSS, and JavaScript Optimization: Compresses your web files to reduce their size without affecting functionality.
- Image Management: Automatically detects and removes images that are not used in your project.
- Error-Free Optimization: Ensures that the optimization process does not introduce any errors or bugs into your project.
Follow these steps to install and set up the WebCodeOptimizer:
First, clone the repository to your local machine:
git clone https://github.com/codeterrayt/WebCodeOptimizer.git
cd WebCodeOptimizer
To install WebCodeOptimizer, follow these steps:
- Create a virtual environment (venv) for your project.
python -m venv venv
- Activate the venv.
venv\Scripts\activate
- Install the required modules using
requirements.txt
.
pip install -r requirements.txt
Create an instance of the ProjectOptimizer
class, passing two paths as arguments:
proj = ProjectOptimizer(r"./code/", r"./optimized/")
The first path is for the main code, and the second path is where to create the optimized code folder.
- Clone the project folder:
proj.CreateClone()
- Find all HTML, CSS, JS, and image files in the project:
proj.FindAllHTML()
proj.FindAllJS()
proj.FindAllCSS()
proj.FindImagesInProjectHTML()
- Remove unused images:
proj.RemoveUnUsedImages()
- Compress HTML, CSS, and JS files:
proj.CompressHTML()
proj.CompressJS()
proj.CompressCSS()
Clones the project folder.
Finds all HTML, CSS, and JS files in the project.
Finds images referenced in HTML files in the project.
Removes unused images from the project.
Compresses HTML, CSS, and JS files using various optimization techniques.
We welcome contributions to the WebCodeOptimizer project! Whether you're fixing bugs, adding new features, improving documentation, or helping out in any other way, your input is greatly appreciated.
WebCodeOptimizer is licensed under the MIT License. See LICENSE for details.