Skip to content

Commit

Permalink
chore: updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tgreyuk committed Apr 27, 2024
1 parent bc4a020 commit 29d47c5
Show file tree
Hide file tree
Showing 14 changed files with 71 additions and 68 deletions.
20 changes: 2 additions & 18 deletions docs/pages/api-docs/Interface.PluginOptions.md
Expand Up @@ -8,7 +8,7 @@ Describes the options declared by the plugin.

> **anchorPrefix**: `string`
Custom anchor prefix
Custom anchor prefix when anchoring to in-page symbols.

***

Expand All @@ -32,7 +32,7 @@ The name of a module that should act as the root page for the documentation.

> **enumMembersFormat**: `"table"` \| `"list"`
Specify the render style of enumuration members.
Specify the render style of enumeration members.

***

Expand Down Expand Up @@ -116,22 +116,6 @@ Specify the render format for index items.

***

### indexPageTitle

> **indexPageTitle**: `string`
The title of project index page.

***

### memberPageTitle

> **memberPageTitle**: `string`
The page title of member pages.

***

### membersWithOwnFile

> **membersWithOwnFile**: (`"Enum"` \| `"Variable"` \| `"Function"` \| `"Class"` \| `"Interface"` \| `"TypeAlias"`)[]
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/api-docs/index.mdx
@@ -1,6 +1,6 @@
# API

The public API of the plugin exposes some classes and types that can be used to extend the plugin. Please note this only covers the API relevant to this plugin and not cover the entire [TypeDoc API](https://typedoc.org/api/).
The public API of the typedoc-plugin-markdown exposes some classes and types that can be used to customize the output of the plugin. Please note this only covers the API relevant to this plugin and not cover the entire [TypeDoc API](https://typedoc.org/api/).

The APIs are typically consumed by writing [local plugins](/docs/customizing-output#local-plugins).

Expand Down
1 change: 0 additions & 1 deletion docs/pages/docs/_meta.js
Expand Up @@ -17,6 +17,5 @@ export default {
type: 'separator',
title: 'Support',
},
examples: '',
changelog: '',
};
24 changes: 0 additions & 24 deletions docs/pages/docs/examples.mdx

This file was deleted.

20 changes: 18 additions & 2 deletions docs/pages/docs/index.mdx
@@ -1,15 +1,17 @@
import { Cards, Callout } from 'nextra/components';
import pjson from '../../../packages/typedoc-plugin-markdown/package.json';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faGithub } from '@fortawesome/free-brands-svg-icons';

# typedoc-plugin-markdown

<PackageDescription pjson={pjson} />

## Overview

By default [TypeDoc](https://typedoc.org) will output API documentation as HTML.
By default [TypeDoc](https://typedoc.org) will output API documentation as HTML. The plugin replaces the default HTML theme with a built-in Markdown theme and exposes some additional options.

This plugin enables TypeDoc to output documentation in Markdown. Since many tools and platforms support Markdown, the documentation generated by this plugin can be easily integrated into different ecosystems, such as code repositories, static site generators or documentation hosting services.
Since many tools and platforms support Markdown, the documentation generated by this plugin can be easily integrated into different ecosystems, such as code repositories, static site generators or documentation hosting services.

## Features

Expand All @@ -18,3 +20,17 @@ This plugin enables TypeDoc to output documentation in Markdown. Since many tool
- Configurable output file structure.
- Configurable UX options
- [Frontmatter](/plugins/frontmatter) and [Remark](/plugins/remark) utility plugins available.

## Examples

Visit the dedicated examples repository of examples showcasing the output generated using the plugin.

<Cards num={2}>
<Cards.Card
title="View on GitHub"
icon={<FontAwesomeIcon icon={faGithub} />}
arrow={true}
href="https://github.com/tgreyuk/typedoc-plugin-markdown-examples"
target="_blank"
/>
</Cards>
4 changes: 3 additions & 1 deletion docs/pages/docs/options.mdx
Expand Up @@ -630,7 +630,9 @@ This option would typically be used when source code comes from an external libr

### anchorPrefix

<Callout emoji="💡">Custom anchor prefix</Callout>
<Callout emoji="💡">
Custom anchor prefix when anchoring to in-page symbols.
</Callout>

> Accepts a string value. Defaults to `"undefined"`.
Expand Down
51 changes: 36 additions & 15 deletions docs/pages/docs/using-typedoc.mdx
Expand Up @@ -4,11 +4,45 @@ import { Callout, FileTree } from 'nextra/components';

This plugin is like any other TypeDoc plugin and is fully compatible with the TypeDoc ecosystem, supporting other plugins (not specifically targetting HTML output) and the majority of TypeDoc's options.

## TypeDoc Options
Please refer to TypeDoc's [Configuration Options](https://typedoc.org/options/configuration/) for detailed information on how to configure options.

## Option Typings

You can inform your IDE about the shape of the exported options the plugin provides.

### JSON Files

You can utilize the provided JSON schema at https://typedoc-plugin-markdown.org/schema.json. For simplicity of configuration, this schema consolidates all options from TypeDoc and the plugin.

```json filename="typedoc.json"
{
"$schema": "https://typedoc-plugin-markdown.org/schema.json",
"entryPoints": ["./src/index.ts", "./src/secondary-entry.ts"],
"out": "docs",
"plugin": ["typedoc-plugin-markdown", "some-other-plugin"],
};
```

### JavaScript Files

For JavaScript files, the `PluginOptions` interface that can be imported to a `typedoc.config.js` file with a `@type` annotation.

You can use intersection types to combine the TypeDoc options with the plugin options.

```js filename="typedoc.config.js"
/** @type {import('typedoc').TypeDocOptions & import('typedoc-plugin-markdown').PluginOptions} */
module.exports = {
entryPoints: ['./src/index.ts', './src/secondary-entry.ts'],
out: 'doc',
plugin: ['typedoc-plugin-markdown', 'some-other-plugin'],
};
```

## Supported TypeDoc Options

### Pre-Render Options

Most of [TypeDoc's options](https://typedoc.org/options/) are used internally by TypeDoc to convert a project and define the structure of the models.
The majority of [TypeDoc's options](https://typedoc.org/options/) are used internally by TypeDoc to convert a project and define the structure of the models.

These options are output/theme agnostic and can be set in the same as you would with the HTML theme:

Expand Down Expand Up @@ -47,16 +81,3 @@ Below is a list of which TypeDoc Output options are supported or not:
- `--gaID` No ❌
- `--hideGenerator` No ❌
- `--searchInComments` No ❌

## Option Typings

If you would like to inform your IDE about the shape of the exported options the plugin provides a `PluginOptions` interface that can be imported to a `typedoc.config.js` file with a `@type` annotation:

```js filename="typedoc.config.js"
/** @type {import('typedoc').TypeDocOptions & import('typedoc-plugin-markdown').PluginOptions} */
module.exports = {
entryPoints: ['./src/index.ts', './src/secondary-entry.ts'],
out: 'doc',
plugin: ['typedoc-plugin-markdown', 'some-other-plugin'],
};
```
2 changes: 1 addition & 1 deletion docs/pages/plugins/frontmatter.mdx
Expand Up @@ -36,7 +36,7 @@ Please see the [option guide](/plugins/frontmatter/options) for available config
title="View on Github"
icon={<FontAwesomeIcon icon={faGithub} />}
arrow={true}
href="https://github.com/tgreyuk/typedoc-plugin-markdown-examples/tree/main/examples/02-typedoc-plugin-frontmatter"
href="https://github.com/tgreyuk/typedoc-plugin-markdown-examples/tree/main/examples/08-frontmatter-example#readme"
target="_blank"
/>
</Cards>
2 changes: 1 addition & 1 deletion docs/pages/plugins/github-wiki.mdx
Expand Up @@ -29,7 +29,7 @@ The following is a simple example of a GithubWiki project running TypeDoc.
title="View Source on Github"
icon={<FontAwesomeIcon icon={faGithub} />}
arrow={true}
href="https://github.com/tgreyuk/typedoc-plugin-markdown-examples/tree/main/examples/04-typedoc-github-wiki-theme"
href="https://github.com/tgreyuk/typedoc-plugin-markdown-examples/tree/main/examples/07-typedoc-github-wiki-theme"
target="_blank"
/>
</Cards>
2 changes: 1 addition & 1 deletion docs/theme.config.jsx
Expand Up @@ -29,7 +29,7 @@ export default {
sidebar: {
defaultMenuCollapseLevel: 1,
},
editLink: { text: 'x' },
editLink: { content: '' },
banner: {
content: (
<>
Expand Down
Expand Up @@ -483,7 +483,7 @@ export const sanitizeComments: Partial<DeclarationOption> = {
* @category Utility
*/
export const anchorPrefix: Partial<DeclarationOption> = {
help: 'Custom anchor prefix',
help: 'Custom anchor prefix when anchoring to in-page symbols.',
type: ParameterType.String,
defaultValue: undefined,
};
Expand Down
5 changes: 5 additions & 0 deletions packages/typedoc-plugin-markdown/src/options/index.ts
@@ -1,3 +1,8 @@
import { TypeDocOptions } from 'typedoc';
import { PluginOptions } from './option-types';

export * from './option-maps';
export * from './option-types';
export * from './text-mappings';

export type Options = TypeDocOptions & PluginOptions;
Expand Up @@ -52,7 +52,7 @@ declare module 'typedoc' {
*/
export interface PluginOptions {
/**
* Custom anchor prefix
* Custom anchor prefix when anchoring to in-page symbols.
*/
anchorPrefix: string;

Expand Down
2 changes: 1 addition & 1 deletion packages/typedoc-plugin-markdown/src/public-api.ts
@@ -1,5 +1,5 @@
/**
* The public API of the plugin exposes some classes and types that can be used to extend the plugin. Please note this only covers the API relevant to this plugin and not cover the entire [TypeDoc API](https://typedoc.org/api/).
* The public API of the typedoc-plugin-markdown exposes some classes and types that can be used to customize the output of the plugin. Please note this only covers the API relevant to this plugin and not cover the entire [TypeDoc API](https://typedoc.org/api/).
*
* The APIs are typically consumed by writing [local plugins](/docs/customizing-output#local-plugins).
*
Expand Down

0 comments on commit 29d47c5

Please sign in to comment.