diff --git a/docs/README.md b/docs/README.md index c065c40..525b7df 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,8 +1,9 @@ # AE Modular Wiki + This is the Wiki for the AE Modular Synthesizer Format -[[getting-started.md | Get Started]] +[Getting Started](getting-started.md) [Module Documentation](/modules/) diff --git a/docs/_404.md b/docs/_404.md new file mode 100644 index 0000000..cbdcba3 --- /dev/null +++ b/docs/_404.md @@ -0,0 +1,8 @@ + + +# 404 - Page Not Found + +The page you requested doesn’t exist. +Trying alternative fallbacks... + +
\ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 5299760..02b7a81 100644 --- a/docs/index.html +++ b/docs/index.html @@ -31,6 +31,7 @@ loadNavbar: true, loadFooter: true, auto2top: true, + notFoundPage: '_404.md', }; @@ -47,7 +48,6 @@ src="//cdn.jsdelivr.net/npm/docsify-darklight-theme@3/dist/docsify-themeable/index.min.js" type="text/javascript"> - diff --git a/docs/modules/cat_IMDI.md b/docs/modules/cat_IMDI.md index 812dce1..52e9b73 100644 --- a/docs/modules/cat_IMDI.md +++ b/docs/modules/cat_IMDI.md @@ -2,7 +2,7 @@ IMDI is the name given to the use of the MIDI protocol within AE Modular, allowing MIDI signals to be patched between compatible modules as easily as CV or audio signals - using single patch cables! First introduced by Wonkystuff with the [mb/1](/modules/wonkystuff/mb1.md) module in 2023, it has since been incorporated into the mainstream Tangible Waves modules giving us a *very* powerful way of controlling our systems! -For an overview of MIDI integration, take a look here: [[IMDI]] +For an overview of MIDI integration, [take a look here](/IMDI.md) ## Modules diff --git a/docs/modules/wonkystuff/_navbar.md b/docs/modules/wonkystuff/_navbar.md index 422f9c4..0639ebe 100644 --- a/docs/modules/wonkystuff/_navbar.md +++ b/docs/modules/wonkystuff/_navbar.md @@ -1,8 +1,3 @@ - -AE Modular Logo - - -AE Modular Wiki - +* [](/) * [Modules](/modules/) * [Getting Started](/getting-started.md) \ No newline at end of file diff --git a/docs/plugins/load_plugins.js b/docs/plugins/load_plugins.js index 6b275c6..982c334 100644 --- a/docs/plugins/load_plugins.js +++ b/docs/plugins/load_plugins.js @@ -2,3 +2,4 @@ import './images.js' import './pmmarkup.js' import './toc.js' import './wikilinks.js' +import './redirect.js' diff --git a/docs/plugins/redirect.js b/docs/plugins/redirect.js new file mode 100644 index 0000000..71496ae --- /dev/null +++ b/docs/plugins/redirect.js @@ -0,0 +1,71 @@ +'use strict'; +function plugin(hook, vm) { + const fallbacks = ['tangiblewaves', 'bfsynth', 'fauxcyrillic', 'kyaa', 'wonkystuff']; + + hook.doneEach(function () { + const contentEl = document.querySelector('.content'); + + if (!contentEl) return; + + // Detect 404 page by marker + if (!contentEl.innerHTML.includes('DOCSIFY_404_MARKER')) return; + + const fallbackLog = document.getElementById('fallback-log'); + if (!fallbackLog) return; + + // Extract original slug from current hash + let hash = location.hash; // e.g. "#/modules/kick" + const match = hash.match(/^#\/modules\/([^\/]+)$/); + if (!match) return; + + const slug = match[1]; + + // Track which fallback we are on + let index = parseInt(sessionStorage.getItem('fallbackIndex') || '0', 10); + + function tryNextFallback() { + if (index >= fallbacks.length) { + sessionStorage.removeItem('fallbackIndex'); + fallbackLog.textContent += "\nAll fallbacks tried. Showing 404."; + return; // no more fallbacks + } + + const prefix = fallbacks[index]; + const newHash = '#/modules/' + prefix + '/' + slug; + index++; + sessionStorage.setItem('fallbackIndex', index); + + fallbackLog.textContent += `Trying fallback: ${prefix}...\n`; + + // Update hash → Docsify will render new page + location.hash = newHash; + + // Wait for Docsify to render the new route + setTimeout(() => { + const newContentEl = document.querySelector('.content'); + if (!newContentEl) return; + + // If still 404, try next fallback + if (newContentEl.innerHTML.includes('DOCSIFY_404_MARKER')) { + tryNextFallback(); + } else { + // Success → reset + sessionStorage.removeItem('fallbackIndex'); + fallbackLog.textContent += `Loaded fallback: ${prefix}\n`; + } + }, 300); + } + + tryNextFallback(); + }); + } +if (typeof window !== "undefined") { + if (!window.$docsify) { + console.error('no docsify'); + } else { + window.$docsify.plugins = [].concat(plugin, window.$docsify.plugins); + } +} else { + module.exports = {plugin} +} +