diff --git a/docs/requirements.txt b/docs/requirements.txt index db3bc09e4c..be6a44fcf8 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -2,7 +2,7 @@ sphinx==2.4.4 sphinx-multiversion==0.1.1 -lunr==0.5.6 +# lunr==0.5.6 # recommonmark custom branch with evennia-specific fixes git+https://github.com/evennia/recommonmark.git@evennia-mods#egg=recommonmark diff --git a/docs/source/_static/js/lunr/search.js b/docs/source/_static/js/lunr/search.js deleted file mode 100644 index 124809e12b..0000000000 --- a/docs/source/_static/js/lunr/search.js +++ /dev/null @@ -1,95 +0,0 @@ -// -// Using the pre-generated index file, set up a dynamic -// search mechanims that returns quick suggestions of the -// best matches you start to enter. -// - -var lunrIndex, - $results, - documents; - -function initLunr() { - // retrieve the index file - $.getJSON("_static/js/lunr/search_index.json") - .done(function(index) { - - lunrIndex = lunr.Index.load(index) - - // documents = index; - - // lunrIndex = lunr(function(){ - // this.ref('url') - // this.field('body') - - // this.field("title", { - // boost: 10 - // }); - - // documents.forEach(function(doc) { - // try { - // this.add(doc) - // } catch (e) {} - // }, this) - // }) - }) - .fail(function(jqxhr, textStatus, error) { - var err = textStatus + ", " + error; - console.error("Error getting Lunr index file:", err); - }); -} - -function search(query) { - return lunrIndex.search(query).map(function(result) { - return documents.filter(function(page) { - try { - console.log(page) - return page.href === result.ref; - } catch (e) { - console.log('Error in search. ' + e) - } - })[0]; - }); -} - -function renderResults(results) { - if (!results.length) { - return; - } - - // show first ten results - results.slice(0, 10).forEach(function(result) { - var $result = $("