Skip to content

Commit

Permalink
Improve accessibility of Font Awesome icons.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulhibbitts committed Jul 2, 2024
1 parent cf9a54b commit 6ad4efa
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 1 deletion.
96 changes: 96 additions & 0 deletions docs/assets/js/docsify-fontawesome.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
/*
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
/******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({

/***/ "./src/index.js":
/*!**********************!*\
!*** ./src/index.js ***!
\**********************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _plugin_fontawesome__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./plugin-fontawesome */ \"./src/plugin-fontawesome.js\");\n\n\n// if (!window.$docsify) {\n// window.$docsify = {}\n// }\nwindow.$docsify = window.$docsify || {};\nwindow.$docsify.plugins = (window.$docsify.plugins || []).concat(_plugin_fontawesome__WEBPACK_IMPORTED_MODULE_0__.install);\n\n\n//# sourceURL=webpack://docsify-fontawesome/./src/index.js?");

/***/ }),

/***/ "./src/plugin-fontawesome.js":
/*!***********************************!*\
!*** ./src/plugin-fontawesome.js ***!
\***********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"install\": () => (/* binding */ install)\n/* harmony export */ });\nfunction install(hook) {\n const faRegExp = /:fa[\\w -]+:/gm;\n\n hook.beforeEach(content => {\n let faHtmlRendered = content.replace(faRegExp, function (m, code) {\n console.log('m: ' + m.replace(/:/gi, ''));\n let rendered = `<i class=\"${m.replace(/:/gi, '')}\" aria-hidden=\"true\"></i>`;\n return rendered;\n });\n return faHtmlRendered;\n });\n hook.afterEach(function (html, next) {\n let faHtmlRendered = html.replace(faRegExp, function (m, code) {\n console.log('m: ' + m.replace(/:/gi, ''));\n let rendered = `<i class=\"${m.replace(/:/gi, '')}\" aria-hidden=\"true\"></i>`;\n return rendered;\n });\n //console.log('faHtmlRendered: '+faHtmlRendered);\n next(faHtmlRendered);\n });\n}\n\n\n//# sourceURL=webpack://docsify-fontawesome/./src/plugin-fontawesome.js?");

/***/ })

/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module can't be inlined because the eval devtool is used.
/******/ var __webpack_exports__ = __webpack_require__("./src/index.js");
/******/
/******/ })()
;
1 change: 1 addition & 0 deletions docs/assets/js/docsify-fontawesome.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@
<script src="assets/js/search.min.js"></script>

<!-- Font Awesome Plugin -->
<script src="https://unpkg.com/docsify-fontawesome/dist/docsify-fontawesome.min.js"></script>
<script src="assets/js/docsify-fontawesome.min.js"></script>

<!-- Tabs Plugin-->
<script src="https://cdn.jsdelivr.net/npm/docsify-tabs@1/dist/docsify-tabs.min.js"></script>
Expand Down

0 comments on commit 6ad4efa

Please sign in to comment.