Skip to content

Commit 051a110

Browse files
authored
Merge pull request #73 from andrewbranch/v2
V2
2 parents 7a6c8db + aa7bfa9 commit 051a110

File tree

107 files changed

+9918
-7156
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+9918
-7156
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,4 @@ lib/extensions
7171
# Autogenerated content
7272
lib/grammars
7373
lib/themes
74-
test/integration/report.html
74+
test/integration/viewer/report.html

CODE_OF_CONDUCT.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8+
9+
## Our Standards
10+
11+
Examples of behavior that contributes to a positive environment for our community include:
12+
13+
* Demonstrating empathy and kindness toward other people
14+
* Being respectful of differing opinions, viewpoints, and experiences
15+
* Giving and gracefully accepting constructive feedback
16+
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17+
* Focusing on what is best not just for us as individuals, but for the overall community
18+
19+
Examples of unacceptable behavior include:
20+
21+
* The use of sexualized language or imagery, and sexual attention or
22+
advances of any kind
23+
* Trolling, insulting or derogatory comments, and personal or political attacks
24+
* Public or private harassment
25+
* Publishing others' private information, such as a physical or email
26+
address, without their explicit permission
27+
* Other conduct which could reasonably be considered inappropriate in a
28+
professional setting
29+
30+
## Enforcement Responsibilities
31+
32+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33+
34+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35+
36+
## Scope
37+
38+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39+
40+
## Enforcement
41+
42+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [email protected]. All complaints will be reviewed and investigated promptly and fairly.
43+
44+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45+
46+
## Enforcement Guidelines
47+
48+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49+
50+
### 1. Correction
51+
52+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53+
54+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55+
56+
### 2. Warning
57+
58+
**Community Impact**: A violation through a single incident or series of actions.
59+
60+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61+
62+
### 3. Temporary Ban
63+
64+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65+
66+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67+
68+
### 4. Permanent Ban
69+
70+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71+
72+
**Consequence**: A permanent ban from any sort of public interaction within the community.
73+
74+
## Attribution
75+
76+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77+
available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78+
79+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80+
81+
[homepage]: https://www.contributor-covenant.org
82+
83+
For answers to common questions about this code of conduct, see the FAQ at
84+
https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.

CONTRIBUTING.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Contributing
2+
3+
## Code of Conduct
4+
5+
Please note that this project is released with a Contributor [Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
6+
7+
## Open an issue
8+
9+
PRs introducing new ideas are always welcome, but might be declined if opened without any prior discussion. To avoid wasted work, it’s always best to [open an issue](https://github.com/andrewbranch/gatsby-remark-vscode/issues/new) first.
10+
11+
## Local development setup
12+
13+
Prerequisites: development is supported on the current [Node LTS](https://nodejs.org/).
14+
15+
1. Fork and clone the repo.
16+
2. Run `npm install`
17+
18+
Running `npm install` should automatically initialize or update the [vscode](./vscode) submodule, generate `src/graphql/schema.d.ts`, and populate [`lib/grammars`](lib/grammars) and [`lib/themes`](lib/themes). If any of these things are missing, you’ll errors when you try to run things later. You can rerun these steps with `npm run build`.
19+
20+
## Tests
21+
22+
To run tests, run `npm test`. You can use Jest CLI options after a `--` separator. For example, to run just the test named “code-fence-meta”, use `npm test -- -t code-fence-meta`.
23+
24+
Most tests are either Jest snapshot tests or HTML baseline tests against a known-good source ([`test/integration/cases/baselines`](test/integration/cases/baselines)). To update the snapshots and baselines, run `npm test -- -u`.
25+
26+
Most new tests can be integration tests. To write one, create a new folder in `test/integration/cases`, then put a Markdown file named `test.md` inside. If you want to run the plugin with custom options, place an `options.js` file whose `module.exports` is the options object to be passed to the plugin. Then, when you next run `npm test`, the baseline will be created and opened in a browser so you can view the resulting HTML. If it looks right, commit it and you’re done. If it looks wrong, you can overwrite the bad baseline by running `npm test -- -u -t name-of-test` after you’ve made changes to fix your code.
27+
28+
## Debugging
29+
30+
VS Code launch scripts have been provided, so you can debug the tests or the [example site](examples/example-site) by using VS Code’s debug menu. Otherwise, you can always run `node --inspect-brk node_modules/.bin/jest --runInBand` and attach with whatever debugger you like.
31+
32+
## Get ready for a PR
33+
34+
When you’ve made changes you’re happy with, ensure that you have
35+
36+
- Added a test if appropriate,
37+
- Formatted your changes through Prettier with `npm run format`,
38+
- Maintained good JSDoc type annotations to the best of your ability.
39+
40+
This project is written in plain JavaScript, but uses TypeScript to type-check via JSDoc annotations. After tests, type checking runs (and can be run alone with `npm run check`). If types are new to you, or you have trouble getting type checking to pass, that’s ok! I’ll help you in your PR if necessary. Type checking is a great way to catch errors early, but I don’t want it to be an impediment for anyone’s contribution.

MIGRATING.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Migration Guide
2+
3+
## v1 → v2
4+
5+
### Extensions are no longer downloaded automatically.
6+
7+
- If you did not use themes or languages beyond the default included set, no change is necessary.
8+
- If you relied on the `extensions` plugin option to download extensions:
9+
- Find the extension source on GitHub, npm, or elsewhere. (Extensions listed on the Visual Studio Marketplace typically link to their GitHub repos.)
10+
- Ensure the license allows you to use the code on your site, and follow all license requirements.
11+
- Install or copy the extension into your project:
12+
- You can install from GitHub by running `npm install owner-name/repo-name`.
13+
- If you clone the source and build a `.vsix`, you can copy that file into your project.
14+
- Alternatively, you can copy the full extension source or clone as a submodule into your project.
15+
- Replace the `extensions` array with an array of strings specifying where to find each extension:
16+
- If you installed the extension into `node_modules`, use just the package name, e.g. `extensions: ['oceanic-next']`
17+
- If you copied the extension source or `.vsix` into your project, use an absolute path, e.g. ``extensions: [`${__dirname}/vendor/oceanic-next.vsix`, `${__dirname}/vendor/atom-one-dark`]``
18+
- If you used the `extensionDataDirectory` option, it should be unnecessary now, since all extensions are read from disk. You can specify a specific location for each extension by providing paths to the `extensions` array.
19+
20+
### The `colorTheme` plugin option has been deprecated and replaced by the `theme` option.
21+
22+
- If you did not supply `colorTheme`, no change is necessary.
23+
- If your `colorTheme` is a string, rename the `colorTheme` key to `theme`.
24+
- If your `colorTheme` is an object:
25+
- Rename the `defaultTheme` key to `default`.
26+
- If present, rename the `prefersDarkTheme` to `dark`.
27+
- If you have a `prefersLightTheme`, replace it with an entry in the new `media` array. For example:
28+
29+
```diff
30+
{
31+
- defaultTheme: 'Default Dark+',
32+
- prefersLightTheme: 'Solarized Light'
33+
+ default: 'Default Dark+',
34+
+ media: [{
35+
+ match: '(prefers-color-scheme: light)',
36+
+ theme: 'Solarized Light'
37+
+ }]
38+
}
39+
```
40+
41+
The new `theme` option also supports some options that `colorTheme` did not; you can read about the full API in the [README](README.md#multi-theme-support).
42+
43+
### CSS variables and class names have changed
44+
45+
- If you wrote custom CSS targeting the class `.vscode-highlight`, replace that selector with `.grvsc-container`.
46+
- If you wrote custom CSS targeting any other class beginning with `.vscode-highlight`, replace the `.vscode-highlight` prefix with `.grvsc`. For example, `.vscode-highlight-line` is now `.grvsc-line`.
47+
- If you set any CSS variables, replace the `--vscode-highlight` prefix with `--grvsc`. For example, `--vscode-highlight-border-radius` is now `--grvsc-border-radius`.
48+
- If you wrote custom CSS targeting a token class name beginning with `.mtk`, that was never intended to be supported! Consider using `replaceColor` instead, or [file an issue](https://github.com/andrewbranch/gatsby-remark-vscode/issues/new) if you think you have a compelling use case for writing custom token CSS.
49+
50+
### Known issues
51+
52+
- Usage with [gatsby-plugin-mdx](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-mdx) requires [email protected] or later.

0 commit comments

Comments
 (0)