forked from realdennis/md2pdf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b074901
commit 495e6bd
Showing
6 changed files
with
56 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React from 'react'; | ||
import { UnControlled as CodeMirror } from 'react-codemirror2'; | ||
import styled from 'styled-components'; | ||
import 'codemirror/lib/codemirror.css'; | ||
import 'codemirror/theme/darcula.css'; | ||
import 'codemirror/mode/gfm/gfm.js'; | ||
// import 'codemirror/addon/edit/closebrackets.js'; | ||
// import 'codemirror/addon/edit/matchbrackets'; | ||
// import 'codemirror/addon/search/search.js'; | ||
// import 'codemirror/addon/search/searchcursor.js' | ||
// import 'codemirror/addon/dialog/dialog.js'; | ||
const Editor = ({ className, text,setText }) => { | ||
return ( | ||
<CodeMirror | ||
className={className} | ||
value={text} | ||
options={{ | ||
mode: 'gfm', | ||
theme: 'darcula', | ||
lineNumbers: true, | ||
lineWrapping: true | ||
}} | ||
onChange={(editor, data, value) => { | ||
setText(value) | ||
}} | ||
/> | ||
); | ||
}; | ||
export default styled(Editor)` | ||
height: 100%; | ||
.CodeMirror { | ||
height: 100%; | ||
line-height: 1.5; | ||
} | ||
`; |
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,21 +1,17 @@ | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
import EditArea from './EditArea.js'; | ||
|
||
// import EditArea from './EditArea.js'; | ||
import Mirror from './MirrorEditor.js'; | ||
const Editor = ({ className, text, setText, width }) => { | ||
return ( | ||
<div style={{ width }} className={className}> | ||
<EditArea text={text} setText={setText}> | ||
{text} | ||
</EditArea> | ||
<Mirror text={text} setText={setText}/> | ||
</div> | ||
); | ||
}; | ||
export default styled(Editor)` | ||
flex-shrink: 0; | ||
padding-left: 15px; | ||
padding-bottom: 20px; | ||
height: 100%; | ||
width: 50%; | ||
background-color: #282c35; | ||
color: rgb(204, 204, 204); | ||
`; |
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