The HTML Style Converter CLI is a command-line tool that incorporates the functionality of the HTML Style Converter npm package, allowing you to perform bulk conversions of HTML files. It provides a convenient way to convert inline styles to CSS classes and vice versa in multiple HTML documents simultaneously.
You can install the HTML Style Converter CLI globally using npm:
npm install -g html-style-converter-cli
To use the HTML Style Converter CLI, run the following command:
html-style-converter `<command>` [options]
toclass
: Converts inline styles to CSS classes in HTML files.toinline
: Converts CSS classes to inline styles in HTML files.
-i, --input <directory or file path>
: Specifies the input directory containing the HTML files to be converted.-o, --output <directory>
: Specifies the output directory where the converted HTML files will be saved. (Optional: If not provided, the converted files will overwrite the original files.)-h, --help
: Displays the help information for the CLI.
Convert inline styles to CSS classes in HTML files within a directory:
html-style-converter toclass -i ./input-directory -o ./output-directory
Convert CSS classes to inline styles in HTML files within a directory:
html-style-converter toinline -i ./input-directory -o ./output-directory
The CLI tool also allows for HTML file path instead of input directory:
html-style-converter toinline -i ./input-directory/example.html -o ./output-directory
Contributions are welcome! If you have any suggestions, bug reports, or feature requests, please open an issue or submit a pull request.
This project is licensed under the MIT License.