Skip to content

Conversation

@ro-ble
Copy link
Contributor

@ro-ble ro-ble commented May 2, 2020

As proposed on discourse, I would like to add this to improve the documentation.

As proposed on discourse, I would like to add this to improve the documentation. https://discourse.julialang.org/t/linear-algebra-tricks/38618/10?u=roble
@andreasnoack
Copy link
Member

Looks like Documenter doesn't understand this. @fredrikekre do you know if there is a way to do this?

@andreasnoack andreasnoack added docs This change adds or pertains to documentation linear algebra Linear algebra labels May 5, 2020
@ro-ble
Copy link
Contributor Author

ro-ble commented May 6, 2020

The function seems to have documentation strings. However I believe that documenter struggles with the function declaration in the index.md file. From my still small Julia knowledge, I would guess, that it is something like this: https://docs.julialang.org/en/v1/manual/methods/#Function-like-objects-1
I believe functions like this have already been documented. I will search for one

@fredrikekre
Copy link
Member

I don't think it is possible to include this in @docs-blocks, not sure though. @mortenpi?

@mortenpi
Copy link
Contributor

mortenpi commented May 6, 2020

Yeah, this is currently problematic. The docsystem is a bit buggy, but also Documenter probably can't handle it properly: JuliaDocs/Documenter.jl#558

Although, if it would work, I think the syntax for this in at-docs blocks should be

(::LinearAlgebra.UniformScaling)(::Integer)

Let's hope that Documenter likes it this time
@ro-ble
Copy link
Contributor Author

ro-ble commented May 7, 2020

I tried to replicate the behaviour of Documenter in REPL. Following things happened:

@doc (::UniformScaling)(::Integer) -> returns the correct documentation

(Edit:) @doc (::LinearAlgebra.UniformScaling)(::Integer) -> works also as expected when the library is imported instead of used. I wonder why the tests failed.

I am not shure how to proceed...

@mortenpi
Copy link
Contributor

mortenpi commented May 9, 2020

Since it's broken from the docsystem side, I would suggest merging the docstring for (I::UniformScaling)(n::Integer) into the docstring of struct UniformScaling and maybe also add a usage example of I(n) into the docstring of const I.

One more try to pass that doc test
@ro-ble
Copy link
Contributor Author

ro-ble commented May 10, 2020

I would suggest merging the docstring for (I::UniformScaling)(n::Integer) into the docstring of struct UniformScaling and maybe also add a usage example of I(n) into the docstring of const I.

Yeah that would certainly be a valid solution. But before I do this, I will try to resolve this issue. According to zekeriya.sari's answer, I do believe that It should be possible.

Co-authored-by: Morten Piibeleht <morten.piibeleht@gmail.com>
@fredrikekre fredrikekre reopened this May 22, 2020
@dkarrasch dkarrasch merged commit c769602 into JuliaLang:master Jul 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs This change adds or pertains to documentation linear algebra Linear algebra

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants