Skip to content

Commit

Permalink
Update docs for V5
Browse files Browse the repository at this point in the history
  • Loading branch information
mjswensen committed Feb 25, 2023
1 parent a4ad55a commit 2a4b7a5
Show file tree
Hide file tree
Showing 5 changed files with 313 additions and 304 deletions.
56 changes: 15 additions & 41 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,7 @@ Thanks for contributing to themer! All contributions are welcome, and are expect
- [Log a bug](#log-a-bug)
- [Request a theme template](#request-a-theme-template)
- [Provide a theme template implementation](#provide-a-theme-template-implementation)
- [Option 1: as part of the themer repository](#option-1-as-part-of-the-themer-repository)
- [Option 2: as a third-party npm package](#option-2-as-a-third-party-npm-package)
- [Provide a color set](#provide-a-color-set)
- [Option 1: for personal use](#option-1-for-personal-use)
- [Option 1.1: using themer.dev](#option-11-using-themerdev)
- [Option 1.2: using npm](#option-12-using-npm)
- [Option 2: as part of the themer repository](#option-2-as-part-of-the-themer-repository)

## Log a bug

Expand All @@ -33,30 +27,12 @@ If you use a tool that themer doesn't support yet, feel free to request it by cr

## Provide a theme template implementation

### Option 1: as part of the themer repository

If there is a theme template that should be distributed as an officially supported package (under the `@themer` namespace on npm), it should be contributed directly to the themer repository rather than as a standalone package as in Option 2 below.

1. Clone the themer repository.
2. `cd cli`
3. `npm install` to install dependencies
4. Run `./scripts/generate-template-package.zsh <the name of the tool or program you are making a theme template for>`. This step is optional but will save you some time as it sets up the basic scaffolding for your package. (For wallpaper templates, use the `generate-wallpaper-package.zsh` script instead.)
5. Implement your theme's `render()` function in `/cli/packages/<your package>/lib/index.js`, following the documentation in the ["Create your own template" section of the README](https://github.com/themerdev/themer#create-your-own-template).
6. Develop and test your package with the following command within the `/cli/packages` directory: `./themer/bin/themer.js -c ./colors-default -t ./<your package directory> -o <some output directory you can inspect, like /tmp/themer>`
7. Submit a pull request.
8. After merging, your package will be released to npm under the `@themer` namespace and then included in the web UI at [https://themer.dev](themer.dev).

### Option 2: as a third-party npm package

If you would like to implement a theme template for personal use, or would like to maintain the theme independent of themer's main repository, the easiest way is to author your own npm package that exports a `render()` function as documented on the ["Create your own template" section of the README](https://github.com/themerdev/themer#create-your-own-template).

To develop and test your package using the themer CLI, the following command may be used (requires Node.js to be installed):

npx -p themer -p @themerdev/colors-default themer -c @themerdev/colors-default -t <path to your local package directory> -o <path to your desired output directory>

Once your package is developed, you can publish it for free on the npm registry. I would recommend prefixing the name with `themer-` so that others can easily find it.

Once published, open a pull request to add your package to the [list of community-contributed theme templates](https://github.com/themerdev/themer#community) (or simply reach out through an issue on GitHub or message to [@themerdev on Twitter](https://twitter.com/themerdev)).
4. Create a new file in the `src/template/` directory.
5. Implement the template interface, following the documentation in the ["Create custom `Template`s" section of the README](https://github.com/themerdev/themer#create-custom-templates).
6. Submit a pull request.

## Provide a color set

Expand All @@ -68,27 +44,25 @@ There are a few different ways to develop your own themes and share them with ot

The easiest way to create your personal theme is to configure it using the web UI at [themer.dev](https://themer.dev). After doing so, you can simply share your unique URL however you'd like. On supported browsers, there is a convenient "Copy URL" button at the bottom of the page that can be used for easy sharing, or you can simply copy the contents of your browser's address bar to share your theme.

You can also download your theme and a `colors.js` file that is compatible with themer's CLI will automatically be included. You can use this file on your local machine or publish it to npm if desired.

#### Option 1.2: using npm
You can also download your theme and a `colors.js` file that is compatible with themer's CLI will automatically be included.

You can also publish your personal themes to npm for others to use with themer's CLI. To do so, define your colors following the instructions under the ["Create your own color set" section of the README](https://github.com/themerdev/themer#create-your-own-color-set). To test your color configuration file, you can use the following command:
#### Option 1.2: using the CLI or API

npx -p themer -p @themerdev/vscode themer -c <path to your colors file> -t @themerdev/vscode -o <path to your desired output directory>
Define your colors following the instructions under the ["Create custom `ColorSet`s" section of the README](https://github.com/themerdev/themer#create-custom-colorsets). To test your color configuration file, you can use the following command:

(Note that you can use any template you wish in place of `@themerdev/vscode`.)
```sh
npx themer -c <path to your colors file> -t vs-code -o <path to your desired output directory>
```

Once your color set package is ready, you can publish it on the npm registry. I would recommend prefixing the name with `themer-colors-` so that others can easily find it.
(Note that you can use any template you wish in place of `vs-code`.)

### Option 2: as part of the themer repository
### Option 2: as an official built-in color set

If a color set should be distributed on npm under the `@themer` namespace and included in the official web UI at [themer.dev](https://themer.dev), it should be included in themer's main repository rather than distributed separately as in option 1 above.
If a color set should be distributed with `themer` in the official web UI at [themer.dev](https://themer.dev), it should be included in themer's main repository rather than distributed separately as in option 1 above.

1. Clone the themer repository.
2. `cd cli`
3. `npm install` to install dependencies
4. Run `./scripts/generate-color-package.zsh <the name of the color set>`. This step is optional but will save you some time as it sets up the basic scaffolding for your package.
5. Implement your color set's `colors` object in `/cli/packages/<your package>/lib/index.js`, following the documentation in the ["Create your own color set" section of the README](https://github.com/themerdev/themer#create-your-own-color-set).
6. Develop and test your package with the following command within the `/cli/packages` directory: `./themer/bin/themer.js -c ./<your package directory> -t ./vscode -t ./wallpaper-block-wave -o <some output directory you can inspect, like /tmp/themer>`
7. Submit a pull request.
8. After merging, your package will be released to npm under the `@themer` namespace and then included in the web UI at [https://themer.dev](themer.dev).
4. Create a new file in the `src/color-set/` directory.
5. Implement your color set interface, following the documentation in the ["Create custom `ColorSet`s" section of the README](https://github.com/themerdev/themer#create-custom-colorsets).
6. Submit a pull request.
7 changes: 3 additions & 4 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,15 @@ Please fill out the following information if you are using the web UI at [themer
- Browser [e.g. Chrome, Safari]:
- Browser version [e.g. 22]:

## CLI
## CLI or API

Please fill out the following information if you are using the command-line interface. For the web UI, you can delete this section.
Please fill out the following information if you are using the command-line interface or programmatic API. For the web UI, you can delete this section.

- Device [e.g. iPhone6, MacBook Pro]:
- OS [e.g. iOS, macOS]:
- OS version [e.g. 14.0]:
- Node version [e.g. 14.4.0]:
- `themer` version [e.g. 3.3.4]:
- Other `themer` packages and their versions [e.g. `@themerdev/[email protected]`]:
- `themer` version [e.g. 5.0.0]:

# Additional context

Expand Down
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"esbenp.prettier-vscode",
"streetsidesoftware.code-spell-checker"
],
"unwantedRecommendations": []
}
20 changes: 19 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
"editor.formatOnSave": true,
"cSpell.words": [
"alacritty",
"bbedit",
"chriskempson",
"conemu",
"dotfiles",
"iterm",
"Jamstacker",
"keypirinha",
"konsole",
"lightline",
"seti",
"themer",
"themerdev",
"trevordmiller",
"trianglify",
"xresources"
]
}
Loading

0 comments on commit 2a4b7a5

Please sign in to comment.