Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .config/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
../.nyc_output
../coverage
../dist
../package-lock.json
**/package-lock.json
../src/test/**/specs*.json
../src/test/packages/**/*.js
../src/test/renderer/specs
../src/test/renderer/testProject
../static/main.js
../example/docs/
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
],
"ignorePatterns": [
"src/test/renderer/specs",
"examples",
"dist",
"coverage",
"static/main.js",
"src/lib/output/themes/default/assets",
// Would be nice to lint these, but they shouldn't be included in the project,
// so we need a second eslint config file.
"example",
"src/test/converter",
"src/test/converter2",
"src/test/module",
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ yarn-error.log

/src/test/renderer/*/doc
/src/test/renderer/testProject/json.json
/node_modules/
**/node_modules/
/coverage/
/dist/

Expand All @@ -21,3 +21,5 @@ src/test/renderer/specs/specs.json

# Built theme JS
static/main.js

/example/docs/
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
},
"prettier.enable": true,
"prettier.configPath": ".config/.prettierrc.json",
"prettier.ignorePath": ".config/.prettierignore"
"prettier.ignorePath": ".config/.prettierignore",
"eslint.workingDirectories": [".", "./example"]
}
7 changes: 7 additions & 0 deletions example/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../.eslintrc",
"parserOptions": {
"project": "./tsconfig.json"
},
"ignorePatterns": ["docs/"]
}
72 changes: 72 additions & 0 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# The TypeDoc Example

Welcome to the TypeDoc example! TypeDoc is a documentation generator for
TypeScript.

TypeDoc automatically documents every variable, function, and class
that is exported by your project. You can add explanations and examples to your
documentation site by annotating your code with doc comments, e.g.

```
/**
* Calculates the square root of a number.
*
* @param x the number to calculate the root of.
* @returns the square root if `x` is non-negative or `NaN` if `x` is negative.
*/
export function sqrt(x: number): number {
return Math.sqrt(x);
}
```

This project shows off some of TypeDoc's features:

- Built-in support for various TypeScript language constructs
- Markdown in doc comments
- Syntax highligting in code blocks

## Index of Examples

**Click the "Exports" link in the sidebar to see a complete list of everything in
the package.**

Here are some examples we wanted to highlight:

### Rendering

- Markdown showcase: [[`markdownShowcase`]]
- Syntax highlighting showcase: [[`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`]]

### Types

- Type aliases: [[`SimpleTypeAlias`]] and [[`ComplexGenericTypeAlias`]]
- Interfaces: [[`User`]] and [[`AdminUser`]]

### Classes

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

### Enums

- A basic enum: [[`SimpleEnum`]]
- Using the `@enum` tag: [[`EnumLikeObject`]]

### Variables

- [[`PI`]], [[`STRING_CONSTANT`]], and [[`ObjectConstant`]]

### React Components

- Basic React components: [[`CardA`]] and [[`CardB`]]
- A complex React component: [[`EasyFormDialog`]] and [[`EasyFormDialogProps`]]
7 changes: 7 additions & 0 deletions example/building-the-example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Building the TypeDoc Example

1. Build TypeDoc: `npm install` and `npm run build` in the root directory.
2. `cd example`
3. `npm install` (the example has its own `package.json`)
4. Typecheck the example: `npm run tsc`
5. Build the docs: `npm run typedoc`
6 changes: 6 additions & 0 deletions example/media/typescript-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
237 changes: 237 additions & 0 deletions example/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading