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

Source button of SparseArrays docstrings redirects to a 404 page not found. #52891

Closed
jam-khan opened this issue Jan 13, 2024 · 8 comments
Closed
Labels
docsystem The documentation building system duplicate Indicates similar issues or pull requests sparse Sparse arrays

Comments

@jam-khan
Copy link
Contributor

https://docs.julialang.org/en/v1/stdlib/LinearAlgebra/#LinearAlgebra.qr

Under Linear Algebra.qr Examples, there is a source button and it redirects to a 404 page not found.

@giordano
Copy link
Contributor

More generally, that's the case for all docstrings of the SparseArrays.jl stdlib: https://docs.julialang.org/en/v1.10.0/stdlib/SparseArrays/ because that's maintained in a different repository: https://github.com/JuliaSparse/SparseArrays.jl

@giordano giordano added sparse Sparse arrays docsystem The documentation building system labels Jan 13, 2024
@jam-khan
Copy link
Contributor Author

In that case, I am thinking of fixing it by adding hard links to the corresponding JuliaSparse Repo code, but I am not sure if it is the best solution. Is there a better way to solve this?

@inkydragon
Copy link
Member

Is there a better way to solve this?

Maybe just add a line of regular expression to replace the URL here.

julia/doc/make.jl

Lines 386 to 410 in 4d670fb

# Update URLs to external stdlibs (JuliaLang/julia#43199)
for (root, _, files) in walkdir(output_path), file in joinpath.(root, files)
endswith(file, ".html") || continue
local str
str = read(file, String)
# Index page links, update
# https://github.com/JuliaLang/julia/blob/master/stdlib/${STDLIB_NAME}-${STDLIB_COMMIT}/path/to.md
# to
# https://github.com/JuliaLang/${STDLIB_NAME}.jl/blob/master/docs/src/index.md
str = replace(str, r"https://github.com/JuliaLang/julia/blob/master/stdlib/(.*)-\w{40}/(.*\.md)" =>
s"https://github.com/JuliaLang/\1.jl/blob/master/\2")
# Link to source links, update
# https://github.com/JuliaLang/julia/blob/${JULIA_COMMIT}/stdlib/${STDLIB_NAME}-${STDLIB_COMMIT}/path/to.jl#${LINES}
# to
# https://github.com/JuliaLang/${STDLIB_NAME}.jl/blob/${STDLIB_COMMIT}/path/to.jl#${LINES}
str = replace(str, r"https://github\.com/JuliaLang/julia/blob/\w{40}/stdlib/(.*)-(\w{40})/(.*\.jl#L\d+(?:-L\d+)?)" =>
s"https://github.com/JuliaLang/\1.jl/blob/\2/\3")
# Some stdlibs are not hosted by JuliaLang
str = replace(str, r"(https://github\.com)/JuliaLang/(ArgTools\.jl/blob)" => s"\1/JuliaIO/\2")
str = replace(str, r"(https://github\.com)/JuliaLang/(LibCURL\.jl/blob)" => s"\1/JuliaWeb/\2")
str = replace(str, r"(https://github\.com)/JuliaLang/(SHA\.jl/blob)" => s"\1/JuliaCrypto/\2")
str = replace(str, r"(https://github\.com)/JuliaLang/(Tar\.jl/blob)" => s"\1/JuliaIO/\2")
# Write back to the file
write(file, str)
end

@LilithHafner
Copy link
Member

LilithHafner commented Jan 14, 2024

Duplicate of #50035, fixed by #51375 though @mortenpi seems to have a better long term solution by fixing this at the Documenter.jl level.

@LilithHafner LilithHafner closed this as not planned Won't fix, can't repro, duplicate, stale Jan 14, 2024
@LilithHafner LilithHafner added the duplicate Indicates similar issues or pull requests label Jan 14, 2024
@giordano
Copy link
Contributor

@LilithHafner I don't think this was fixed by #51375, I don't see any changes about SparseArrays.jl there and links in https://docs.julialang.org/en/v1.11-dev/stdlib/SparseArrays/ look still wrong to me. Last commit on https://github.com/JuliaLang/docs.julialang.org/tree/gh-pages is based on b4f7263, which is after the merge of your PR, so it should include your fix, if it did something for SparseArrays.jl

@giordano giordano reopened this Jan 17, 2024
@giordano giordano removed the duplicate Indicates similar issues or pull requests label Jan 17, 2024
@giordano giordano changed the title Source button in LinearAlgebra.qr redirects to a 404 page not found. Source button of SparseArrays docstrings redirects to a 404 page not found. Jan 17, 2024
@jam-khan
Copy link
Contributor Author

In that case, I plan to solve the issue using suggestions from @inkydragon.

@LilithHafner
Copy link
Member

LilithHafner commented Jan 17, 2024

I agree that this is not fixed by #51375. My mistake. However, it is still definitely a special case of #50035 (duplicate). It should be hopefully fixed by JuliaSparse/SparseArrays.jl#442.

@nsajko nsajko added the duplicate Indicates similar issues or pull requests label Jan 30, 2024
@nsajko
Copy link
Contributor

nsajko commented Jan 30, 2024

dups #50035

@nsajko nsajko closed this as completed Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docsystem The documentation building system duplicate Indicates similar issues or pull requests sparse Sparse arrays
Projects
None yet
Development

No branches or pull requests

5 participants