Skip to content

Add doc_str and doc macros, to support Base.Docs/Docile syntax. #126

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

Merged
merged 1 commit into from
Sep 19, 2015

Conversation

hayd
Copy link
Member

@hayd hayd commented Aug 5, 2015

fix #56.

@@ -38,6 +38,16 @@ if VERSION < v"0.4.0-dev+412"
eval(Base, :(const IPAddr = IpAddr))
end

if VERSION < v"0.4.0-dev"
try
import Docile: @doc_str, @docmstr, @doc
Copy link
Member

Choose a reason for hiding this comment

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

@docmstr -> @doc_mstr

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed, thanks!

@MichaelHatherly
Copy link
Member

The version condition should probably be a bit more specific since @doc didn't get added until later during 0.4.

@hayd
Copy link
Member Author

hayd commented Aug 5, 2015

Hmmm, it's been a long time > 6 months I think? Happy to tweak this if it's easy to work out.

Edit: JuliaLang/julia#8791 (November)

@MichaelHatherly
Copy link
Member

0.4.0-dev+1501 I think.

@hayd
Copy link
Member Author

hayd commented Aug 5, 2015

okey dokey, let's go with that. :)

@stevengj
Copy link
Member

Needs a test.

@hayd
Copy link
Member Author

hayd commented Aug 11, 2015

Added test. locally this works on 0.3 both with and without Docile.

@hayd
Copy link
Member Author

hayd commented Aug 18, 2015

@MichaelHatherly actually when I look at this, help doesn't seem to work for me on 0.3 (before this PR). I was under the impression that

help> func # would not show doc
julia> using Docile
help> func  # would show doc

Maybe there is something funky about my 0.3 install.

Should this work?

@MichaelHatherly
Copy link
Member

Should this work?

To get help in 0.3 for packages you need to import Lexicon first. Docile only provides the docstrings while Lexicon hooks into the base help system.

@hayd
Copy link
Member Author

hayd commented Aug 31, 2015

I think it would be nice to merge this soon...

One potential issue is this may cause some warnings where libraries have already tried to import Docile ? The trick being, remove the using/import of Docile and let Compat do the work. ?
(Perhaps this could be solved by moving the export into the catch block?)

@hayd
Copy link
Member Author

hayd commented Sep 12, 2015

I'm going to pull the trigger on this in the next few days unless there's any more comments.

hayd referenced this pull request in JuliaWeb/HttpServer.jl Sep 12, 2015
hayd added a commit that referenced this pull request Sep 19, 2015
Add doc_str and doc macros, to support Base.Docs/Docile syntax.
@hayd hayd merged commit ccb433f into JuliaLang:master Sep 19, 2015
@hayd hayd deleted the doc branch September 19, 2015 06:27
@MichaelHatherly
Copy link
Member

@hayd, this is causing failures for packages on 0.3 that import Docile after Compat, https://github.com/JuliaGraphics/ColorTypes.jl/blob/a8dd9a3834b76e48db138141ab586325cd4efaa6/src/ColorTypes.jl#L5-L8.

This probably needs to be reverted unless there's a way to avoid the imports clashing.

First see here https://groups.google.com/forum/#!topic/julia-users/rsM4hxdkAxg.

martinholters pushed a commit to martinholters/Compat.jl that referenced this pull request Jul 13, 2016
Re-write {} as Any[] because {} is deprecated in 0.4
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.

make @doc a no-op if Docile can't be loaded?
3 participants