Skip to content

Commit

Permalink
Merge pull request #5121 from stsewd/remove-doctype-from-search
Browse files Browse the repository at this point in the history
Remove doctype from search
  • Loading branch information
stsewd committed Jan 22, 2019
2 parents 09695c4 + 9d9947a commit 44a4fe3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
10 changes: 5 additions & 5 deletions readthedocs/projects/models.py
Expand Up @@ -654,11 +654,11 @@ def full_dash_path(self, version=LATEST):

def full_json_path(self, version=LATEST):
"""The path to the build json docs in the project."""
if 'sphinx' in self.documentation_type:
return os.path.join(self.conf_dir(version), '_build', 'json')

if 'mkdocs' in self.documentation_type:
return os.path.join(self.checkout_path(version), '_build', 'json')
json_path = os.path.join(
self.conf_dir(version),
'_build', 'json'
)
return json_path

def full_singlehtml_path(self, version=LATEST):
"""The path to the build singlehtml docs in the project."""
Expand Down
13 changes: 4 additions & 9 deletions readthedocs/projects/tasks.py
Expand Up @@ -741,6 +741,7 @@ def update_app_instances(
callback=sync_callback.s(
version_pk=self.version.pk,
commit=self.build['commit'],
search=search,
),
)

Expand Down Expand Up @@ -1037,14 +1038,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(
Expand Down Expand Up @@ -1404,7 +1398,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'):
update_search(version_pk, commit=commit)


@app.task()
Expand Down

0 comments on commit 44a4fe3

Please sign in to comment.