-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(stark-demo): hTML highlighting and 'Try it yourself'
ISSUES CLOSED: #601
- Loading branch information
1 parent
cbe4694
commit f5114f7
Showing
12 changed files
with
123 additions
and
59 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
57 changes: 57 additions & 0 deletions
57
showcase/src/app/demo/pretty-print/demo-pretty-print.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,57 @@ | ||
<mat-card> | ||
<h1 translate>SHOWCASE.DEMO.PRETTY-PRINT.TRY_IT_YOURSELF</h1> | ||
<form> | ||
<div class="pretty-print-input mb2"> | ||
<mat-form-field> | ||
<textarea name="unformattedData" | ||
[(ngModel)]="unformattedData" | ||
matInput | ||
rows="10" | ||
[placeholder]="'SHOWCASE.DEMO.PRETTY-PRINT.ENTER_DATA' | translate"> | ||
</textarea> | ||
</mat-form-field> | ||
</div> | ||
<div class="pretty-print-options mb1"> | ||
<stark-dropdown dropdownId="dataFormatDropdown" | ||
[options]="dataFormats" | ||
[value]="selectedDataFormat" | ||
placeholder="SHOWCASE.DEMO.PRETTY-PRINT.SELECT_DATAFORMAT" | ||
(dropdownSelectionChanged)="dataFormatDropdownOnChange($event)"> | ||
</stark-dropdown> | ||
<mat-checkbox class="highlighting-enabled-field ml3" | ||
(change)="$event ? toggleHighlightingEnabled() : null" | ||
[checked]="highlightingEnabled"> | ||
{{ 'SHOWCASE.DEMO.PRETTY-PRINT.ENABLE_HIGHLIGHTING' | translate }} | ||
</mat-checkbox> | ||
</div> | ||
<div class="pretty-print-result"> | ||
<stark-pretty-print [data]="unformattedData" | ||
[format]="selectedDataFormat" | ||
[enableHighlighting]="highlightingEnabled"> | ||
</stark-pretty-print> | ||
</div> | ||
</form> | ||
</mat-card> | ||
|
||
<example-viewer *ngFor="let fileType of fileTypes; trackBy: trackFileTypes" | ||
[extensions]="['HTML', 'SCSS', 'TS']" | ||
[filesPath]="fileType.path" | ||
[exampleTitle]="fileType.title"> | ||
<mat-tab-group> | ||
<mat-tab [label]="'SHOWCASE.DEMO.PRETTY-PRINT.ORIGINAL_CODE' | translate"> | ||
<div class="code-block">{{ fileType.rawData }}</div> | ||
</mat-tab> | ||
<mat-tab [label]="'SHOWCASE.DEMO.PRETTY-PRINT.PRETTY_PRINTED' | translate"> | ||
<div class="code-block"> | ||
<stark-pretty-print [data]="fileType.rawData" | ||
[format]="fileType.format" | ||
[enableHighlighting]="false"></stark-pretty-print> | ||
</div> | ||
</mat-tab> | ||
<mat-tab [label]="'SHOWCASE.DEMO.PRETTY-PRINT.PRETTY_PRINTED_WITH_HIGHLIGHTING' | translate"> | ||
<stark-pretty-print [data]="fileType.rawData" | ||
[format]="fileType.format" | ||
[enableHighlighting]="true"></stark-pretty-print> | ||
</mat-tab> | ||
</mat-tab-group> | ||
</example-viewer> |
5 changes: 5 additions & 0 deletions
5
.../pretty-print/pretty-print.component.scss → ...ty-print/demo-pretty-print.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
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 +1 @@ | ||
export * from "./pretty-print.component"; | ||
export * from "./demo-pretty-print.component"; |
22 changes: 0 additions & 22 deletions
22
showcase/src/app/demo/pretty-print/pretty-print.component.html
This file was deleted.
Oops, something went wrong.
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