Skip to content

Commit 56651b3

Browse files
authored
ci(npm): configure npm (#24)
docs: update README
1 parent 372d827 commit 56651b3

File tree

4 files changed

+24
-12
lines changed

4 files changed

+24
-12
lines changed

.github/workflows/release-please.yml

-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ jobs:
3535
- name: Publish to npm
3636
# Release Please has already incremented versions and published tags, so we just
3737
# need to publish all unpublished versions to NPM here
38-
# See: https://github.com/lerna/lerna/tree/main/commands/publish#bump-from-package
3938
if: ${{ steps.release.outputs.releases_created }}
4039
run: npm publish --provenance
4140
env:

README.md

+14-9
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@
1313

1414
## Demo
1515

16-
The screenshot was captured from a [demo webpage](demo/testcode.html) using `highlight.min.js` from the `dist` folder.
17-
(Code taken from [Salesforce Trigger Framework](https://dschach.github.io/salesforce-trigger-framework/))
18-
![Demo](demo/ApexHighlighting.png)
16+
The screenshot was captured from a webpage using `apex.min.js` from the `dist` folder and the main `highlight.min.js` library.
17+
(Code is from [Salesforce Trigger Framework](https://dschach.github.io/salesforce-trigger-framework/))
18+
![Demo](assets/ApexHighlighting.png)
19+
Feel free to use any css library you'd like!
1920

2021
## Usage
2122

@@ -28,9 +29,10 @@ Simply load this module after loading Highlight.js. You'll use the minified vers
2829
```html
2930
<script type="text/javascript" src="/path/to/highlight.min.js"></script>
3031
<script type="text/javascript" src="/path/to/apex.min.js"></script>
31-
<!-- Use any stylesheet you'd like - though it's best to choose from
32-
those in highlightjs core repo -->
33-
<link rel="stylesheet" href="https://unpkg.com/highlightjs/styles/vs.css" />
32+
<!-- <link rel="stylesheet" href="https://unpkg.com/highlightjs/styles/vs.css" /> -->
33+
<!-- Use any stylesheet you'd like - though Apex developers may want to use the custom theme based on MavensMate's Monokai -->
34+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/highlightjs-apex/src/styles/monokai-sublime-apex.css" />
35+
3436
<script type="text/javascript">
3537
hljs.highlightAll();
3638
</script>
@@ -52,9 +54,7 @@ For more details see [Highlight.js main page](https://github.com/highlightjs/hig
5254

5355
```html
5456
<script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release/build/highlight.min.js"></script>
55-
<script
56-
type="text/javascript"
57-
src="https://cdn.jsdelivr.net/npm/highlightjs-apex/dist/apex.min.js"></script>
57+
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/highlightjs-apex/dist/apex.min.js"></script>
5858
```
5959

6060
- More info: <https://www.jsdelivr.com/>
@@ -71,6 +71,11 @@ hljs.registerLanguage('apex', hljsApex);
7171
hljs.highlightAll();
7272
```
7373

74+
### Styles
75+
76+
There are many styles to choose from at [https://highlightjs.org/demo](https://highlightjs.org/demo). They can be downloaded from [the GitHub repository](https://github.com/highlightjs/highlight.js/tree/main/src/styles) and referenced from unpkg.com (see sample html above).
77+
A great stylesheet for Apex is in this repo in the [styles folder](https://github.com/highlightjs/highlightjs-apex/tree/main/src/styles).
78+
7479
## License
7580

7681
Highlight.js is released under the BSD 3-Clause License. See [LICENSE](https://github.com/highlightjs/highlight.js/blob/main/LICENSE) file for details.
File renamed without changes.

package.json

+10-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
"description": "Apex Language of Salesforce highlighting plugin for highlight.js",
55
"main": "src/languages/apex.js",
66
"scripts": {
7-
"test": "./node_modules/.bin/mocha --reporter spec",
7+
"test": "mocha --reporter spec",
88
"mocha": "mocha test/markup",
9-
"npm-patch": "npm version patch && npm publish"
9+
"npm-patch": "npm version patch && npm publish",
10+
"npm-beta": "npm publish --tag beta"
1011
},
1112
"repository": {
1213
"type": "git",
@@ -19,6 +20,13 @@
1920
"highlightjs",
2021
"highlight.js"
2122
],
23+
"files": [
24+
"assets",
25+
"dist",
26+
"src",
27+
"test",
28+
"CHANGELOG.md"
29+
],
2230
"author": "David Schach (https://github.com/dschach)",
2331
"license": "MIT",
2432
"bugs": {

0 commit comments

Comments
 (0)