Skip to content

Commit 6f650dc

Browse files
committed
chore: minor repo maintenance
1 parent f62a026 commit 6f650dc

File tree

11 files changed

+341
-329
lines changed

11 files changed

+341
-329
lines changed

.babelrc

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
{
22
"presets": [
3-
["@babel/preset-env", {
4-
"targets": {
5-
"browsers": ["last 2 versions"]
3+
[
4+
"@babel/preset-env",
5+
{
6+
"targets": {
7+
"browsers": ["last 2 versions"]
8+
}
69
}
7-
}],
10+
],
811
"@babel/preset-react"
912
]
1013
}

.eslintrc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
{
2-
"extends": [
3-
"@readme/eslint-config",
4-
"@readme/eslint-config/react"
5-
],
2+
"extends": ["@readme/eslint-config", "@readme/eslint-config/react"],
63
"root": true
74
}

.github/CONTRIBUTING.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ For our general commit conventions please consult our organization contributing
1010

1111
To add a new language:
1212

13-
* Create a new directory in the fixtures directory for the language (for example): `__tests__/__fixtures__/js/`
14-
* Add a `sample.js` file into `__tests__/__fixtures__/js/` containing a code snippet of the language you're targeting
15-
* https://github.com/leachim6/hello-world/ is a helpful resource covering most every language
16-
* Add a `index.js` file in `__tests__/__fixtures__/js/` that matches the following structure:
13+
- Create a new directory in the fixtures directory for the language (for example): `__tests__/__fixtures__/js/`
14+
- Add a `sample.js` file into `__tests__/__fixtures__/js/` containing a code snippet of the language you're targeting
15+
- https://github.com/leachim6/hello-world/ is a helpful resource covering most every language
16+
- Add a `index.js` file in `__tests__/__fixtures__/js/` that matches the following structure:
1717

1818
```js
1919
module.exports = {
@@ -31,13 +31,13 @@ module.exports = {
3131
aliases: {
3232
// Any additional extension modes that this language might utilize or be known under (SQL
3333
// variants for example). Consult the CodeMirror meta file for this list.
34-
languageModeAlias: 'Language Name'
34+
languageModeAlias: 'Language Name',
3535
},
3636
},
3737
};
3838
```
3939

40-
* Update `canonical.js` and add any mode aliases you've added into your test, mapping them back to the canonical version
41-
* `yml``yaml`, `ts``typescript`, etc.
42-
* Update `uppercase.js` for any new language names, or aliases, you've added.
43-
* Lastly, make sure that the README is updated! 🚀
40+
- Update `canonical.js` and add any mode aliases you've added into your test, mapping them back to the canonical version
41+
- `yml``yaml`, `ts``typescript`, etc.
42+
- Update `uppercase.js` for any new language names, or aliases, you've added.
43+
- Lastly, make sure that the README is updated! 🚀

.github/dependabot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: 2
22
updates:
33
- package-ecosystem: github-actions
4-
directory: "/"
4+
directory: '/'
55
schedule:
66
interval: monthly
77
reviewers:
@@ -13,7 +13,7 @@ updates:
1313
prefix-development: chore(deps-dev)
1414

1515
- package-ecosystem: npm
16-
directory: "/"
16+
directory: '/'
1717
schedule:
1818
interval: monthly
1919
open-pull-requests-limit: 10

.github/workflows/codeql-analysis.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
name: "CodeQL"
1+
name: 'CodeQL'
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [main]
66
pull_request:
7-
branches: [ main ]
7+
branches: [main]
88
schedule:
99
- cron: '0 0 1 * *'
1010

@@ -20,16 +20,16 @@ jobs:
2020
strategy:
2121
fail-fast: false
2222
matrix:
23-
language: [ 'javascript' ]
23+
language: ['javascript']
2424

2525
steps:
26-
- name: Checkout repository
27-
uses: actions/checkout@v4
26+
- name: Checkout repository
27+
uses: actions/checkout@v4
2828

29-
- name: Initialize CodeQL
30-
uses: github/codeql-action/init@v3
31-
with:
32-
languages: ${{ matrix.language }}
29+
- name: Initialize CodeQL
30+
uses: github/codeql-action/init@v3
31+
with:
32+
languages: ${{ matrix.language }}
3333

34-
- name: Perform CodeQL Analysis
35-
uses: github/codeql-action/analyze@v3
34+
- name: Perform CodeQL Analysis
35+
uses: github/codeql-action/analyze@v3

.npmignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
__tests__/
22
.github/
3-
.husky/
43
coverage/
54
.eslint*
65
.prettier*

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ __tests__/__fixtures__/
22
__tests__/__snapshots__/
33
coverage/
44
dist/
5+
*.html
6+
*.scss

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2020, ReadMe
1+
Copyright (c) 2024, ReadMe
22

33
Permission to use, copy, modify, and/or distribute this software for any purpose
44
with or without fee is hereby granted, provided that the above copyright notice

README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,23 @@ npm install --save @readme/syntax-highlighter
1313
```
1414

1515
## Usage
16+
1617
### Read Only Mode
18+
1719
```js
1820
const syntaxHighlighter = require('@readme/syntax-highlighter');
1921
const ele = syntaxHighlighter('console.log("Hello, world!");', 'js');
2022
```
2123

2224
### Read Only with Line Numbers
25+
2326
```js
2427
const syntaxHighlighter = require('@readme/syntax-highlighter');
2528
const ele = syntaxHighlighter('console.log("Hello, world!");', 'js', { ...opts, highlightMode: true });
2629
```
2730

2831
### Read Only with Line Numbers and Highlighted Ranges
32+
2933
```js
3034
const syntaxHighlighter = require('@readme/syntax-highlighter');
3135
const ele = syntaxHighlighter('console.log("Hello, world!");', 'js', {
@@ -41,19 +45,17 @@ const ele = syntaxHighlighter('console.log("Hello, world!");', 'js', {
4145
```
4246

4347
### Full CodeMirror
48+
4449
Access to a full code Mirror instance. See configuration settings in the [`react-codemirror2` library][react-codemirror#props]
4550

4651
```js
4752
const syntaxHighlighter = require('@readme/syntax-highlighter');
48-
const ele = syntaxHighlighter(
49-
'console.log("Hello, world!");',
50-
'js',
51-
{ ...opts, editable: true },
52-
{ ...editorProps }
53-
);
53+
const ele = syntaxHighlighter('console.log("Hello, world!");', 'js', { ...opts, editable: true }, { ...editorProps });
5454
```
5555

5656
### Available Options
57+
58+
<!-- prettier-ignore-start -->
5759
| Name | Type | Description |
5860
| :--- | :--- | :--- |
5961
| `customTheme` | String | Highlighting theme. One of `neo`, `material-palenight`, or `tomorrow-night`. (Setting this will override the `dark` mode option.)
@@ -63,9 +65,11 @@ const ele = syntaxHighlighter(
6365
| `inline` | String | Wrap code in a `<span>` tag, instead of a `<div>`. |
6466
| `ranges` | Array | Ranges of line numbers to apply highlighting to. Requires `highlightMode` enabled |
6567
| `tokenizeVariables` | Boolean | Match and render [ReadMe variables](rdme-variable) in your markdown. |
68+
<!-- prettier-ignore-end -->
6669

6770
## Languages Supported
6871

72+
<!-- prettier-ignore-start -->
6973
| Language | Available language mode(s) |
7074
| :--- | :--- |
7175
| ASP.NET | `asp`, `aspx` |
@@ -110,7 +114,7 @@ const ele = syntaxHighlighter(
110114
| TOML | `toml` |
111115
| TypeScript | `ts`, `typescript` |
112116
| YAML | `yaml`, `yml` |
113-
117+
<!-- prettier-ignore-end -->
114118

115119
[rdme-variable]: https://github.com/readmeio/api-explorer/tree/next/packages/variable
116120
[codemirror]: https://github.com/codemirror/CodeMirror

0 commit comments

Comments
 (0)