This repository has been archived by the owner on Nov 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Prism addon): Add prisom addon for syntax highlighting
- Loading branch information
Showing
3 changed files
with
15 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Prism addon | ||
|
||
Syntax highlighting for `CodeFragment` and `CodeBlock` nodes using [Prism](https://prismjs.com/). You can also use this addon to style executable node types like `CodeExpression` and `CodeChunk` if you do not use the `stencila-components` addon. | ||
|
||
## Notes | ||
|
||
- Currently this addon renders syntax highlighting in the browser. In the future, we may take a similar approach as for MathJax and pre-render HTML in Encoda. See "Usage with Node" on https://prismjs.com/. | ||
|
||
- Currently, syntax highlighting is only enabled for a limited number of languages. There is a https://prismjs.com/plugins/autoloader/ plugin but that would not be usable with are Parcel bundling approach. That is one reason in favor of doing pre-rending in Encoda - a reader would not have to load the Javascript to every language. | ||
|
||
- There are many [plugins](https://prismjs.com/plugins) that may be appropriate to either add here, or as other addons e.g. `prism-line-numbers`. |
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 @@ | ||
import 'prismjs' | ||
import 'prismjs/components/prism-python' | ||
import 'prismjs/components/prism-r' |
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 @@ | ||
@import 'prismjs/themes/prism.css'; |