This repository has been archived by the owner on Jan 24, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docz-theme-default): add edit button for document (#180)
* feat(docz-core): add link property on Entry * fix(docz-core): adjust default arguments * feat(docz-theme-default): add edit page button on Page * chore(docz-theme-default): some css adjustments
- Loading branch information
1 parent
8c9f74e
commit e125a4f
Showing
15 changed files
with
136 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import * as path from 'path' | ||
import * as fs from 'fs-extra' | ||
import getPkgRepo from 'get-pkg-repo' | ||
import findup from 'find-up' | ||
|
||
import * as paths from '../config/paths' | ||
|
||
export const repoInfo = (): string | null => { | ||
try { | ||
const project = path.parse(findup.sync('.git')).dir | ||
const relative = path.relative(project, paths.root) | ||
const tree = path.join('/tree/master', relative) | ||
const pkg = fs.readJsonSync(paths.appPackageJson) | ||
const repo = getPkgRepo(pkg) | ||
|
||
return ( | ||
repo && | ||
repo.browsetemplate | ||
.replace('{domain}', repo.domain) | ||
.replace('{user}', repo.user) | ||
.replace('{project}', repo.project) | ||
.replace('{/tree/committish}', tree) | ||
) | ||
} catch (err) { | ||
return null | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,24 @@ | ||
import * as React from 'react' | ||
import { SFC, ComponentType } from 'react' | ||
import styled from 'react-emotion' | ||
|
||
export const Button = styled('button')` | ||
const BaseButton = styled('button')` | ||
cursor: pointer; | ||
display: flex; | ||
align-items: center; | ||
outline: none; | ||
border: none; | ||
` | ||
|
||
interface ButtonProps { | ||
as?: ComponentType | string | ||
} | ||
|
||
export const Button: SFC<ButtonProps> = ({ | ||
as: Component = BaseButton, | ||
...props | ||
}) => <Component {...props} /> | ||
|
||
export const ButtonLink = styled(Button)` | ||
background: transparent; | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters