-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from AlexHedley/codeblock
Added Code Block Syntax Highlighting
- Loading branch information
Showing
23 changed files
with
313 additions
and
74 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,7 @@ | ||
# Docs | ||
|
||
- [Syntax Highlighter](SyntaxHighlighterExample.md) | ||
|
||
## Images | ||
|
||
- [Images](images/README.md) |
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,50 @@ | ||
# Syntax Highlighter Example | ||
|
||
See [Syntax Highlighter Module](https://quilljs.com/docs/modules/syntax) from the _QuillJS_ docs for more information. | ||
|
||
![Syntax Highlighter Example](images/SyntaxHighlighterExample.png "Syntax Highlighter Example") | ||
|
||
To turn on _Syntax Highlighting_ in your **Blazored Text Editor** just pass the property `Syntax="true"` and add the necessary library files (css/js). | ||
|
||
Then add the `ql-code-block` to your _Toolbar_. | ||
|
||
```html | ||
<BlazoredTextEditor Syntax="true"> | ||
<ToolbarContent> | ||
... | ||
<span class="ql-formats"> | ||
<button class="ql-code-block"></button> | ||
</span> | ||
</ToolbarContent> | ||
<EditorContent> | ||
... | ||
</EditorContent> | ||
</BlazoredTextEditor> | ||
``` | ||
|
||
## Blazor WASM | ||
|
||
Add to the `index.html` both CSS and JS for a syntax highlighter, for these examples I've chosen [highlight.js](https://highlightjs.org/). | ||
|
||
```html | ||
<head> | ||
... | ||
<!-- Include your favorite highlight.js stylesheet --> | ||
<link href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/atom-one-dark.min.css" rel="stylesheet"> | ||
... | ||
</head> | ||
``` | ||
|
||
Make sure to add the `js` before your Quill js library or you will get an error. | ||
|
||
```html | ||
<body> | ||
<!-- Include the highlight.js library --> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script> | ||
<!-- Quill library --> | ||
</body> | ||
``` | ||
|
||
## Blazor Server | ||
|
||
Repeat the above but instead of the `index.html` you will want to add / update your `_Host.cshtml`. |
File renamed without changes
File renamed without changes
File renamed without changes
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,17 @@ | ||
# Images | ||
|
||
## HTML Example | ||
|
||
![HTML Example](HTMLExample.png "HTML Example") | ||
|
||
## Delta Example | ||
|
||
![Delta Example](DeltaExample.png "Delta Example") | ||
|
||
## Inline Editing Example | ||
|
||
![Inline Editing Example](InlineEditingExample.png "Inline Editing Example") | ||
|
||
## Syntax Highlighter Example | ||
|
||
![Syntax Highlighter Example](SyntaxHighlighterExample.png "Syntax Highlighter Example") |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.