-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Remove doctype from search #5121
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
Changes from 1 commit
517dd2d
3c2e24f
4b870f1
0cf8f1a
9d9947a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -729,6 +729,7 @@ def update_app_instances(self, html=False, localmedia=False, search=False, | |
callback=sync_callback.s( | ||
version_pk=self.version.pk, | ||
commit=self.build['commit'], | ||
kwargs={'search': search}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is ending up:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixing in a push. |
||
), | ||
) | ||
|
||
|
@@ -1010,14 +1011,7 @@ def update_search(version_pk, commit, delete_non_commit_files=True): | |
""" | ||
version = Version.objects.get(pk=version_pk) | ||
|
||
if 'sphinx' in version.project.documentation_type: | ||
page_list = process_all_json_files(version, build_dir=False) | ||
else: | ||
log.debug( | ||
'Unknown documentation type: %s', | ||
version.project.documentation_type | ||
) | ||
return | ||
page_list = process_all_json_files(version, build_dir=False) | ||
|
||
log_msg = ' '.join([page['path'] for page in page_list]) | ||
log.info("(Search Index) Sending Data: %s [%s]", version.project.slug, | ||
|
@@ -1350,7 +1344,8 @@ def sync_callback(_, version_pk, commit, *args, **kwargs): | |
The first argument is the result from previous tasks, which we discard. | ||
""" | ||
fileify(version_pk, commit=commit) | ||
update_search(version_pk, commit=commit) | ||
if kwargs.get('search'): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This shouldn't be needed bc the search code was updated too, but just in case. |
||
update_search(version_pk, commit=commit) | ||
|
||
|
||
@app.task() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, this is called from
process_all_json_files
https://github.com/rtfd/readthedocs.org/blob/f06271b698d26734bf5024590948d41b1613b2e3/readthedocs/search/parse_json.py#L21-L26
And is used in
os.walk
, if the path doesn't exists (mkdocs for example), it doesn't raise an error, it just returns an empty iterator.