Skip to content
This repository has been archived by the owner on Jan 24, 2025. It is now read-only.

Commit

Permalink
feat(docz-core): add entry settings field
Browse files Browse the repository at this point in the history
  • Loading branch information
pedronauck committed May 25, 2018
1 parent 12c0558 commit 2ec5d66
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/docz-core/src/Entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const getName = getFromParsedData('name')
const getRoute = getFromParsedData('route')
const getMenu = getFromParsedData('menu')
const getOrder = getFromParsedData('order')
const getSettings = getFromParsedData('settings')

export class Entry {
readonly [key: string]: any
Expand All @@ -47,6 +48,7 @@ export class Entry {
public name: string
public menu: string | null
public order: number
public settings: any

constructor(ast: any, file: string, src: string) {
const filepath = this.getFilepath(file, src)
Expand All @@ -58,6 +60,7 @@ export class Entry {
this.name = getName(ast)
this.menu = getMenu(ast)
this.order = parseInt(getOrder(ast), 10) || 0
this.settings = getSettings(ast) || {}
}

private getFilepath(file: string, src: string): string {
Expand Down
3 changes: 3 additions & 0 deletions packages/docz/src/theme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ export interface Entry {
name: string
menu: string | null
order: number
settings: {
[key: string]: any
}
}

export interface ThemeConfig {
Expand Down

0 comments on commit 2ec5d66

Please sign in to comment.