Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@financial-times/o-syntax-highlight

Package Overview
Dependencies
Maintainers
16
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@financial-times/o-syntax-highlight - npm Package Compare versions

Comparing version 1.6.4 to 2.0.0

4

origami.json

@@ -7,2 +7,6 @@ {

"origamiVersion": 1,
"brands": [
"master",
"internal"
],
"support": "https://github.com/Financial-Times/o-syntax-highlight/issues",

@@ -9,0 +13,0 @@ "supportContact": {

2

package.json

@@ -26,3 +26,3 @@ {

"name": "@financial-times/o-syntax-highlight",
"version": "1.6.4",
"version": "2.0.0",
"description": "syntax highlighter for FT products",

@@ -29,0 +29,0 @@ "homepage": "https://github.com/Financial-Times/o-syntax-highlight",

@@ -17,3 +17,3 @@

This component provides accessible syntax highlighting for Javascript, JSON, HTML, CSS, Sass and SCSS.
This component provides accessible syntax highlighting for `bash`, `diff`, Javascript, JSON, HTML, CSS and Sass/SCSS.
_If there are any languages you would like to highlight that we don't currently support, please open an issue and we will provide it._

@@ -129,20 +129,35 @@

### Sass
As with all Origami components, o-syntax-highlight has a [silent mode](http://origami.ft.com/docs/syntax/scss/#silent-styles). To use its compiled CSS (rather than using its mixins with your own Sass) set `$o-syntax-highlight-is-silent: false;` in your Sass before you import the o-syntax-highlight Sass.
You can't choose your own classnames, but you can choose to load specific language styles as follows:
You can include highlighting for all languages by calling:
```scss
@include oSyntaxHighlightBase();
@include oSyntaxHighlightJSON();
@include oSyntaxHighlight();
```
The same is applicable for the other languages:
- Javascript: `oSyntaxHighlightJS()`
- HTML: `oSyntaxHighlightHTML()`
- CSS: `oSyntaxHighlightCSS()`
- SCSS/SASS: `oSyntaxHighlightSCSS()`
- JSON: `oSyntaxHighlightJSON()`
- DIFF: `oSyntaxHighlightDIFF()`
You can also be more specific about which languages you would like styling output for by using an `$opts` map:
```scss
@include oSyntaxHighlight($opts: (
'languages': (
'html',
'json'
)
));
```
`o-syntax-highlight` accespts the following options:
- 'bash'
- 'css'
- 'diff'
- 'html'
- 'js' _or_ 'javascript'
- 'json'
- 'scss' _or_ 'sass'
---
## Migration
State | Major Version | Last Minor Release | Migration guide |
:---: | :---: | :---: | :---:
✨ active | 2 | N/A | [migrate to v2](MIGRATION.md#migrating-from-v1-to-v2) |
⚠ maintained | 1 | 1.6.4 | N/A |
## Contact

@@ -152,3 +167,2 @@

----

@@ -155,0 +169,0 @@ ## Licence

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc