You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+4-3
Original file line number
Diff line number
Diff line change
@@ -16,13 +16,14 @@ You can learn more on [prismjs.com](https://prismjs.com/).
16
16
Prism depends on community contributions to expand and cover a wider array of use cases. If you like it, considering giving back by sending a pull request. Here are a few tips:
17
17
18
18
- Read the [documentation](https://prismjs.com/extending.html). Prism was designed to be extensible.
19
-
- Do not edit `prism.js`, it’s just the version of Prism used by the Prism website and is built automatically. Limit your changes to the unminified files in the `components/` folder. The minified files are also generated automatically.
20
-
- The build system uses [gulp](https://github.com/gulpjs/gulp) to minify the files and build `prism.js`. Having gulp installed, you just need to run the command `gulp`.
19
+
- Do not edit `prism.js`, it’s just the version of Prism used by the Prism website and is built automatically. Limit your changes to the unminified files in the `components/` folder. `prism.js` and all minified files are also generated automatically by our build system.
20
+
- The build system uses [gulp](https://github.com/gulpjs/gulp) to minify the files and build `prism.js`. With all of Prism's dependencies installed, you just need to run the command `npm run build`.
21
21
- Please follow the code conventions used in the files already. For example, I use [tabs for indentation and spaces for alignment](http://lea.verou.me/2012/01/why-tabs-are-clearly-superior/). Opening braces are on the same line, closing braces on their own line regardless of construct. There is a space before the opening brace. etc etc.
22
22
- Please try to err towards more smaller PRs rather than few huge PRs. If a PR includes changes I want to merge and changes I don't, handling it becomes difficult.
23
23
- My time is very limited these days, so it might take a long time to review longer PRs (short ones are usually merged very quickly), especially those modifying the Prism Core. This doesn't mean your PR is rejected.
24
24
- If you contribute a new language definition, you will be responsible for handling bug reports about that language definition.
25
-
- If you add a new language definition, theme or plugin, you need to add it to `components.json` as well and rebuild Prism by running `gulp`, so that it becomes available to the download build page. For new languages, please also add a few [tests](https://prismjs.com/test-suite.html) and an example in the `examples/` folder.
25
+
- If you [add a new language definition](https://prismjs.com/extending.html#creating-a-new-language-definition) or plugin, you need to add it to `components.json` as well and rebuild Prism by running `npm run build`, so that it becomes available to the download build page. For new languages, please also add a few [tests](https://prismjs.com/test-suite.html) and an example in the `examples/` folder.
26
+
- Go to [prism-themes](https://github.com/PrismJS/prism-themes) if you want to add a new theme.
Copy file name to clipboardexpand all lines: extending.html
+5-3
Original file line number
Diff line number
Diff line change
@@ -158,11 +158,11 @@ <h1>Creating a new language definition</h1>
158
158
<p><em>Note:</em> Any changes made to <code>components.json</code> require a rebuild (see step 3).</p>
159
159
</li>
160
160
<li>
161
-
<p>Rebuild Prism by running <codeclass="language-bash">npx gulp</code>.</p>
161
+
<p>Rebuild Prism by running <codeclass="language-bash">npm run build</code>.</p>
162
162
163
163
<p>This will make your language available to the <ahref="test.html">test page</a>, or more precise: your local version of it. You can open your local <code>test.html</code> page in any browser, select your language, and see how your language definition highlights any code you input.</p>
164
164
165
-
<p><em>Note:</em> You have to reload the test page to apply changes made to <code>prism-foo-bar.js</code>.</p>
165
+
<p><em>Note:</em> You have to reload the test page to apply changes made to <code>prism-foo-bar.js</code> but you don't have to rebuild Prism itself. However, if you change <code>components.json</code> (e.g. because you added a dependency) then these changes will not show up until you rebuild Prism.</p>
166
166
</li>
167
167
<li>
168
168
<p>Write the language definition.</p>
@@ -255,7 +255,9 @@ <h1>Creating a new language definition</h1>
255
255
We don't have any rules as to what counts as an example, so a single <em>Full example</em> section where you present the highlighting of the major features of the language is enough.</p>
0 commit comments