-
Notifications
You must be signed in to change notification settings - Fork 482
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
Print module correctly when extending a function #758
Comments
It prints |
Since the source link after that links to
Usually I would like to see the Module name – but with this last line, maybe in more detail than it now is. |
If it reads |
For me, just reading |
IMO this is what the docstring should include, but it is important to show that it is a method of |
Now you leave me confused. I thought if I write a norm for a fancy new type of mine, but it is conceptually a norm and hence I would like to use the name of the function as
since it is an extension of the method of |
I agree with @fredrikekre here. There is a difference between extending a function from another module and defining a new function with the same name as a function in another module. Displaying We could potentially do it the other way around:
|
That sounds like a good solution to me; but yes my functions are norms, that's why I'd like to extend Base.LinAlg, but I'd also like to point out to the reader, that I extended it to y SuperNormTypes :) |
Did anyone come up with a workaround for this one? I have a use case that I would really like to not display the module from which the function is being extended. |
Well since this is a feature and not a bug, I did not look for a workaround. In the long run it would maybe be nice to have both the origin and the new definitions module. |
Thanks for the reply - I was able to get the behaviour I wanted by by making my own writer. I'll try and put up and example and maybe put together a pr some time soon. |
Let's say I want to extend the function definition of
Base.LinAlg.norm
in my new PackageSuperNorms.jl
and so I am writing somewhere in my packageimport Base.LinAlg: norm
export norm
and define the new norm for
::MySuperType
somewhere including a nice (super) doc string.When I then generate the documentation and call
in my
documentation.md
the first rendered line (html-rendered byDocumenter.jl
) readsBase.LinAlg.norm
– Functionnorm(s)
mySuperDocuText...
Why does it refer to the imported Module and not to
SuperNorms.norm
– Function?Is that a bug or do I have to change that somewhere?
For functions just defined in the package it works correctly.
The text was updated successfully, but these errors were encountered: