chore(gulp): improve documentation and installation procedure

Simplifies the installation procedure by making the private configuration setup optional. Adds more
clarity to the README
This commit is contained in:
Maddison Hellstrom 2018-08-23 03:47:38 -07:00
parent 2550c3f4db
commit 23fd923066
3 changed files with 97 additions and 23 deletions

View File

@ -5,23 +5,50 @@ This is an automatically generated file - Do not edit it directly.
The source file is README.tmpl.md
-->
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
Maddy's SurfingKeys Configuration
=================================
### Maddy's SurfingKeys Configuration
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
<!-- TODO: Determine minimum SK version -->
<!-- #### Note: This configuration currently only supports SurfingKeys 0.9.14 and below. -->
This is my personal configuration for the wonderful [SurfingKeys](https://github.com/brookhong/Surfingkeys) browser extension.
#### Table of Contents
Its primary features include [keybindings for performing common actions](#site-specific-key-mappings) on many popular
sites, as well OmniBar support for [auto-completing searches](#bundled-search-engine-completions) within 44 sites (and growing)!
1. [Bundled Search Engine Completions](#bundled-search-engine-completions)
2. [Installation Instructions](#installation)
3. [Screenshots](#screenshots)
4. [License](#license)
Table of Contents
-----------------
#### Bundled Search Engine Completions
1. [Bundled Search Engine Completions](#bundled-search-engine-completions)
2. [Installation Instructions](#installation)
3. [Site-Specific Key Mappings](#site-specific-key-mappings)
4. [Screenshots](#screenshots)
5. [License](#license)
Features
--------------------------
### Site-Specific Key Mappings
Key mappings have been included which can help you perform some common actions
on many popular sites.
Some examples of these mappings are:
- Star the current GitHub/GitLab repository: `<site-leader>s`
- Follow a user on Twitter: `<site-leader>f`
- Upvote a post/comment on Reddit/HackerNews `<site-leader>s`
- Analyze the current Amazon Product using Fakespot `<site-leader>fs`
The mappings are activated by typing the `<site-leader>` (`<space>` by default),
followed by the key sequence.
See [conf.js](./conf.js) for all of the mappings.
<!--TODO: Autogenerate list of site mappings-->
### Bundled Search Engine Completions
There are currently 44 Search Engine auto-completions.
@ -83,7 +110,7 @@ For example, to open the Wikipedia completion, you would type `awp` while in nor
- `git`
- `node`
- `gulp`.
- `gulp`
##### 1. Clone
@ -98,7 +125,12 @@ $ cd surfingkeys-conf
$ npm install
```
##### 3. Private API Key Configuration
##### 3. (Optional) Private API Key Configuration
Some Search Engine Auto-Completions require private API keys for access. These
keys are defined in `conf.priv.js`, which is not itself included in this repository.
An example configuration containing instructions on how to generate each API key
can be found in [conf.priv.example.js](./conf.priv.example.js).
Copy the example private configuration:

View File

@ -1,21 +1,48 @@
<!--{{DISCLAIMER}}-->
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
Maddy's SurfingKeys Configuration
=================================
### Maddy's SurfingKeys Configuration
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
<!-- TODO: Determine minimum SK version -->
<!-- #### Note: This configuration currently only supports SurfingKeys 0.9.14 and below. -->
This is my personal configuration for the wonderful [SurfingKeys](https://github.com/brookhong/Surfingkeys) browser extension.
#### Table of Contents
Its primary features include [keybindings for performing common actions](#site-specific-key-mappings) on many popular
sites, as well OmniBar support for [auto-completing searches](#bundled-search-engine-completions) within <!--{{COMPL_COUNT}}--> sites (and growing)!
1. [Bundled Search Engine Completions](#bundled-search-engine-completions)
2. [Installation Instructions](#installation)
3. [Screenshots](#screenshots)
4. [License](#license)
Table of Contents
-----------------
#### Bundled Search Engine Completions
1. [Bundled Search Engine Completions](#bundled-search-engine-completions)
2. [Installation Instructions](#installation)
3. [Site-Specific Key Mappings](#site-specific-key-mappings)
4. [Screenshots](#screenshots)
5. [License](#license)
Features
--------------------------
### Site-Specific Key Mappings
Key mappings have been included which can help you perform some common actions
on many popular sites.
Some examples of these mappings are:
- Star the current GitHub/GitLab repository: `<site-leader>s`
- Follow a user on Twitter: `<site-leader>f`
- Upvote a post/comment on Reddit/HackerNews `<site-leader>s`
- Analyze the current Amazon Product using Fakespot `<site-leader>fs`
The mappings are activated by typing the `<site-leader>` (`<space>` by default),
followed by the key sequence.
See [conf.js](./conf.js) for all of the mappings.
<!--TODO: Autogenerate list of site mappings-->
### Bundled Search Engine Completions
There are currently <!--{{COMPL_COUNT}}--> Search Engine auto-completions.
@ -33,7 +60,7 @@ For example, to open the Wikipedia completion, you would type `awp` while in nor
- `git`
- `node`
- `gulp`.
- `gulp`
##### 1. Clone
@ -48,7 +75,12 @@ $ cd surfingkeys-conf
$ npm install
```
##### 3. Private API Key Configuration
##### 3. (Optional) Private API Key Configuration
Some Search Engine Auto-Completions require private API keys for access. These
keys are defined in `conf.priv.js`, which is not itself included in this repository.
An example configuration containing instructions on how to generate each API key
can be found in [conf.priv.example.js](./conf.priv.example.js).
Copy the example private configuration:
@ -100,10 +132,10 @@ If you already have a file in that location, make sure you back it up first!
#### Todo
- [ ] Add `CHANGELOG.md` using [conventional-changelog](https://github.com/conventional-changelog/conventional-changelog)
- [ ] Simplify installation process
- [ ] Improve code organization
- [ ] Ensure screenshots have a plain white background
- [ ] Add additional screenshots
- [x] Simplify installation process
- [x] Feed the kittens
### License

View File

@ -9,7 +9,6 @@ const os = require("os")
const fs = require("fs")
const { spawn } = require("child_process")
const { URL } = require("url")
const compl = require("./completions")
const paths = {
scripts: ["conf.priv.js", "completions.js", "conf.js"],
@ -53,7 +52,17 @@ gulp.task("lint", () =>
.pipe(eslint())
.pipe(eslint.format()))
gulp.task("build", ["clean", "lint", "readme"], () => gulp.src(paths.entry, { read: false })
gulp.task("check-priv", () => {
try {
fs.statSync("./conf.priv.js")
} catch (e) {
// eslint-disable-next-line no-console
console.log("Creating ./conf.priv.js based on ./conf.priv.example.js")
fs.copyFileSync("./conf.priv.example.js", "./conf.priv.js", fs.constants.COPYFILE_EXCL)
}
})
gulp.task("build", ["check-priv", "clean", "lint", "readme"], () => gulp.src(paths.entry, { read: false })
.pipe(parcel())
.pipe(rename(".surfingkeys"))
.pipe(gulp.dest("build")))
@ -72,6 +81,7 @@ gulp.task("watch-nogulpfile", () => {
})
gulp.task("readme", () => {
const compl = require("./completions") // eslint-disable-line global-require
const screens = {}
let screenshotList = ""
fs.readdirSync(path.join(__dirname, paths.screenshots)).forEach((s) => {