Skip to content
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

Doc builder template should check for mkdocs_page_input_path before using it #3536

Merged
merged 2 commits into from
Apr 18, 2018
Merged

Conversation

marcelstoer
Copy link
Contributor

mkdocs_page_input_path isn't available on all pages.

@RichardLitt RichardLitt added Mkdocs Improvement Minor improvement to code labels Jan 22, 2018
@marcelstoer
Copy link
Contributor Author

Not sure about the 'Enhancement' label, feels more like a bug fix to me. Script execution currently fails because of the missing check:

readthedocs-data.js:21 Uncaught ReferenceError: mkdocs_page_input_path is not defined

@RichardLitt RichardLitt removed the Improvement Minor improvement to code label Jan 26, 2018
@davidfischer
Copy link
Contributor

To catch a JavaScript not defined error, you'd need to use typeof mkdocs_page_input_path !== 'undefined', correct?

@davidfischer davidfischer self-requested a review April 6, 2018 23:37
davidfischer added a commit to davidfischer/readthedocs.org that referenced this pull request Apr 6, 2018
@marcelstoer
Copy link
Contributor Author

I don't get it...Why did you create a new PR if you're not even sure that it offers any material improvement over this one? Why not just leave a code review question here?

@davidfischer
Copy link
Contributor

I tried your code and got a JS error. If you fix it, I'm happy to merge this one instead.

@marcelstoer
Copy link
Contributor Author

Ah, now that's valuable feedback. I don't mind either way. I'll certainly take a look but what's missing in your PR is the code comment why that if statement is even necessary.

@agjohnson agjohnson added this to the Mkdocs milestone Apr 10, 2018
@agjohnson agjohnson removed the Mkdocs label Apr 10, 2018
@davidfischer
Copy link
Contributor

I added that comment in there.

Copy link
Contributor

@davidfischer davidfischer left a comment

Choose a reason for hiding this comment

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

This replaces #3921

@davidfischer davidfischer merged commit 7f3573a into readthedocs:master Apr 18, 2018
@marcelstoer marcelstoer deleted the patch-1 branch April 18, 2018 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants