Skip to content

Commit b97b850

Browse files
committed
Add build instructions
1 parent a6cb23d commit b97b850

File tree

1 file changed

+28
-8
lines changed

1 file changed

+28
-8
lines changed

README.md

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,31 @@
33

44
## Contributing
55

6+
### Building
7+
8+
Development requires [Node.js](https://nodejs.org) and NPM:
9+
10+
```shell
11+
sudo apt install nodejs npm
12+
```
13+
14+
To build the extension:
15+
16+
```shell
17+
npm run build
18+
```
19+
20+
There is also `npm run dev` which will spawn a process that watches for changes and rebuilds the extension automatically.
21+
22+
The files that drive the extension are:
23+
24+
* `manifest.json` - This is read by browsers to let it know what permissions the extension needs, and where things like the extension options page and icons are. Note the `content_scripts` section that calls out `scpnet.org`, this is for the "interwiki" iframe provided by SCP-RU.
25+
* `options.html` - This is the webpage that appears when you open the extension's options, and is the UI for setting preferences.
26+
* `options.js` - This handles the loading and saving of preferences via the `chrome.storage.sync.get/set` API.
27+
* `main.js` - This handles the injection of the stylesheets into the bottom of the `head` so they cascade correctly.
28+
29+
### Adding new styles
30+
631
There are five available types of stylesheets to build:
732

833
1. Layouts (movement of elements around the page, margins and padding for big block-level stuff.
@@ -15,6 +40,8 @@ They also cascade in that order, with layout injected first and ratings last. Th
1540

1641
If you want a unified theme that touches more than one area, it needs to be broken out into different stylesheets. That means no `background-color:` selectors in a `.layouts.css` file and no `position:` stuff in a `.fonts.css` file.
1742

43+
If you add a stylesheet, you need to add a corresponding option line in `options.html`. The extension is not smart enough to do it dynamically and probably won't ever be due to an interest in keeping it small and lightweight.
44+
1845
There is also a `/img` folder where you put your thumbnail of the look of the thing. Dimensions are:
1946

2047
* Color: 275x225
@@ -25,13 +52,6 @@ There is also a `/img` folder where you put your thumbnail of the look of the th
2552

2653
If you have assets that need to be loaded like alternate logos, please store them on http://www.scp-wiki.net/component:s-css-p which will require a wikidot login, or get them to me in some other manner and I will handle it. Do *not* link to imgur or some other image hosting service in your CSS.
2754

28-
The files that drive the extension are:
29-
30-
* `manifest.json` - This is read by browsers to let it know what permissions the extension needs, and where things like the extension options page and icons are. Note the `content_scripts` section that calls out `scpnet.org`, this is for the "interwiki" iframe provided by SCP-RU.
31-
* `options.html` - This is static so if you add a stylesheet, you need to add a corresponding option line here. The extension is not smart enough to do it dynamically and probably won't ever be due to an interest in keeping it small and lightweight.
32-
* `options.js` - This handles the loading and saving of preferences via the `chrome.storage.sync.get/set` API.
33-
* `main.js` - This handles the injection of the stylesheets into the bottom of the `head` so they cascade correctly.
34-
3555
## Overriding S-CSS-P
3656

37-
If you have a page that contains custom CSS and would like to alert users of S-CSS-P that they should consider disabling the extension, please edit the slug of your page into http://scp-wiki.net/component:s-css-p in the code block. This is not yet implemented but the next major milestone will include this capability.
57+
If you have a page that contains custom CSS and would like to alert users of S-CSS-P that they should consider disabling the extension, please edit the slug of your page into http://scp-wiki.net/component:s-css-p in the code block. This is not yet implemented but the next major milestone will include this capability.

0 commit comments

Comments
 (0)