diff --git a/CNAME b/CNAME deleted file mode 100644 index f9e262e8..00000000 --- a/CNAME +++ /dev/null @@ -1 +0,0 @@ -docs.m5stack.com \ No newline at end of file diff --git a/src/js/index.js b/src/js/index.js deleted file mode 100644 index 6c78d105..00000000 --- a/src/js/index.js +++ /dev/null @@ -1,65 +0,0 @@ -// Dependencies -// ============================================================================= -import cssVars from 'css-vars-ponyfill'; -import pluginFixCoverHeader from './plugin-fix-cover-header'; -import pluginFixNavbarMenus from './plugin-fix-navbar-menus'; -import pluginFixPrismThemes from './plugin-fix-prism-themes'; -import pluginFixReadyState from './plugin-fix-ready-state'; -import pluginFixSearchClearButton from './plugin-fix-search-clear-button'; -import pluginFixSearchResults from './plugin-fix-search-results'; -import pluginFixZoomImage from './plugin-fix-zoomimage'; -import pluginReadyTransition from './plugin-ready-transition'; -import pluginResponsiveTables from './plugin-responsive-tables'; -import { version as pkgVersion } from '../../package.json'; - - -// Main -// ============================================================================= -// Docsify plugins -if (window) { - const cssVarsOptions = { - // Force ponyfill on Edge 15/16 due to numerous custom property bugs - // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/?page=1&q=%22custom%20property%22%20%22custom%20properties%22%20%22css%20variable%22%20%22css%20variables%22 - onlyLegacy: !(/Edge\/15|Edge\/16./i.test(navigator.userAgent)), - silent : true - }; - - // CSS custom properties ponyfill - cssVars(cssVarsOptions); - - window.$docsify = window.$docsify || {}; - - // Add plugins - window.$docsify.plugins = [].concat( - // Prepend - [ - pluginReadyTransition, - pluginFixCoverHeader, - pluginFixNavbarMenus, - pluginFixPrismThemes, - pluginFixReadyState, - pluginResponsiveTables - ], - // Existing - (window.$docsify.plugins || []), - // Append - [ - pluginFixSearchClearButton, - pluginFixSearchResults, - pluginFixZoomImage - ] - ); - - // Add themeable object - window.$docsify.themeable = window.$docsify.themeable || {}; - - // Add themeable properties - window.$docsify.themeable.version = pkgVersion; - - // Add themeable utilities - window.$docsify.themeable.util = { - cssVars: function(options = cssVarsOptions) { - cssVars(options); - } - }; -} diff --git a/src/js/plugin-fix-cover-header.js b/src/js/plugin-fix-cover-header.js deleted file mode 100644 index d986e237..00000000 --- a/src/js/plugin-fix-cover-header.js +++ /dev/null @@ -1,12 +0,0 @@ -// Plugin -// ============================================================================= -// Removes unnecessary wrapper around

content in coverpage -export default function(hook, vm) { - hook.doneEach(function() { - const coverHeaderLink = document.querySelector('.cover h1 > a'); - - if (coverHeaderLink) { - coverHeaderLink.parentNode.innerHTML = coverHeaderLink.innerHTML; - } - }); -} diff --git a/src/js/plugin-fix-navbar-menus.js b/src/js/plugin-fix-navbar-menus.js deleted file mode 100644 index 05a65561..00000000 --- a/src/js/plugin-fix-navbar-menus.js +++ /dev/null @@ -1,70 +0,0 @@ -// Functions -// ============================================================================= -/** - * Wraps direct descendant text nodes in the HTML tag specified with a tab - * index attribute. - * - * @param {object} elm The element containing text nodes - * @param {string} wrapTag The tag to wrap text nodes with - * @param {number|string} [tabIndex=null] The wrapTag tabIndex value - */ -function wrapTextNodes(elm, wrapTag, tabIndex = null) { - const hasTextNodes = elm.childNodes[0].nodeType === 3; - const menuElm = elm.querySelector('ul'); - - if (hasTextNodes && menuElm) { - const hasChildWithTabIndex = Array.apply(null, elm.children).some(child => child.tabIndex > -1).length; - - // Wrap non-link labels - if (!hasChildWithTabIndex) { - const wrapElm = document.createElement('span'); - - if (tabIndex !== null) { - wrapElm.setAttribute('tabindex', tabIndex); - } - - elm.insertBefore(wrapElm, menuElm); - - while(elm.childNodes[0] !== wrapElm) { - wrapElm.appendChild(elm.childNodes[0]); - } - } - } -} - -// Plugin -// ============================================================================= -// 1. Wraps top-level navbar
  • non-link labels in a with a tabindex -// attribute to allow touch-based devices to display drop menus on :hover. -// 2. Toggles 'focus-within' class to simulate native :focus-within behavior -export default function(hook, vm) { - hook.doneEach(function() { - const navbarItems = Array.apply(null, document.querySelectorAll('body > nav.app-nav > ul > li')); - const sidebarItems = Array.apply(null, document.querySelectorAll('.sidebar > nav > ul > li')); - - // Standard navigation bar - navbarItems.forEach(item => { - const focusClassName = 'focus-within'; - - wrapTextNodes(item, 'span', 0); - - // Simulate :focus-within - item.addEventListener('focusin', evt => { - if (item.contains(document.activeElement)) { - item.classList.add(focusClassName); - } - }); - - item.addEventListener('focusout', evt => { - if (!item.contains(document.activeElement)) { - item.classList.remove(focusClassName); - } - }); - }); - - // Merged nav bar in sidebar via 'mergeNavbar' option - sidebarItems.forEach(item => { - wrapTextNodes(item, 'span'); - }); - }); -} diff --git a/src/js/plugin-fix-prism-themes.js b/src/js/plugin-fix-prism-themes.js deleted file mode 100644 index 7190e80c..00000000 --- a/src/js/plugin-fix-prism-themes.js +++ /dev/null @@ -1,16 +0,0 @@ -// Plugin -// ============================================================================= -// Updates and
     class names for Prism.js theme compatibility
    -export default function(hook, vm) {
    -    hook.doneEach(function() {
    -        const preElms = Array.apply(null, document.querySelectorAll('pre[data-lang]'));
    -
    -        preElms.forEach(preElm => {
    -            const codeElm    = preElm.querySelector('code');
    -            const prismClass = `language-${preElm.getAttribute('data-lang')}`;
    -
    -            preElm.classList.add(prismClass);
    -            codeElm.classList.add(prismClass);
    -        });
    -    });
    -}
    diff --git a/src/js/plugin-fix-ready-state.js b/src/js/plugin-fix-ready-state.js
    deleted file mode 100644
    index 7db330b8..00000000
    --- a/src/js/plugin-fix-ready-state.js
    +++ /dev/null
    @@ -1,20 +0,0 @@
    -// Plugin
    -// =============================================================================
    -// Fixes docsify's incorrect addition of the "ready" state class to the 
    -// element before the ready event has actually fired
    -export default function(hook, vm) {
    -    // 404 Fix
    -    hook.mounted(function() {
    -        const contentElm = document.querySelector('.content');
    -        const readyCheck = setInterval(function() {
    -            if (contentElm.textContent.length) {
    -                document.body.classList.add('ready-fix');
    -                clearInterval(readyCheck);
    -            }
    -        }, 250);
    -    });
    -
    -    hook.ready(function() {
    -        document.body.classList.add('ready-fix');
    -    });
    -}
    diff --git a/src/js/plugin-fix-search-clear-button.js b/src/js/plugin-fix-search-clear-button.js
    deleted file mode 100644
    index 20a3f1a5..00000000
    --- a/src/js/plugin-fix-search-clear-button.js
    +++ /dev/null
    @@ -1,27 +0,0 @@
    -// Plugin
    -// =============================================================================
    -// Replaces docsify's "clear search" button:
    -// - Use a