{"id":18024476,"url":"https://github.com/thofma/whereismydocstring.jl","last_synced_at":"2025-10-06T12:36:32.293Z","repository":{"id":253516151,"uuid":"843743208","full_name":"thofma/WhereIsMyDocstring.jl","owner":"thofma","description":"Helping you find and include docstrings in julia","archived":false,"fork":false,"pushed_at":"2025-03-07T20:45:13.000Z","size":27,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-07T21:26:59.598Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thofma.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-17T09:31:01.000Z","updated_at":"2025-03-07T20:45:15.000Z","dependencies_parsed_at":"2024-10-30T07:48:00.740Z","dependency_job_id":null,"html_url":"https://github.com/thofma/WhereIsMyDocstring.jl","commit_stats":null,"previous_names":["thofma/whereismydocstring.jl"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thofma%2FWhereIsMyDocstring.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thofma%2FWhereIsMyDocstring.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thofma%2FWhereIsMyDocstring.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thofma%2FWhereIsMyDocstring.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thofma","download_url":"https://codeload.github.com/thofma/WhereIsMyDocstring.jl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247228607,"owners_count":20904902,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-30T07:12:57.346Z","updated_at":"2025-10-06T12:36:32.235Z","avatar_url":"https://github.com/thofma.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WhereIsMyDocstring.jl\n\n---\n\n*Dude, where is my docstring?*\n\n---\n\n\n- Have you ever wondered, which docstring is included in a ```` ```@docs``` ```` block when writing the documentation?\n- Are you tired of finding the magic syntax to include the *right* docstring of a method?\n\nEnter: WhereIsMyDocstring.jl\n\n## Status\n\n[![Build Status](https://github.com/thofma/WhereIsMyDocstring.jl/actions/workflows/CI.yml/badge.svg?branch=master)](https://github.com/thofma/WhereIsMyDocstring.jl/actions/workflows/CI.yml?query=branch%3Amaster)\n[![Coverage](https://codecov.io/gh/thofma/WhereIsMyDocstring.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/thofma/WhereIsMyDocstring.jl)\n[![Pkg Eval](https://juliaci.github.io/NanosoldierReports/pkgeval_badges/W/WhereIsMyDocstring.svg)](https://juliaci.github.io/NanosoldierReports/pkgeval_badges/report.html)\n\n## Installation\n\nSince WhereIsMyDocstring.jl is a registered package, it can be simply installed as follows:\n```\njulia\u003e using Pkg; Pkg.install(\"WhereIsMyDocstring\")\n```\n\n## Usage\n\nThe package provides the `@docmatch` macro, which allows one to simulate the behaviour of ```` ```@docs``` ```` blocks interactively. This is helpful in case a function has many different methods and docstrings, and one wants to include a specific one. In particular in the presence of type parameters, this can be a frustrating experience due to https://github.com/JuliaLang/julia/issues/29437. Here is a simple example:\n\n```\njulia\u003e using WhereIsMyDocstring\n\njulia\u003e @docmatch sin\n2-element Vector{WhereIsMyDocstring.DocStr}:\n Base.sin\n  Content:\n    sin(x) [...]\n  Signature type:\n    Tuple{Number}\n  Include in ```@docs``` block:\n    Base.sin(::Number)\n  Source:\n   math.jl:490\n====================================================================================\n\n Base.sin\n  Content:\n    sin(A::AbstractMatrix) [...]\n  Signature type:\n    Tuple{AbstractMatrix{\u003c:Real}}\n  Include in ```@docs``` block:\n    Base.sin(::AbstractMatrix{\u003c:Real})\n  Source:\n   /usr/share/julia/stdlib/v1.10/LinearAlgebra/src/dense.jl:956\n====================================================================================\n```\nThe macro returns the docstrings (including metadata). In view of ```` ```@docs ``` ```` blocks, the most imporant information is the \"Include in ...\" field. This provides the right invocation to include the specific docstring. For example, if we want to include the second docstring, in our documentation markdown source we would write:\n````\n```@docs\nBase.sin(::AbstractMatrix{\u003c:Real})\n```\n````\n\nA more complicated example is:\n````julia-repl\njulia\u003e \"blub\"\n       function foo(x::Vector{S}, z::Matrix{T} = 1; y::Number = 2) where {S, T \u003c: S}\n       end\n\njulia\u003e @docmatch foo\n1-element Vector{WhereIsMyDocstring.DocStr}:\n foo\n  Content:\n    blub [...]\n  Signature type:\n    Union{Tuple{Vector{S}}, Tuple{T}, Tuple{S}, Tuple{Vector{S}, Matrix{T}}} where {S, T\u003c:S}\n  Include in ```@docs``` block:\n    foo(::Union{Tuple{Vector{S}}, Tuple{T}, Tuple{S}, Tuple{Vector{S}, Matrix{T}}} where {S, T\u003c:S})\n    try the following:\n    foo(::Array{S, 1}, ::Array{T, 2}) where {S, T\u003c:S}\n  Source:\n   REPL[2]:1\n````\nNote that the type of the signature is garbled due to https://github.com/JuliaLang/julia/issues/29437. This also messes up the lookup. Here we are warned about this and a suggested way to fix it is provided via `foo(::Array{S, 1}, ::Array{T, 2}) where {S, T\u003c:S}`.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthofma%2Fwhereismydocstring.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthofma%2Fwhereismydocstring.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthofma%2Fwhereismydocstring.jl/lists"}