Skip to content

Commit

Permalink
Readme changes & assets added
Browse files Browse the repository at this point in the history
  • Loading branch information
molnarmark committed Nov 1, 2020
1 parent d211520 commit abb0024
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 23 deletions.
4 changes: 2 additions & 2 deletions carbonSublime.py → Carbon.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import sublime
import sublime_plugin

SETTINGS_FILE = 'carbonSublime.sublime-settings'
SETTINGS_FILE = 'Carbon.sublime-settings'
CODE_MAX_LENGTH = 3400

# Carbon language mapping
Expand Down Expand Up @@ -137,7 +137,7 @@ def get_whitespace_from_line_beginning(view, region):
return " " * n_space


class CarbonSublimeCommand(sublime_plugin.TextCommand):
class CarbonCommand(sublime_plugin.TextCommand):
def run(self, edit, **kwargs):
code = self.normalize_code()
self.generate_carbon_link(code)
Expand Down
2 changes: 1 addition & 1 deletion carbonSublime.sublime-commands → Carbon.sublime-commands
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[
{
"caption": "Carbon: Share Selection",
"command": "carbon_sublime"
"command": "carbon"
}
]
1 change: 1 addition & 0 deletions carbonSublime.sublime-settings → Carbon.sublime-settings
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"trim_indent": true,
"default": {
"paddingVertical": "48px",
"paddingHorizontal": "32px",
Expand Down
4 changes: 2 additions & 2 deletions Main.sublime-menu
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
"mnemonic": "P",
"children": [
{
"caption": "carbonSublime",
"caption": "Carbon",
"children": [
{
"caption": "Settings",
"command": "edit_settings",
"args": {
"base_file": "${packages}/Carbon/carbonSublime.sublime-settings",
"base_file": "${packages}/Carbon/Carbon.sublime-settings",
"default": "{\n\t$0\n}\n"
}
}
Expand Down
56 changes: 38 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
![](https://i.imgur.com/nk0e21I.png)

## Getting Started

Carbon Sublime (or Carbon via Package Control) is a Sublime Text 3 Plugin for [Carbon](https://carbon.now.sh).
Carbon is a Sublime Text 3 Plugin for [Carbon](https://carbon.now.sh).

### Installation

Install Carbon via Package Control.
Install _Carbon_ via Package Control.

### Usage

#### Command Palette

You can use the command `Carbon: share selection` from the command palette (ctrl/cmd + shift + p) to open Carbon.
You can use the command `Carbon: Share Selection` from the command palette (ctrl/cmd + shift + p) to open Carbon.

#### Keymap

This package doesn't provide a default keymap. If you need to, add a keymap setting like the following to your Sublime keymap file:

```json
{"keys": ["f3"], "command": "carbon_sublime"}
{ "keys": ["f3"], "command": "carbon" }
```

Then go into your file, select a region, and press the bound key.
Expand All @@ -27,24 +28,43 @@ Then go into your file, select a region, and press the bound key.

You can open the configuration file via the menu:

Preferences > Package Settings > carbonSublime > Settings. It defaults to:
Preferences > Package Settings > Carbon > Settings. It defaults to the **default** preset in the Carbon app:

```json
{
"background-color": "rgba(12, 108, 189, 1)",
"theme": "seti",
"font-family": "Hack",
"font-size": "16px",
"drop-shadow": "true",
"window-controls": "true",
"width-adjustment": "true",
"padding-vertical": "48px",
"padding-horizontal": "32px",
"line-numbers": "true",
"language_mapping": {},
"trim_indent": true
"trim_indent": true,
"default": {
"paddingVertical": "48px",
"paddingHorizontal": "32px",
"backgroundImage": null,
"backgroundImageSelection": null,
"backgroundMode": "color",
"backgroundColor": "rgba(72,112,126,1)",
"dropShadow": true,
"dropShadowOffsetY": "20px",
"dropShadowBlurRadius": "68px",
"theme": "seti",
"windowTheme": "none",
"language": "",
"fontFamily": "Hack",
"fontSize": "14px",
"lineHeight": "133%",
"windowControls": true,
"widthAdjustment": true,
"lineNumbers": true,
"firstLineNumber": 1,
"exportSize": "2x",
"watermark": false,
"squaredImage": false,
"hiddenCharacters": false,
"name": "Hello",
"width": 680
}
}
```

- `language_mapping`: (`dict`) An extra setting which maps syntaxes to Carbon languages. The default (fallback) setting is written as `LANGUAGE_MAPPING` in `carbonSublime.py`.
- `trim_indent`: (`bool`) If set to true, indents are trimmed when a selection is made.

### Custom Configuration

First, head over to the [Carbon](https://carbon.now.sh) app, change the configuration, then head over to the **Misc** tab, press **Export config** and replace the file contents under the **default** node.
Binary file added assets/exportconfig.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/header.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit abb0024

Please sign in to comment.