diff --git a/ChangeLog.md b/ChangeLog.md index 65b19a7c4d..abdba8c938 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -115,6 +115,7 @@ Bug fixes: See [#3366](https://github.com/commercialhaskell/stack/pull/3366). * `stack script` can now handle relative paths to source files. See [#3372](https://github.com/commercialhaskell/stack/issues/3372). +<<<<<<< HEAD * Fixes explanation of why a target is needed by the build plan, when the target is an extra dependency from the commandline. See [#3378](https://github.com/commercialhaskell/stack/issues/3378). @@ -122,6 +123,10 @@ Bug fixes: trust the etag and not re-download. Fixed in this version. * Invoking `stack --docker` in parallel now correctly locks the sqlite database. See [#3400](https://github.com/commercialhaskell/stack/issues/3400). +* docs.haskellstack.org RTD documentation search is replaced by the mkdocs + search. Please see + [#3376](https://github.com/commercialhaskell/stack/issues/3376). + ## 1.5.1 diff --git a/etc/mkdocsjs/searchhack.js b/etc/mkdocsjs/searchhack.js new file mode 100644 index 0000000000..03608c2163 --- /dev/null +++ b/etc/mkdocsjs/searchhack.js @@ -0,0 +1,29 @@ +// Please see https://github.com/commercialhaskell/stack/issues/3376 + +(function () { + $(document).ready(function () { + fixSearch(); + }); + + function fixSearch() { + var target = document.getElementById('rtd-search-form'); + var config = {attributes: true, childList: true}; + + var observer = new MutationObserver(function(mutations) { + observer.disconnect(); + var form = $('#rtd-search-form'); + form.empty(); + form.attr('action', 'https://' + window.location.hostname + '/en/' + determineSelectedBranch() + '/search.html'); + $('').attr({ + type: "text", + name: "q", + placeholder: "Search docs" + }).appendTo(form); + }); + + if (window.location.origin.indexOf('readthedocs') > -1) { + observer.observe(target, config); + } + } + +})(); diff --git a/mkdocs.yml b/mkdocs.yml index 5294458227..d615e4450f 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -38,3 +38,6 @@ pages: markdown_extensions: - toc: permalink: true + +extra_javascript: +- etc/mkdocsjs/searchhack.js