Update keymap drawer

This commit is contained in:
2025-02-09 17:26:17 +01:00
parent a621b24a63
commit 2a46456964
3 changed files with 93 additions and 39 deletions

View File

@@ -1,42 +1,47 @@
{
lib,
buildPythonApplication,
fetchPypi,
callPackage,
fetchFromGitHub,
poetry-core,
pydantic,
pcpp,
pyparsing,
pyyaml,
platformdirs,
pydantic-settings,
}:
buildPythonApplication rec {
pname = "keymap-drawer";
version = "0.18.1";
pyproject = true;
tree-sitter,
}: let
tree-sitter-devicetree = callPackage ./tree-sitter-devicetree.nix {};
in
buildPythonApplication rec {
pname = "keymap-drawer";
version = "0.20.0";
pyproject = true;
src = fetchPypi {
pname = "keymap_drawer";
inherit version;
hash = "sha256-MHjxsopXoYWZFuXUbeaI7BCSx3HkRaeVidY+mc8lj+s=";
};
src = fetchFromGitHub {
owner = "caksoylar";
repo = pname;
rev = "ea00f44ac5a2ebe97b8b31f9166791bedf9136e5";
hash = "sha256-F9lDUuqHKl2FOUsUszJrRK7/a/a1UJLw+RUg9Bv2zN0=";
};
build-system = [poetry-core];
build-system = [poetry-core];
propagatedBuildInputs = [
pydantic
pcpp
pyparsing
pyyaml
platformdirs
pydantic-settings
];
propagatedBuildInputs = [
pydantic
pcpp
pyyaml
platformdirs
pydantic-settings
tree-sitter
tree-sitter-devicetree
];
doCheck = false;
doCheck = false;
meta = {
homepage = "https://github.com/caksoylar/keymap-drawer";
description = "Parse QMK & ZMK keymaps and draw them as vector graphics";
license = lib.licenses.mit;
};
}
meta = {
homepage = "https://github.com/caksoylar/keymap-drawer";
description = "Parse QMK & ZMK keymaps and draw them as vector graphics";
license = lib.licenses.mit;
};
}

View File

@@ -67,8 +67,8 @@ text.footer {
paint-order: stroke;
}
/* styling for combo tap, and key hold/shifted label text */
text.combo, text.hold, text.shifted {
/* styling for combo tap, and key non-tap label text */
text.combo, text.hold, text.shifted, text.left, text.right {
font-size: 11px;
}
@@ -82,12 +82,20 @@ text.shifted {
dominant-baseline: hanging;
}
text.left {
text-anchor: start;
}
text.right {
text-anchor: end;
}
text.layer-activator {
text-decoration: underline;
}
/* styling for hold/shifted label text in combo box */
text.combo.hold, text.combo.shifted {
text.combo.hold, text.combo.shifted, text.combo.left, text.combo.right {
font-size: 8px;
}
@@ -233,7 +241,7 @@ path.combo {
</g>
<g transform="translate(180, 196)" class="key keypos-26">
<rect rx="6" ry="6" x="-28" y="-26" width="56" height="52" class="key"/>
<text x="0" y="0" class="key tap"><tspan style="font-size: 70%">&amp;caps_word</tspan></text>
<text x="0" y="0" class="key tap">TAB</text>
<text x="0" y="-24" class="key shifted">LEFT</text>
</g>
<g transform="translate(240, 196)" class="key keypos-27">
@@ -245,16 +253,18 @@ path.combo {
</g>
<g transform="translate(300, 196)" class="key keypos-28">
<rect rx="6" ry="6" x="-28" y="-26" width="56" height="52" class="key"/>
<text x="0" y="0" class="key tap">TAB</text>
<a href="#others">
<text x="0" y="24" class="key hold layer-activator">others</text>
</a></g>
<g transform="translate(390, 196)" class="key keypos-29">
<rect rx="6" ry="6" x="-28" y="-26" width="56" height="52" class="key"/>
<text x="0" y="0" class="key tap">LSHIFT</text>
<a href="#others">
<text x="0" y="24" class="key hold layer-activator">others</text>
</a></g>
</a><text x="0" y="-24" class="key shifted"><tspan style="font-size: 70%">&amp;caps_word</tspan></text>
</g>
<g transform="translate(390, 196)" class="key keypos-29">
<rect rx="6" ry="6" x="-28" y="-26" width="56" height="52" class="key"/>
<text x="0" y="0" class="key tap">RSHIFT</text>
<a href="#others">
<text x="0" y="24" class="key hold layer-activator">others</text>
</a><text x="0" y="-24" class="key shifted"><tspan style="font-size: 70%">&amp;caps_word</tspan></text>
</g>
<g transform="translate(450, 196)" class="key keypos-30">
<rect rx="6" ry="6" x="-28" y="-26" width="56" height="52" class="key"/>
<text x="0" y="0" class="key tap">BSPC</text>

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 41 KiB

View File

@@ -0,0 +1,39 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
tree-sitter,
}:
buildPythonPackage {
pname = "tree-sitter-devicetree";
version = "0.12.1";
pyproject = true;
src = fetchFromGitHub {
owner = "joelspadin";
repo = "tree-sitter-devicetree";
rev = "16c9cb959675bc9bc4f4e5bebe473d511a12a06d";
hash = "sha256-UVxLF4IKRXexz+PbSlypS/1QsWXkS/iYVbgmFCgjvZM=";
};
build-system = [
setuptools
];
optional-dependencies = {
core = [
tree-sitter
];
};
# There are no tests
doCheck = false;
pythonImportsCheck = ["tree_sitter_devicetree"];
meta = {
description = "Devicetree grammar for tree-sitter";
homepage = "https://github.com/joelspadin/tree-sitter-devicetree";
license = lib.licenses.mit;
};
}