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

Add expand and allow custom root section options #1689

Merged
merged 6 commits into from Sep 9, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -66,7 +66,7 @@ export default class TableOfContents extends Component<TableOfContentsProps> {
content,
selected,
shouldOpenInNewTab: !!section.external && !!section.externalLink,
initialOpen: this.props.tocMode !== 'collapse' || containsSelected,
initialOpen: this.props.tocMode !== 'collapse' || containsSelected || section.expand,
forcedOpen: !!this.state.searchTerm.length,
};
});
Expand Down
1 change: 1 addition & 0 deletions src/loaders/utils/getSections.ts
Expand Up @@ -88,6 +88,7 @@ export function processSection(
}

return {
...section,
name: section.name,
Copy link
Member

Choose a reason for hiding this comment

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

We don't need this line anymore, and also description and external below.

exampleMode: section.exampleMode || config.exampleMode,
usageMode: section.usageMode || config.usageMode,
Expand Down
1 change: 1 addition & 0 deletions src/typings/RsgSection.ts
Expand Up @@ -12,6 +12,7 @@ export interface BaseSection {
href?: string;
sectionDepth?: number;
external?: boolean;
expand?: boolean;
}

export interface ProcessedSection extends BaseSection {
Expand Down