https://github.com/matthijskamstra/gen-scribus
POC generating a scribus file, adding content, etc
https://github.com/matthijskamstra/gen-scribus
haxe scribus
Last synced: about 1 month ago
JSON representation
POC generating a scribus file, adding content, etc
- Host: GitHub
- URL: https://github.com/matthijskamstra/gen-scribus
- Owner: MatthijsKamstra
- License: mit
- Created: 2023-09-07T07:34:24.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-05T08:08:21.000Z (8 months ago)
- Last Synced: 2025-01-22T02:48:53.692Z (3 months ago)
- Topics: haxe, scribus
- Language: Rich Text Format
- Homepage:
- Size: 1.29 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gen-scribus
POC: generating a [Scribus](https://www.scribus.net/) file via [Haxe](https://haxe.org/)

## Reason
- Not possible to link (and update) to external text file (markdown)
- Generate a quick and dirty document with text and image on a spread
- Automate some of the scribus features via settings
- Not possible to use commandline to generate file
- Not possible to update document (with external file and/or input)
- Better import markdown (Scribus default markdown import will break when using `
## json structure
basic structure
```json
{
"document": {}, // used for the settings of the document
"pages": [] // pages (left right)
}
```
About document
```json
{
"document": {
"author": "Matthijs Kamstra",
"title": "test images with gen-scribus",
"description": "blah blah, Haxe Scribus Gen doc",
"language": "nl",
"pageName": "a4",
"width": { "unit": "mm", "value": 210 },
"height": { "unit": "mm", "value": 210 },
"margins": [
{ "dir": "left", "unit": "mm", "value": 10 },
{ "dir": "right", "unit": "mm", "value": 10 },
{ "dir": "top", "unit": "mm", "value": 10 },
{ "dir": "bottom", "unit": "mm", "value": 10 }
],
"guides": [
{ "dir": "left", "unit": "mm", "value": 10 },
{ "dir": "right", "unit": "mm", "value": 10 },
{ "dir": "top", "unit": "mm", "value": 10 },
{ "dir": "bottom", "unit": "mm", "value": 10 }
],
"bleeds": [
{ "dir": "left", "unit": "mm", "value": 3 },
{ "dir": "right", "unit": "mm", "value": 3 },
{ "dir": "top", "unit": "mm", "value": 3 },
{ "dir": "bottom", "unit": "mm", "value": 3 }
],
"guideSnap": true,
"guideLocked": true
}
// ...
}
```
pages
```json
"pages": [
{
"left": {},
"right": {
"_alias": "Cover (right) Green",
"images": [
{
"path": "assets/png/a4_green.png",
"width": { "unit": "mm", "value": 100 },
"height": { "unit": "mm", "value": 100 }
},
{
"path": "assets/png/a4_gray.png",
"x": { "unit": "mm", "value": 0 },
"y": { "unit": "mm", "value": 0 },
"width": { "unit": "mm", "value": 210 },
"height": { "unit": "mm", "value": 297 }
},
{
"path": "assets/png/a4_blue.png",
"x": { "unit": "mm", "value": -3 },
"y": { "unit": "mm", "value": -3 },
"width": { "unit": "mm", "value": 216 },
"height": { "unit": "mm", "value": 303 }
}
]
}
},
{
"left": {},
"right": {}
}
]
```
use typed json:
```haxe
var _HxSettingsObj:HxSettingsObj = {
// ....
}
```
## TODO
check [TODO](TODO.md)
## Pandoc
Use pandoc, to convert markdown to a file that works for scribus
see: [pandoc.sh](pandoc.sh)
```bash
# open terminal to the root of this repo
sh pandoc.sh
```