Skip to content

Commit

Permalink
Fix example links
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit0 committed Jul 23, 2022
1 parent 7f48f28 commit 55b72aa
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 26 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
- `{@link}` tags in comments will now be resolved as declaration references similar to TSDoc's declaration references.
For most cases, this will just work. See [the documentation](https://typedoc.org/guides/link-resolution/) for details on how link resolution works.
- TypeDoc will now produce warnings for bracketed links (`[[ target ]]`). Use `{@link target}` instead. The `{@link}` syntax will be recognized by [TypeScript 4.3](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-3.html#editor-support-for-link-tags) and later and used to provide better intellisense. TypeDoc version 0.24.0 will remove support for `[[ target ]]` style links.
Support for `` [[`links`]] `` with brackets + code ticks have been dropped.
- `extends` in typedoc.json is now resolved using NodeJS module resolution, so a local path must begin with `./`.
- In the JSON output for `DeclarationReflection`s, `getSignature` is no longer a one-tuple.
- In the JSON output for `DeclarationReflection`s, `setSignature` is no longer a one-tuple.
Expand Down
36 changes: 18 additions & 18 deletions example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,39 +34,39 @@ Here are some examples we wanted to highlight:

### Rendering

- Markdown showcase: [[`markdownShowcase`]]
- Syntax highlighting showcase: [[`syntaxHighlightingShowcase`]]
- Markdown showcase: {@link markdownShowcase | `markdownShowcase`}
- Syntax highlighting showcase: {@link syntaxHighlightingShowcase | `syntaxHighlightingShowcase` }

### Functions

- Simple functions: [[`sqrt`]] and [[`sqrtArrowFunction`]]
- A generic function: [[`concat`]]
- Functions that take an options object: [[`makeHttpCallA`]] and [[`makeHttpCallB`]]
- An overloaded function: [[`overloadedFunction`]]
- An external function exported under a different name: [[`lodashSortBy`]]
- Simple functions: {@link sqrt | `sqrt` } and {@link sqrtArrowFunction | `sqrtArrowFunction` }
- A generic function: {@link concat | `concat` }
- Functions that take an options object: {@link makeHttpCallA | `makeHttpCallA` } and {@link makeHttpCallB | `makeHttpCallB` }
- An overloaded function: {@link overloadedFunction | `overloadedFunction` }
- An external function exported under a different name: {@link lodashSortBy | `lodashSortBy` }

### Types

- Type aliases: [[`SimpleTypeAlias`]] and [[`ComplexGenericTypeAlias`]]
- Interfaces: [[`User`]] and [[`AdminUser`]]
- Type aliases: {@link SimpleTypeAlias | `SimpleTypeAlias` } and {@link ComplexGenericTypeAlias | `ComplexGenericTypeAlias` }
- Interfaces: {@link User | `User` } and {@link AdminUser | `AdminUser` }

### Classes

- A basic class: [[`Customer`]]
- A subclass: [[`DeliveryCustomer`]]
- A complex class: [[`CancellablePromise`]]
- A class that extends a built-in generic type: [[`StringArray`]]
- A basic class: {@link Customer | `Customer` }
- A subclass: {@link DeliveryCustomer | `DeliveryCustomer` }
- A complex class: {@link CancellablePromise | `CancellablePromise` }
- A class that extends a built-in generic type: {@link StringArray | `StringArray` }

### Enums

- A basic enum: [[`SimpleEnum`]]
- Using the `@enum` tag: [[`EnumLikeObject`]]
- A basic enum: {@link SimpleEnum | `SimpleEnum` }
- Using the `@enum` tag: {@link EnumLikeObject | `EnumLikeObject` }

### Variables

- [[`PI`]], [[`STRING_CONSTANT`]], and [[`ObjectConstant`]]
- {@link PI | `PI` }, {@link STRING_CONSTANT | `STRING_CONSTANT` }, and {@link ObjectConstant | `ObjectConstant` }

### React Components

- Basic React components: [[`CardA`]] and [[`CardB`]]
- A complex React component: [[`EasyFormDialog`]] and [[`EasyFormDialogProps`]]
- Basic React components: {@link CardA | `CardA` } and {@link CardB | `CardB` }
- A complex React component: {@link EasyFormDialog | `EasyFormDialog` } and {@link EasyFormDialogProps | `EasyFormDialogProps` }
4 changes: 2 additions & 2 deletions example/src/classes/CancellablePromise.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const noop = () => {
};

/**
* If canceled, a [[`CancellablePromise`]] should throw an `Cancellation` object.
* If canceled, a {@link CancellablePromise | `CancellablePromise`} should throw an `Cancellation` object.
*/
class Cancellation extends Error {
constructor(message = "Promise canceled.") {
Expand Down Expand Up @@ -301,7 +301,7 @@ export class CancellablePromise<T> {
*
* @param values an array that may contain `CancellablePromise`s, promises,
* thenables, and resolved values
* @returns a [[`CancellablePromise`]], which, if canceled, will cancel each
* @returns a {@link CancellablePromise | `CancellablePromise`}, which, if canceled, will cancel each
* of the promises passed in to `CancellablePromise.all`.
*/
static all(values: readonly unknown[]): CancellablePromise<unknown> {
Expand Down
2 changes: 1 addition & 1 deletion example/src/classes/Customer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export abstract class Customer {
}

/**
* A class that extends [[`Customer`]].
* A class that extends {@link Customer | `Customer`}.
*/
export class DeliveryCustomer extends Customer {
/** A property defined on the subclass. */
Expand Down
2 changes: 1 addition & 1 deletion example/src/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export function concat<T>(array1: T[], array2: T[]): T[] {
}

/**
* The options type for [[`makeHttpCallA`]].
* The options type for {@link makeHttpCallA}.
*/
export interface MakeHttpCallAOptions {
url: string;
Expand Down
4 changes: 2 additions & 2 deletions example/src/reactComponents.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ReactElement, PropsWithChildren } from "react";

/**
* The props type for [[`CardA`]].
* The props type for {@link CardA}.
*/
export interface CardAProps {
/** The theme of the card. Defaults to `primary`. */
Expand Down Expand Up @@ -81,7 +81,7 @@ export function CardB({
return <div className={`card card-${variant}`}>{children}</div>;
}

/** The props type of [[`EasyFormDialog`]]. */
/** The props type of {@link EasyFormDialog | `EasyFormDialog`}. */
export interface EasyFormDialogProps {
/** The title of the dialog. Can be a JSX element. */
title: React.ReactNode;
Expand Down
2 changes: 1 addition & 1 deletion example/src/showcase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* const x: number | string = 12
* ```
*
* See [[`syntaxHighlightingShowcase`]] for more code blocks.
* See {@link syntaxHighlightingShowcase | `syntaxHighlightingShowcase`} for more code blocks.
*
* ## A List
*
Expand Down
2 changes: 1 addition & 1 deletion example/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export interface User {
}

/**
* An interface that extends [[`User`]] and adds more properties.
* An interface that extends {@link User | `User`} and adds more properties.
*
* Notice how TypeDoc automatically shows the inheritance hierarchy and where
* each property was originally defined.
Expand Down

0 comments on commit 55b72aa

Please sign in to comment.