Skip to content

Commit

Permalink
lint; split PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
patricksurry committed Dec 8, 2023
1 parent 94f0094 commit 67292d3
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion KEYMAP_SPEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ A `LayoutKey` can be defined with either a string value or with a mapping with t
| `tap (t)` | `str` | `""` | the tap action of a key, drawn on the center of the key; spaces will be converted to line breaks[^2] |
| `hold (h)` | `str` | `""` | the hold action of a key, drawn on the bottom of the key |
| `shifted (s)` | `str` | `""` | the "shifted" action of a key, drawn on the top of the key |
| `type` | `str` | `""` | the styling of the key that corresponds to the [SVG class](CONFIGURATION.md#svg_style)[^3]. predefined types are `held` (a red shading to denote held down keys), `ghost` (dashed outline to denote optional keys in a layout), `trans` (lighter text for transparent keys), and `encoder` (circled outline) |
| `type` | `str` | `""` | the styling of the key that corresponds to the [SVG class](CONFIGURATION.md#svg_style)[^3]. predefined types are `held` (a red shading to denote held down keys), `ghost` (dashed outline to denote optional keys in a layout), `trans` (lighter text for transparent keys) |

[^2]: You can prevent line breaks by using double spaces `" "` to denote a single non-breaking space.
[^3]: Text styling can be overridden in the SVG config using the `"tap"`, `"hold"` and `"shifted"` classes if desired.
Expand Down
2 changes: 1 addition & 1 deletion examples/tidbit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ layout:

layers:
default:
- [ {tap: Esc, type: encoder}, '*', '-']
- [ Esc, '*', '-']
- ['7', '8', '9', '+']
- ['4', '5', '6']
- ['1', '2', '3', Enter]
Expand Down
7 changes: 1 addition & 6 deletions keymap_drawer/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,6 @@ class KeySidePars(BaseModel):
stroke-width: 2;
}
rect.encoder {
rx: 50%;
ry: 50%;
}
text {
text-anchor: middle;
dominant-baseline: middle;
Expand Down Expand Up @@ -210,7 +205,7 @@ class KeySidePars(BaseModel):
# mapping of sources to (possibly templated) URLs for fetching SVG glyphs
# e.g. `$$material:settings$$` will use the value for `material` and replace `{}` with `settings`
glyph_urls: dict[str, str] = {
"tabler": "https://tabler-icons.io/static/tabler-icons/icons/{}.svg",
"tabler": "https://unpkg.com/@tabler/icons/icons/{}.svg",
"mdi": "https://raw.githubusercontent.com/Templarian/MaterialDesign-SVG/master/svg/{}.svg",
"mdil": "https://raw.githubusercontent.com/Pictogrammers/MaterialDesignLight/master/svg/{}.svg",
"material": "https://fonts.gstatic.com/s/i/short-term/release/materialsymbolsoutlined/{}/default/48px.svg",
Expand Down
5 changes: 2 additions & 3 deletions keymap_drawer/physical_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def __rmul__(self, other: int | float) -> "PhysicalLayout":
return PhysicalLayout(keys=[other * k for k in self.keys])


def layout_factory(
def layout_factory( # pylint: disable=too-many-arguments
config: DrawConfig,
qmk_keyboard: str | None = None,
qmk_info_json: Path | None = None,
Expand All @@ -182,8 +182,7 @@ def layout_factory(
elif qmk_info_json:
with open(qmk_info_json, "rb") as f:
qmk_info = json.load(f)
else:
assert qmk_info is not None
assert qmk_info is not None

if isinstance(qmk_info, list):
assert qmk_layout is None, "Cannot use qmk_layout with a list-format QMK spec"
Expand Down

0 comments on commit 67292d3

Please sign in to comment.