Skip to content

Commit 9e267ab

Browse files
committed
CDN version update
1 parent 4901990 commit 9e267ab

File tree

4 files changed

+22
-47
lines changed

4 files changed

+22
-47
lines changed

Diff for: .npmignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
assets
2+
demo

Diff for: README.md

+19-46
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,24 @@
1+
![](./assets/salesforce_platform.png)
2+
13
# Apex - a language grammar for the [Salesforce Platform](https://developer.salesforce.com)
4+
[![NPM](https://nodei.co/npm/highlightjs-apex.png)](https://www.npmjs.com/package/highlightjs-apex)
25

3-
[![NPM](https://nodei.co/npm/highlightjs-apex.png)](https://npmjs.org/package/highlightjs-apex)
6+
[![npm](https://img.shields.io/npm/v/highlightjs-apex)](https://www.npmjs.com/package/highlightjs-apex)
7+
[![npm](https://img.shields.io/npm/dt/highlightjs-apex)](https://www.npmjs.com/package/highlightjs-apex)
8+
![install size](https://badgen.net/packagephobia/install/highlightjs-apex)
9+
[![GitHub](https://img.shields.io/github/license/highlightjs/highlightjs-apex)](https://github.com/highlightjs/highlightjs-apex/blob/main/LICENSE.md)
10+
![Snyk Vulnerabilities for npm package](https://img.shields.io/snyk/vulnerabilities/npm/highlightjs-apex)
11+
[![CDN download](https://badgen.net/badge/jsDelivr/download/blue?icon=jsdelivr)](https://cdn.jsdelivr.net/npm/highlightjs-apex/dist/apex.min.js)
412

513
## Demo
614

7-
The below screenshot was captured from a [demo webpage](demo/testcode.html) after dropping `highlight.min.js` to a `dist` folder.
8-
(Code taken from [Salesforce Trigger Framework](https://github.com/dschach/salesforce-trigger-framework) and Highlight Java example code)
15+
The screenshot was captured from a [demo webpage](demo/testcode.html) after dropping `highlight.min.js` to a `dist` folder.
16+
(Code taken from [Salesforce Trigger Framework](https://dschach.github.io/salesforce-trigger-framework/) and Highlight Java example code)
917
![Demo](demo/ApexHighlighting.png)
1018

1119
## Usage
1220

13-
Simply include the Highlight.js library in your webpage or Node app, then load this module.
21+
Simply include the Highlight.js library in your webpage or Node app, then load this module. For more complex usage, see [highlight.js usage](https://github.com/highlightjs/highlight.js#basic-usage).
1422

1523
### Static website or simple usage
1624

@@ -19,7 +27,8 @@ Simply load this module after loading Highlight.js. You'll use the minified vers
1927
```html
2028
<script type="text/javascript" src="/path/to/highlight.min.js"></script>
2129
<script type="text/javascript" src="/path/to/apex.min.js"></script>
22-
<!-- Use any stylesheet you'd like - though it's best to choose from those in highlightjs core repo -->
30+
<!-- Use any stylesheet you'd like - though it's best to choose from
31+
those in highlightjs core repo -->
2332
<link rel="stylesheet" href="https://unpkg.com/highlightjs/styles/vs.css" />
2433
<script type="text/javascript">
2534
hljs.highlightAll();
@@ -38,14 +47,15 @@ This will find and highlight code inside of `<pre><code>` tags; it tries to dete
3847

3948
For more details see [Highlight.js main page](https://github.com/highlightjs/highlight.js#highlightjs).
4049

41-
### Using directly from the UNPKG CDN
50+
### Using directly from jsDelivr
4251

4352
```html
53+
<script src="https://cdn.jsdelivr.net/gh/highlightjs/[email protected]/build/highlight.min.js"></script>
4454
<script type="text/javascript"
45-
src="https://unpkg.com/highlightjs-apex/dist/apex.min.js"></script>
55+
src="https://cdn.jsdelivr.net/npm/highlightjs-apex/dist/apex.min.js"></script>
4656
```
4757

48-
- More info: <https://unpkg.com>
58+
- More info: <https://www.jsdelivr.com/>
4959

5060
### With Node or another build system
5161

@@ -59,51 +69,14 @@ hljs.registerLanguage('apex', hljsApex);
5969
hljs.highlightAll();
6070
```
6171

62-
63-
### React
64-
65-
You need to import both Highlight.js and third-party language like Apex:
66-
67-
```js
68-
import React, {Component} from 'react'
69-
import 'highlight.js/scss/vs.scss' # your favourite theme
70-
import apex from './apex'
71-
import hljs from 'highlight.js'
72-
hljs.registerLanguage('apex', apex);
73-
74-
class Highlighter extends Component
75-
{
76-
constructor(props)
77-
{
78-
super(props);
79-
hljs.highlightAll();
80-
}
81-
82-
render()
83-
{
84-
let {children} = this.props;
85-
return
86-
{
87-
<pre ref={(node) => this.node = node}>
88-
<code className="language-apex">
89-
{children}
90-
</code>
91-
</pre>
92-
}
93-
}
94-
}
95-
96-
export default Highlighter;
97-
```
98-
9972
## License
10073

10174
Highlight.js is released under the BSD 3-Clause License. See [LICENSE](https://github.com/highlightjs/highlight.js/blob/main/LICENSE) file for details.
10275
Highlightjs-apex is released under the MIT License. See [LICENSE](/LICENSE.md) file for details.
10376

10477
## Author
10578

106-
David Schach [[David Schach](https://github.com/dschach)](https://github.com/dschach)
79+
David Schach [https://github.com/dschach](https://github.com/dschach)
10780

10881
## Contribution
10982

Diff for: assets/salesforce_platform.png

64.2 KB
Loading

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"url": "git+https://github.com/highlightjs/highlightjs-apex.git"
1515
},
1616
"keywords": [
17-
"apex",
17+
"Apex",
1818
"Salesforce",
1919
"hljs",
2020
"highlightjs",

0 commit comments

Comments
 (0)