https://github.com/gooroo/qbs-sketch
Qbs module to export Sketch documents
https://github.com/gooroo/qbs-sketch
assets build-system module pipeline qbs qbs-module sketch sketch-app sketchapp sketchtool
Last synced: 16 days ago
JSON representation
Qbs module to export Sketch documents
- Host: GitHub
- URL: https://github.com/gooroo/qbs-sketch
- Owner: GooRoo
- Created: 2022-04-28T23:24:03.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-09-14T22:42:40.000Z (over 1 year ago)
- Last Synced: 2025-03-26T03:41:46.804Z (about 1 month ago)
- Topics: assets, build-system, module, pipeline, qbs, qbs-module, sketch, sketch-app, sketchapp, sketchtool
- Language: JavaScript
- Homepage: https://gooroo.github.io/qbs-sketch/
- Size: 1.41 MB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# qbs-sketch
[](https://github.com/GooRoo/ukrainian-shields)
This [Qbs][qbs] module integrates [Sketch][sketch] into your build process allowing you to automate the pipeline of assets delivery.
Since **Sketch** is available only on Apple **macOS**, the module works only on macOS as the [host system](https://doc.qt.io/qbs/qml-qbsmodules-qbs.html#hostOS-prop) too. It requires the **Sketch** application to be installed in your system.
## Example
```qml
import qbsSketchExport {
name: 'sketch-assets'Sketch.export.mode: [
'layers',
'pages',
]Sketch.layers.outputDir: 'assets'
Sketch.layers.scales: [1, 2] // produces .png, @2x.png
Sketch.layers.formats: 'png'Sketch.pages.outputDir: 'reference'
Sketch.pages.formats: ['pdf', 'svg']
Sketch.pages.items: [
'Colors',
'Typography'
]files: '*.sketch'
}
```
This produces a folder structure similar to this (depending on the contents of your sketch-file of course, so this is just an example):
```
/
├─ assets/
│ ├─ button.png
│ ├─ [email protected]
│ ├─ input-field.png
│ ├─ [email protected]
│ └─ ...
└─ reference/
├─ Colors.pdf
├─ Colors.svg
├─ Typography.pdf
└─ Typography.svg
```
All exported files are [tagged](https://doc.qt.io/qbs/language-introduction.html#file-tags-and-taggers) as `sketch.export` and can be used in further products as input.### Fun fact
By the way, the logo for this microproject was also generated using this module. Just go to the project's root folder and type
```sh
qbs install --install-root .
```## Documentation
To check the full reference, go to the [documentation](https://gooroo.github.io/qbs-sketch/).
[qbs]: https://doc.qt.io/qbs/
[sketch]: https://www.sketch.com