Skip to content

Commit

Permalink
fix: removed deprecated options.
Browse files Browse the repository at this point in the history
  • Loading branch information
tgreyuk committed Apr 26, 2024
1 parent 38442e4 commit 663dae7
Show file tree
Hide file tree
Showing 13 changed files with 61 additions and 175 deletions.
5 changes: 5 additions & 0 deletions .changeset/four-bugs-fail.md
@@ -0,0 +1,5 @@
---
"typedoc-plugin-markdown": patch
---

- Removed deprecated options.
8 changes: 0 additions & 8 deletions docs/pages/api-docs/Interface.PluginOptions.md
Expand Up @@ -92,14 +92,6 @@ Do not print breadcrumbs.

***

### hideInPageTOC

> **hideInPageTOC**: `boolean`
Do not render in-page TOC items.

***

### hidePageHeader

> **hidePageHeader**: `boolean`
Expand Down
48 changes: 0 additions & 48 deletions docs/pages/docs/options.mdx
Expand Up @@ -297,54 +297,6 @@ Ignored if `flattenOutputFiles` is set to `true`.

---

### ~hideInPageTOC~

<Callout type="warning">
Deprecated - In-page TOC is now hidden as default.
</Callout>

> Accepts a boolean value. Defaults to `false`.
```json filename="typedoc.json"
{
"hideInPageTOC": false
}
```

---

### ~indexPageTitle~

<Callout type="warning">Deprecated - Please use `textContentMappings`.</Callout>

> Accepts a string value. Defaults to `"{ProjectName}"`.
Provides a mechanism to change the main project index page title.

```json filename="typedoc.json"
{
"indexPageTitle": "{ProjectName}"
}
```

---

### ~memberPageTitle~

<Callout type="warning">Deprecated - Please use `textContentMappings`.</Callout>

> Accepts a string value. Defaults to `"{kind}: {name}"`.
Provides a mechanism to configure the page title of members.

```json filename="typedoc.json"
{
"memberPageTitle": "{kind}: {name}"
}
```

---

### excludeGroups

<Callout emoji="💡">
Expand Down
38 changes: 0 additions & 38 deletions packages/typedoc-plugin-markdown/src/options/declarations.ts
Expand Up @@ -251,44 +251,6 @@ export const hideBreadcrumbs: Partial<DeclarationOption> = {
defaultValue: false,
};

/**
* @deprecated In-page TOC is now hidden as default.
*
* @category UX
*/
export const hideInPageTOC: Partial<DeclarationOption> = {
help: 'Do not render in-page TOC items.',
type: ParameterType.Boolean,
defaultValue: false,
};

/**
* Provides a mechanism to change the main project index page title.
*
* @deprecated Please use `textContentMappings`.
*
* @category UX
*
*/
export const indexPageTitle: Partial<DeclarationOption> = {
help: 'The title of project index page.',
type: ParameterType.String,
defaultValue: '{ProjectName}',
};

/**
* Provides a mechanism to configure the page title of members.
*
* @deprecated Please use `textContentMappings`.
*
* @category UX
*/
export const memberPageTitle: Partial<DeclarationOption> = {
help: 'The page title of member pages.',
type: ParameterType.String,
defaultValue: '{kind}: {name}',
};

/**
* By default members are grouped by kind (eg Classes, Functions etc).
*
Expand Down
18 changes: 0 additions & 18 deletions packages/typedoc-plugin-markdown/src/options/option-types.ts
Expand Up @@ -15,12 +15,9 @@ declare module 'typedoc' {
fileExtension: string;
flattenOutputFiles: boolean;
hideBreadcrumbs: boolean;
hideInPageTOC: boolean;
hidePageHeader: boolean;
hidePageTitle: boolean;
indexFormat: 'list' | 'table';
indexPageTitle: string;
memberPageTitle: string;
membersWithOwnFile: (
| 'Enum'
| 'Variable'
Expand Down Expand Up @@ -109,11 +106,6 @@ export interface PluginOptions {
*/
hideBreadcrumbs: boolean;

/**
* Do not render in-page TOC items.
*/
hideInPageTOC: boolean;

/**
* Do not print page header.
*/
Expand All @@ -129,16 +121,6 @@ export interface PluginOptions {
*/
indexFormat: 'list' | 'table';

/**
* The title of project index page.
*/
indexPageTitle: string;

/**
* The page title of member pages.
*/
memberPageTitle: string;

/**
* Determines which members are exported to their own file when `outputFileStrategy` equals `members`.
*/
Expand Down
Expand Up @@ -8,9 +8,7 @@ import { MarkdownThemeContext, TextContentMappings } from '../../..';
export function pageTitle(this: MarkdownThemeContext): string {
const page = this.page;
if (page.model?.url === page.project.url) {
const titleContent = this.options.isSet('indexPageTitle')
? this.options.getValue('indexPageTitle')
: this.getText('title.indexPage');
const titleContent = this.getText('title.indexPage');
return titleContent
.replace('{projectName}', page.project.name)
.replace(
Expand All @@ -26,9 +24,7 @@ export function pageTitle(this: MarkdownThemeContext): string {
const textContent =
page.model.kind === ReflectionKind.Module
? this.getText('title.modulePage')
: this.options.isSet('memberPageTitle')
? this.options.getValue('memberPageTitle')
: this.getText('title.memberPage');
: this.getText('title.memberPage');

const kindKey = SINGULAR_KIND_KEY_MAP[
ReflectionKind.singularString(page.model.kind)
Expand Down
3 changes: 0 additions & 3 deletions packages/typedoc-plugin-markdown/test/fixtures/config.ts
Expand Up @@ -20,7 +20,6 @@ const config: Record<string, Fixture> = {
enumMembersFormat: 'table',
useCodeBlocks: true,
expandParameters: true,
memberPageTitle: '{name}',
navigationModel: {
excludeGroups: true,
},
Expand Down Expand Up @@ -90,7 +89,6 @@ const config: Record<string, Fixture> = {
excludeGroups: true,
useHTMLAnchors: true,
indexFormat: 'table',
indexPageTitle: '{projectName}',
categorizeByGroup: false,
},
],
Expand Down Expand Up @@ -135,7 +133,6 @@ const config: Record<string, Fixture> = {
excludeScopesInPaths: true,
mergeReadme: true,
includeVersion: true,
indexPageTitle: 'API',
indexFormat: 'table',
},
],
Expand Down
Expand Up @@ -49,7 +49,7 @@ Comments for abstractMethod
`;

exports[`Class Reflection should compile abstract class: (Output File Strategy "members") (Option Group "2") 1`] = `
"# \`abstract\` AbstractClass
"# Class: \`abstract\` AbstractClass
## Extended by
Expand Down Expand Up @@ -140,7 +140,7 @@ Comments for method
`;

exports[`Class Reflection should compile basic class: (Output File Strategy "members") (Option Group "2") 1`] = `
"# BasicClass
"# Class: BasicClass
Comments for BasicClass
Expand Down Expand Up @@ -264,7 +264,7 @@ Param comments
`;

exports[`Class Reflection should compile class with accessors: (Output File Strategy "members") (Option Group "2") 1`] = `
"# ClassWithAccessors
"# Class: ClassWithAccessors
Comments for ClassWithAccessors
Expand Down Expand Up @@ -400,7 +400,7 @@ Comments for someProp
`;

exports[`Class Reflection should compile class with complex props: (Output File Strategy "members") (Option Group "2") 1`] = `
"# ClassWithComplexProps
"# Class: ClassWithComplexProps
Comments for ClassWithComplexProps
Expand Down Expand Up @@ -490,7 +490,7 @@ Comments for x string
`;

exports[`Class Reflection should compile class with constructor overloads: (Output File Strategy "members") (Option Group "2") 1`] = `
"# ClassWithConstructorOverloads
"# Class: ClassWithConstructorOverloads
Comments for ClassWithConstructorOverloads
Expand Down Expand Up @@ -633,7 +633,7 @@ Comment for ClassWithFlags
`;

exports[`Class Reflection should compile class with flags: (Output File Strategy "members") (Option Group "2") 1`] = `
"# ClassWithFlags
"# Class: ClassWithFlags
Comment for ClassWithFlags
Expand Down Expand Up @@ -822,7 +822,7 @@ Comment for staticMethod
`;

exports[`Class Reflection should compile class with modifiers: (Output File Strategy "members") (Option Group "2") 1`] = `
"# \`abstract\` ClassWithModifiers
"# Class: \`abstract\` ClassWithModifiers
Comments for ClassWithModifiers
Expand Down Expand Up @@ -988,7 +988,7 @@ SomeTag
`;

exports[`Class Reflection should compile class with simple props: (Output File Strategy "members") (Option Group "2") 1`] = `
"# ClassWithSimpleProps
"# Class: ClassWithSimpleProps
Comments for ClassWithSimpleProps
Expand Down Expand Up @@ -1045,7 +1045,7 @@ Comments for param B
`;

exports[`Class Reflection should compile class with type parameters: (Output File Strategy "members") (Option Group "2") 1`] = `
"# ClassWithTypeParameters\\<A, B, C\\>
"# Class: ClassWithTypeParameters\\<A, B, C\\>
Comments for ClassWithTypeParameters
Expand Down Expand Up @@ -1157,7 +1157,7 @@ Comments for abstractMethod
`;

exports[`Class Reflection should compile derived class: (Output File Strategy "members") (Option Group "2") 1`] = `
"# DerivedClassA
"# Class: DerivedClassA
Comments for DerivedClassA
Expand Down
Expand Up @@ -32,7 +32,7 @@ Comments for MemberB
`;

exports[`Enum Reflection should compile basic enum: (Output File Strategy "members") (Option Group "2") 1`] = `
"# BasicEnum
"# Enumeration: BasicEnum
Comments for enum
Expand Down Expand Up @@ -73,7 +73,7 @@ Comments for enum
`;

exports[`Enum Reflection should compile enum with values: (Output File Strategy "members") (Option Group "2") 1`] = `
"# EnumWithValues
"# Enumeration: EnumWithValues
Comments for enum
Expand Down

0 comments on commit 663dae7

Please sign in to comment.