Skip to content

use mkdocs builtin search.html #2289

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

use mkdocs builtin search.html #2289

wants to merge 2 commits into from

Conversation

brendan-w
Copy link

@brendan-w brendan-w commented Jul 7, 2016

Currently, mkdocs projects have a search-box action of https://readthedocs.org/search/, which has been reported as inoperative in #1088 (and others). This PR changes this action to use the mkdocs builtin search.html page.

Also, in the process of making this patch, I found that mkdocs doesn't expose the mkdocs_page_input_path variable on non-content-bearing pages (such as search.html). Thus, I have placed a guard around it, to prevent it from ReferenceErroring while searching.

@agjohnson agjohnson added Needed: design decision A core team decision is required Mkdocs labels Jul 14, 2016
@@ -27,7 +27,9 @@ function init() {
value: 'file'
}).appendTo('#rtd-search-form');

$("#rtd-search-form").prop("action", rtd.api_host + "/search/");
var search_url = window.location.protocol + "//" + window.location.hostname +
"/" + rtd.language + "/" + rtd.version + "/search.html";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't respect subprojects and aliases. We can't assume the project path is https://hostname/language/version/search.html, it could be https://hostname/projects/subproject/language/version/search.html. Same for aliases here.

@agjohnson
Copy link
Contributor

I'm generally -1 on supporting multiple search UX, and would rather see mkdocs indexing and search fixed using our existing search API. Will need a design decision here.

benhyland pushed a commit to alphagov/paas-developer-docs that referenced this pull request Nov 30, 2016
MkDocs and Readthedocs don't currently agree on how to do search.
This means that search has poor UX on the publically deployed docs
on readthedocs.io.

Here's a workaround suggested in github comments that we could use
to fix things for us while we wait for the two projects to reconcile.

See:
readthedocs/readthedocs.org#2289
readthedocs/readthedocs.org#1088
benhyland pushed a commit to alphagov/paas-team-manual that referenced this pull request Nov 30, 2016
MkDocs and Readthedocs don't currently agree on how to do search.
This means that search has poor UX on the publically deployed docs
on readthedocs.io.

Here's a workaround suggested in github comments that we could use
to fix things for us while we wait for the two projects to reconcile.

See:
readthedocs/readthedocs.org#2289
readthedocs/readthedocs.org#1088
@ericholscher
Copy link
Member

Closing this, as I don't believe it's currently the solution to the problem of making search better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needed: design decision A core team decision is required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants