microsoft / microsoft/tsdoc

Suggestion: Allow configurable set of uri prefixes to be parsed as urls for link tags

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

Nobody has claimed this yet.

enhancement needs design
Dominant language
TypeScript
Stars
5k
Forks
162
Avg merge
17h 24m
Merged PRs (30d)
8

Description

TSDoc currently only treats a {@link} tag's destination as a URL if it starts with scheme://. I would suggest widening this via configuration to allow a limited set of prefixes to be treated as URLs. This would allow for the use of {@link} tags that point at documentation IDs in tools like DocFX (including documentation IDs from merged documentation sources that are not in the model):

tsdoc.json

{
  "linkUrlPrefixes": ["xref", "mailto"]
}

foo.d.ts

import { Bar } from "mypackage";

/**
 * Returns a {@link xref:mypackage!Bar:class|Bar}.
 * @remarks
 * If we need to return something else, email {@link mailto:bob@foo.com|Bob}.
 */
export function foo(): Bar;

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

Begin by tracing how {@link} destinations are recognized and how tsdoc.json configuration is handled. Use the xref and mailto examples in foo.d.ts as behavioral cases; done means configured prefixes are accepted as URL destinations while unconfigured parsing remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
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.