JuliaDocs / JuliaDocs/DocStringExtensions.jl

Display parametric types in a better way?

Open
#109 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
126
Forks
35
PR merge metrics
No merged PRs in 30d

Description

Consider the following two functions in module CGP.

"""
$(TYPEDSIGNATURES)
"""
function fun1(x::AbstractVector{<:Real})
end


"""
$(TYPEDSIGNATURES)
"""
function fun2(x::AbstractVector{T}) where T<:Real
end

The following documentation is produced.
image

I noticed two issues.

  1. The AbstractVector in fun2 becomes AbstractArray again even if I am using Julia 1.6.0. (See #108)
  2. In fun1, the implicit type parameter is an ugly var"#s2". Is it possible to just show the original form x::AbstractVector{<:Real}?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the documentation output for the CGP module examples fun1 and fun2 using Julia 1.6.0, then trace the DocStringExtensions signature-rendering entry point involved in TYPEDSIGNATURES. Done means the parametric signatures retain AbstractVector and present the implicit bound without the generated var"#s2" name.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
documentation
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.