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

Docstring doctest failures missing if calling makedocs multiple times #974

Closed
mortenpi opened this issue Feb 27, 2019 · 6 comments · Fixed by #1948
Closed

Docstring doctest failures missing if calling makedocs multiple times #974

mortenpi opened this issue Feb 27, 2019 · 6 comments · Fixed by #1948

Comments

@mortenpi
Copy link
Member

Not sure what's up, but if you use the workflow where you include("make.jl") multiple times in a REPL session (to avoid recompilation) , then doctest errors that arise from docstrings are only shown the first time you include and are missing in later includes.

julia> include("docs/make.jl")
# doctest failures show up
julia> include("docs/make.jl")
# doctest failures don't show up anymore
@fredrikekre
Copy link
Member

This only happens for doctests included in docstrings and not doctests from markdown files.

@mortenpi
Copy link
Member Author

mortenpi commented Mar 20, 2019

Hmm.. it might be because we modify the Markdown.MD object when we go over the doctest (replace jldoctest as a language with julia). The Markdown AST of the files gets re-parsed when makedocs runs again, but not the docstrings.

@fredrikekre
Copy link
Member

Hmm.. it might be because we're modify the Markdown.MD object when we go over the doctest (replace jldoctest as a language with julia)

Yes, on the second run the language is julia-repl.

The Markdown AST of the files gets re-parsed when makedocs runs again, but not the docstrings.

How? Are thosed saved somewhere then?

@mortenpi
Copy link
Member Author

Yeah, somewhere in the global state. I am not entirely sure, but I think each module has a variable that holds all the docstrings of that module. The Docs module in base should hold the answer.

@mortenpi
Copy link
Member Author

We should probably deepcopy the docstrings before we transform them.

@johnnychen94
Copy link
Member

Could it at least print some infomation or warning about this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants