A Visual Studio Code extension that provides offline HTML validation using W3C standards. This extension integrates the W3C Nu HTML Checker directly into VSCode, allowing you to validate your HTML files without an internet connection. All necessary binaries are included in the package, ensuring seamless setup and operation.
Offline HTML Validation: Validate your HTML files using W3C standards without needing an internet connection.
Automatic Validation on Save: Automatically validates HTML files every time you save them.
Status Bar Integration:
Clickable Icon: Easily enable or disable validation on save by clicking the status bar item.
Error and Warning Indicators:
Background Colors:
Red Background: Validation errors detected.
Green Background: Validation passed with no errors or warnings.
Gray Background: Validation is disabled.
Icons:
$(check): Validation is enabled and passed.
$(error): Validation errors detected.
$(x): Validation is disabled.
Quick Access to Problems Pane: When errors are present, clicking the status bar item opens the Problems pane.
Error and Warning Diagnostics:
Validation errors and warnings are displayed in the Problems pane.
Errors and warnings are highlighted directly in the editor for easy identification.
Persistent Settings:
Validation state (enabled/disabled) is saved between sessions.
Configuration options are available for advanced users to customize the extension behavior.
Requirements
Visual Studio Code version 1.93.0 or higher.
Operating System: Windows, macOS, or Linux.
No additional installations required: All necessary binaries are included.
Installation
Install the Extension:
Search for "W3C Offline HTML Validator" in the VSCode Extensions Marketplace.
Click Install.
Reload VSCode:
After installation, reload VSCode to activate the extension.
Usage
Automatic Validation on Save
The extension automatically validates any HTML file when you save it.
If there are validation errors or warnings, they will appear in the Problems pane and be highlighted in the editor.
Enabling/Disabling Validation
Toggle Validation:
Click the "HTML Validator" status bar item to enable or disable validation.
Persistent Setting:
The validation state is saved globally and persists across sessions.
Extension Settings
The extension contributes the following settings:
htmlValidator.vnuExecutable:
Type: string
Default: (Automatically set based on OS)
Description: Path to the vnu executable file.
Usage: Advanced users can specify a custom path to the vnu executable if needed.
htmlValidator.showErrorMessages:
Type: boolean
Default: true
Description: Show error messages when validation errors are detected.
htmlValidator.showWarningMessages:
Type: boolean
Default: true
Description: Show warning messages when validation warnings are detected.
htmlValidator.showOkMessages:
Type: boolean
Default: true
Description: Show messages when validation passes without errors or warnings.
htmlValidator.autoOpenProblems:
Type: boolean
Default: true
Description: Automatically open the Problems pane when validation errors are detected.
Known Issues
Auto-Dismiss Pop-up Messages:
The extension uses status bar messages instead of pop-up notifications to inform about validation results due to limitations in programmatically dismissing pop-ups.
Performance on Large Files:
Validation may be slower for very large HTML files.
Release Notes
0.0.14
Notifications:
Auto hide notifications
0.0.11 - 0.0.13
UI/UX Improvements:
Added color-coded backgrounds to the status bar item to indicate validation status:
Green Background: Validation passed.
Red Background: Validation errors detected.
Gray Background: Validation is disabled.
Status bar item now provides quick access to the Problems pane when errors are present.
Settings:
Introduced new settings to control notifications and behavior:
htmlValidator.showErrorMessages
htmlValidator.showWarningMessages
htmlValidator.showOkMessages
htmlValidator.autoOpenProblems
README.md:
Updated documentation to reflect new features and settings.
0.0.10
Refactor
0.0.9
Status Bar Item:
Added status bar integration for toggling validation.
Displays validation status and errors.
Persistent Settings:
Validation state is stored globally and persists between sessions.
0.0.2 - 0.0.8
Improvements
0.0.1
Initial Release:
Basic offline HTML validation on save.
Inclusion of all necessary binaries for cross-platform support.
Contributing
Contributions are welcome! Please follow these steps: