HaTeMiLe (HTML Accessible) is a library that can convert a HTML code in a HTML code more accessible.
- Associate HTML elements;
- Provide a polyfill to CSS Speech and CSS Aural properties;
- Display inacessible informations of page;
- Enable all functionality of page available from a keyboard;
- Improve the acessibility of forms;
- Provide accessibility resources to navigate.
To generate the full API documentation of HaTeMiLe of PHP:
Import all needed classes:
require_once './phpQuery/phpQuery/phpQuery.php';
require_once './hatemile-for-php/src/hatemile/implementation/AccessibleAssociationImplementation.php';
require_once './hatemile-for-php/src/hatemile/implementation/AccessibleCSSImplementation.php';
require_once './hatemile-for-php/src/hatemile/implementation/AccessibleDisplayScreenReaderImplementation.php';
require_once './hatemile-for-php/src/hatemile/implementation/AccessibleEventImplementation.php';
require_once './hatemile-for-php/src/hatemile/implementation/AccessibleFormImplementation.php';
require_once './hatemile-for-php/src/hatemile/implementation/AccessibleNavigationImplementation.php';
require_once './hatemile-for-php/src/hatemile/util/Configure.php';
require_once './hatemile-for-php/src/hatemile/util/css/phpcssparser/PHPCSSParser.php';
require_once './hatemile-for-php/src/hatemile/util/html/phpquery/PhpQueryHTMLDOMParser.php';
use hatemile\implementation\AccessibleAssociationImplementation;
use hatemile\implementation\AccessibleCSSImplementation;
use hatemile\implementation\AccessibleDisplayScreenReaderImplementation;
use hatemile\implementation\AccessibleEventImplementation;
use hatemile\implementation\AccessibleFormImplementation;
use hatemile\implementation\AccessibleNavigationImplementation;
use hatemile\util\Configure;
use hatemile\util\css\phpcssparser\PHPCSSParser;
use hatemile\util\html\phpquery\PhpQueryHTMLDOMParser;
Instanciate the configuration, the parsers and solution classes and execute them:
$configure = new Configure();
$parser = new PhpQueryHTMLDOMParser($content);
$cssParser = new PHPCSSParser($parser);
$accessibleEvent = new AccessibleEventImplementation($parser, $configure);
$accessibleCSS = new AccessibleCSSImplementation(
$parser,
$cssParser,
$configure
);
$accessibleForm = new AccessibleFormImplementation($parser, $configure);
$accessibleNavigation = new AccessibleNavigationImplementation(
$parser,
$configure
);
$accessibleAssociation = new AccessibleAssociationImplementation(
$parser,
$configure
);
$accessibleDisplay = new AccessibleDisplayScreenReaderImplementation(
$parser,
$configure
);
$accessibleEvent->makeAccessibleAllDragandDropEvents();
$accessibleEvent->makeAccessibleAllClickEvents();
$accessibleEvent->makeAccessibleAllHoverEvents();
$accessibleForm->markAllAutoCompleteFields();
$accessibleForm->markAllRequiredFields();
$accessibleForm->markAllRangeFields();
$accessibleForm->markAllInvalidFields();
$accessibleNavigation->provideNavigationByAllHeadings();
$accessibleNavigation->provideNavigationByAllSkippers();
$accessibleNavigation->provideNavigationToAllLongDescriptions();
$accessibleAssociation->associateAllDataCellsWithHeaderCells();
$accessibleAssociation->associateAllLabelsWithFields();
$accessibleDisplay->displayAllShortcuts();
$accessibleDisplay->displayAllRoles();
$accessibleDisplay->displayAllCellHeaders();
$accessibleDisplay->displayAllWAIARIAStates();
$accessibleDisplay->displayAllLinksAttributes();
$accessibleDisplay->displayAllTitles();
$accessibleDisplay->displayAllLanguages();
$accessibleDisplay->displayAllAlternativeTextImages();
$accessibleNavigation->provideNavigationByAllSkippers();
$accessibleDisplay->displayAllShortcuts();
$accessibleCSS->provideAllSpeakProperties();
echo $parser->getHTML();
If you want contribute with HaTeMiLe for PHP, read contributing guidelines.