2.7 KiB
2.7 KiB
Contributing to Illuscape
Thank you for helping make Inkscape more accessible to Illustrator migrants.
How to add a keyboard shortcut
- Open
config/keys/illustrator-cc.xmland/orconfig/keys/illustrator-cs6.xml - Add a
<bind>element:
Valid modifiers:<bind key="KEY" action="INKSCAPE_ACTION" modifiers="Primary,Shift" />Primary(Ctrl/Cmd),Shift,Alt. Omitmodifiers=""for bare keys. - Find Inkscape action names via
inkscape --action-liston your system - Update the shortcut table in
README.md - Update the shortcut comparison table in the spec if the shortcut differs between CC and CS6
How to add a color palette
- Create
config/palettes/YourPalette.gplfollowing GPL format:GIMP Palette Name: Your Palette Name Columns: 8 # 255 0 0 Red ... - Add the filename to
uninstall.sh'sremove_files()function so it gets cleaned up - The palette will be installed automatically by
install.sh(it copies all*.gplfiles)
How to add a document template
- Create an SVG at
config/templates/YourTemplate.svg - Include a
sodipodi:namedviewelement with appropriate canvas settings - Add the filename to
uninstall.sh'sremove_files()function - The template will be installed automatically by
install.sh(copies all*.svgfiles)
How to add a preference
Preferences live in config/preferences-patch.xml. The XML merge algorithm (in
scripts/merge_prefs.py) does an upsert: it walks the patch tree, matches nodes
by their id attribute, and sets only the attributes present in the patch. It
never deletes nodes or attributes.
To add a new preference:
- Find the relevant node in Inkscape's
preferences.xmlon a running install - Add the node/attribute to
config/preferences-patch.xmlwith the correctidvalues - Write a test in
tests/test_merge_prefs.pythat verifies the attribute is set - Run
conda run -n cf python3 -m pytest tests/test_merge_prefs.py -vto verify
Running tests
# Python unit tests (merge algorithm)
conda run -n cf python3 -m pytest tests/test_merge_prefs.py -v
# Integration tests (requires bats-core)
bats tests/test_install.bats
# Validate all config files
conda run -n cf python3 -c "
from xml.etree import ElementTree as ET
from pathlib import Path
for f in [*Path('config/keys').glob('*.xml'), *Path('config/templates').glob('*.svg'),
*Path('config/symbols').glob('*.svg'), Path('config/preferences-patch.xml')]:
ET.parse(f)
print(f'OK {f}')
"
Commit format
feat: add <shortcut/palette/template>
fix: correct <behavior>
test: add test for <scenario>
docs: update <section>
License
By contributing, you agree that your contributions are released under the MIT license.