-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docs): demo for Covalent Text/Markdown Editor (#804)
* feat(docs): Covalent Text/Markdown Editor Demo Added demo for Covalent Text/Markdown Editor into Covalent Docs * updating markdown demo example text * updating markdown demo example text * docs(text-editor): responsive side-by-side demo * docs(text-editor): update icon, text & color
- Loading branch information
1 parent
1a7c71b
commit 3127d76
Showing
9 changed files
with
105 additions
and
2 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
39 changes: 39 additions & 0 deletions
39
src/app/components/components/text-editor/text-editor.component.html
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,39 @@ | ||
<md-card> | ||
<md-card-title>Markdown Text Editor</md-card-title> | ||
<md-card-subtitle>Simple markdown text editor component</md-card-subtitle> | ||
<md-divider></md-divider> | ||
<md-card-content> | ||
<p>With this component you can utilize SimpleMDE as an Angular Component.</p> | ||
</md-card-content> | ||
<md-divider></md-divider> | ||
<md-card-actions> | ||
<a md-button color="accent" href="https://github.com/Teradata/covalent-text-editor" target="_blank" class="text-upper">Github Repo</a> | ||
<a md-button color="accent" href="https://www.npmjs.com/package/@covalent/text-editor" target="_blank" class="text-upper">npm Module</a> | ||
</md-card-actions> | ||
</md-card> | ||
<md-card> | ||
<md-card-title>Demo</md-card-title> | ||
<md-card-subtitle>Edit the markdown in the left editor for a real-time preview</md-card-subtitle> | ||
<md-divider></md-divider> | ||
<md-toolbar hide show-gt-md> | ||
<div layout="row" flex> | ||
<span flex="55">Editor</span> | ||
<span flex="45">Preview</span> | ||
</div> | ||
</md-toolbar> | ||
<md-divider hide show-gt-md></md-divider> | ||
<div layout-gt-md="row" class="bgc-grey-50" tdMediaToggle="gt-md" [mediaStyles]="{height: '650px'}"> | ||
<div flex-gt-md="55" layout-gt-md="column" class="pad-sm"> | ||
<td-text-editor flex-gt-md [(ngModel)]="editorVal"></td-text-editor> | ||
</div> | ||
<div flex-gt-md="45" layout-gt-md="column" class="md-content pad-sm"> | ||
<td-markdown flex-gt-md [content]="editorVal"></td-markdown> | ||
</div> | ||
</div> | ||
</md-card> | ||
|
||
<td-readme-loader resourceUrl="https://raw.githubusercontent.com/Teradata/covalent-text-editor/master/docs/API.md"> | ||
</td-readme-loader> | ||
|
||
<td-readme-loader resourceUrl="https://raw.githubusercontent.com/Teradata/covalent-text-editor/master/docs/SETUP.md"> | ||
</td-readme-loader> |
3 changes: 3 additions & 0 deletions
3
src/app/components/components/text-editor/text-editor.component.scss
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,3 @@ | ||
.editor { | ||
height: 200px; | ||
} |
37 changes: 37 additions & 0 deletions
37
src/app/components/components/text-editor/text-editor.component.ts
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,37 @@ | ||
import { Component, HostBinding, ViewChild } from '@angular/core'; | ||
import { slideInDownAnimation } from '../../../app.animations'; | ||
import { TdTextEditorComponent } from '@covalent/text-editor'; | ||
|
||
@Component({ | ||
selector: 'text-editor-demo', | ||
styleUrls: [ './text-editor.component.scss' ], | ||
templateUrl: './text-editor.component.html', | ||
animations: [slideInDownAnimation], | ||
}) | ||
export class TextEditorDemoComponent { | ||
|
||
@ViewChild('editor') private _tdEditor: TdTextEditorComponent; | ||
@HostBinding('@routeAnimation') routeAnimation: boolean = true; | ||
@HostBinding('class.td-route-animation') classAnimation: boolean = true; | ||
|
||
editorVal: string = `# Intro | ||
Go ahead, play around with the editor! Be sure to check out **bold** and *italic* styling, or even [links](https://google.com). | ||
You can type the Markdown syntax, use the toolbar, or use shortcuts like 'cmd-b' or 'ctrl-b'. | ||
## Lists | ||
Unordered lists can be started using the toolbar or by typing '* ', '- ', or '+ '. Ordered lists can be started by typing '1. '. | ||
#### Unordered | ||
* Lists are a piece of cake | ||
* They even auto continue as you type | ||
* A double enter will end them | ||
* Tabs and shift-tabs work too | ||
#### Ordered | ||
1. Numbered lists... | ||
2. ...work too! | ||
## What about images? | ||
![Yes](https://i.imgur.com/sZlktY7.png) | ||
`; | ||
} |
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