Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove default template headers of Hierarchy and Type Parameters from DefaultThemeRenderContext when overridden. #2038

Merged
merged 3 commits into from Aug 26, 2022

Conversation

kaphula
Copy link
Contributor

@kaphula kaphula commented Aug 22, 2022

If you create your own theme by extending DefaultThemeRenderContext and attempt to override this.hierarchy or this.typeParameters with empty content (disable them), their HTML headers get generated to the output document regardless. This PR removes the HTML headers if the default template is overridden.

export class FooterOverrideThemeContext extends DefaultThemeRenderContext {
  constructor(theme: DefaultTheme, options: Options) {
    super(theme, options);
    // disable:
    this.hierarchy = () => { return (<></>)}
    this.typeParameters = () => { return(<></>)}
  }
}

…om DefaultThemeRenderContext when overridden.
@@ -18,15 +18,13 @@ export function reflectionTemplate(context: DefaultThemeRenderContext, props: Pa

{hasTypeParameters(props.model) && (
<section class="tsd-panel tsd-type-parameters">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason the <section> (and maybe even the condition) didn't move into the helpers? Seems like you'd still have elements you don't want if modifying these helpers.

Copy link
Collaborator

@Gerrit0 Gerrit0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Gerrit0 Gerrit0 merged commit e9c3181 into TypeStrong:master Aug 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants