LuxDL / DocumenterVitepress.jl

Documentation with Documenter.jl and VitePress
https://luxdl.github.io/DocumenterVitepress.jl/
MIT License
64 stars 9 forks source link

`_item_link(page::String, item::Markdown.Link)` produces `MethodError` #40

Closed LilithHafner closed 4 months ago

LilithHafner commented 4 months ago

When building docs https://github.com/LilithHafner/Chairmarks.jl/pull/10, I got an error that appears to be due to using the replace function on MarkDown.Link, which does not support that function.

ERROR: LoadError: MethodError: no method matching similar(::Markdown.Link, ::Type{Any})

Closest candidates are:
  similar(::LinearAlgebra.Diagonal, ::Type{T}, ::Union{Tuple{Int64}, Tuple{Int64, Int64}}) where T
   @ LinearAlgebra /opt/hostedtoolcache/julia/1.10.1/x64/share/julia/stdlib/v1.10/LinearAlgebra/src/diagonal.jl:130
  similar(::LinearAlgebra.Diagonal, ::Type{T}) where T
   @ LinearAlgebra /opt/hostedtoolcache/julia/1.10.1/x64/share/julia/stdlib/v1.10/LinearAlgebra/src/diagonal.jl:129
  similar(::Vector{T}, ::Type) where T
   @ Base array.jl:417
  ...

Stacktrace:
  [1] _similar_or_copy(x::Markdown.Link, ::Type{Any})
    @ Base ./set.jl:572
  [2] replace(A::Markdown.Link, old_new::Pair{String, String}; count::Nothing)
    @ Base ./set.jl:690
  [3] replace(A::Markdown.Link, old_new::Pair{String, String})
    @ Base ./set.jl:686
  [4] _item_link(page::String, item::Markdown.Link)
    @ DocumenterVitepress ~/.julia/packages/DocumenterVitepress/IO55P/src/vitepress_config.jl:102
  [5] _broadcast_getindex_evalf
    @ ./broadcast.jl:709 [inlined]
  [6] _broadcast_getindex
    @ ./broadcast.jl:682 [inlined]
  [7] getindex
    @ ./broadcast.jl:636 [inlined]
  [8] macro expansion
    @ ./broadcast.jl:1004 [inlined]
  [9] macro expansion
    @ ./simdloop.jl:77 [inlined]
 [10] copyto!
    @ ./broadcast.jl:1003 [inlined]
 [11] copyto!
    @ ./broadcast.jl:956 [inlined]
 [12] copy(bc::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1}, Tuple{Base.OneTo{Int64}}, typeof(DocumenterVitepress._item_link), Tuple{Tuple{String}, Vector{Any}}})
    @ Base.Broadcast ./broadcast.jl:928
 [13] materialize
    @ ./broadcast.jl:903 [inlined]
 [14] sidebar_items(doc::Documenter.Document, page::String)
    @ DocumenterVitepress ~/.julia/packages/DocumenterVitepress/IO55P/src/vitepress_config.jl:98
 [15] pagelist2str(doc::Documenter.Document, name_page::Pair{String, String})
    @ DocumenterVitepress ~/.julia/packages/DocumenterVitepress/IO55P/src/vitepress_config.jl:78
 [16] _broadcast_getindex_evalf
    @ ./broadcast.jl:709 [inlined]
 [17] _broadcast_getindex
    @ ./broadcast.jl:682 [inlined]
 [18] getindex
    @ ./broadcast.jl:636 [inlined]
 [19] macro expansion
    @ ./broadcast.jl:1004 [inlined]
 [20] macro expansion
    @ ./simdloop.jl:77 [inlined]
 [21] copyto!
    @ ./broadcast.jl:1003 [inlined]
 [22] copyto!
    @ ./broadcast.jl:956 [inlined]
 [23] copy
    @ ./broadcast.jl:928 [inlined]
 [24] materialize
    @ ./broadcast.jl:903 [inlined]
 [25] modify_config_file(doc::Documenter.Document, settings::MarkdownVitepress, deploy_decision::Documenter.DeployDecision)
    @ DocumenterVitepress ~/.julia/packages/DocumenterVitepress/IO55P/src/vitepress_config.jl:44
 [26] render(doc::Documenter.Document, settings::MarkdownVitepress)
    @ DocumenterVitepress ~/.julia/packages/DocumenterVitepress/IO55P/src/writer.jl:131
 [27] runner(::Type{DocumenterVitepress.MarkdownFormat}, fmt::MarkdownVitepress, doc::Documenter.Document)
    @ DocumenterVitepress ~/.julia/packages/DocumenterVitepress/IO55P/src/DocumenterVitepress.jl:27
 [28] dispatch(::Type{Documenter.FormatSelector}, ::MarkdownVitepress, ::Vararg{Any})
    @ Documenter.Selectors ~/.julia/packages/Documenter/1HwWe/src/utilities/Selectors.jl:170
 [29] render(doc::Documenter.Document)
    @ Documenter ~/.julia/packages/Documenter/1HwWe/src/writers.jl:45
 [30] runner(::Type{Documenter.Builder.RenderDocument}, doc::Documenter.Document)
    @ Documenter ~/.julia/packages/Documenter/1HwWe/src/builder_pipeline.jl:258
 [31] dispatch(::Type{Documenter.Builder.DocumentPipeline}, x::Documenter.Document)
    @ Documenter.Selectors ~/.julia/packages/Documenter/1HwWe/src/utilities/Selectors.jl:170
 [32] #83
    @ ~/.julia/packages/Documenter/1HwWe/src/makedocs.jl:248 [inlined]
 [33] withenv(::Documenter.var"#83#85"{Documenter.Document}, ::Pair{String, Nothing}, ::Vararg{Pair{String, Nothing}})
    @ Base ./env.jl:257
 [34] #82
    @ ~/.julia/packages/Documenter/1HwWe/src/makedocs.jl:247 [inlined]
 [35] cd(f::Documenter.var"#82#84"{Documenter.Document}, dir::String)
    @ Base.Filesystem ./file.jl:112
 [36] #makedocs#81
    @ ~/.julia/packages/Documenter/1HwWe/src/makedocs.jl:247 [inlined]
 [37] top-level scope
    @ ~/work/Chairmarks.jl/Chairmarks.jl/docs/make.jl:7
 [38] include(fname::String)
    @ Base.MainInclude ./client.jl:489
 [39] top-level scope
    @ none:8
in expression starting at /home/runner/work/Chairmarks.jl/Chairmarks.jl/docs/make.jl:7
Error: Process completed with exit code 1.

log: https://github.com/LilithHafner/Chairmarks.jl/actions/runs/8039421455/job/21956415807?pr=10

asinghvi17 commented 4 months ago

huh, thanks for letting me know! I actually got rid of sidebar_items in the master branch which should be released in the next half hour, so that should fix this...

LilithHafner commented 4 months ago

I can confirm that this issue no longer reproduces for me in 0.0.5.