Skip to content

1. File Format

Felipe Escoto edited this page Feb 11, 2019 · 4 revisions

File Structure

Spice-Up mostly uses a JSON as the file format. This allows basically any app (even a web browser) to be able to read the contents of the file without much hassle.

Starting on version 2.0.0, the proposed file format saves your presentation in a Zip compressed file with the .spice extension. This file will contain all the necessary components of your presentation such as images and styles, as well as an html file to allow you to render your presentation without the need of Spice-Up.

presentation.spice
│   content.json
│   styles.json (Not yet implemented)
|   version (Not yet implemented)
|   thumbnail (Not yet implemented)
│   index.html (Not yet implemented)
|
└───Pictures
│   │   B747EdFF-0ac1-bf.png
│   │   a7afD1fb-AE8E-2B.jpg
│   │   7EdB11CC-DBec-d3.bmp
│   │   ...
│   
└───Thumbnails
|   │   D4BfB3e4-bAdd-a5.png
|   │   457EE6ed-DdD0-f4.png
|   |   ...
|
└───Videos (Not yet implemented)
|   │   D4BfB3e4-bAdd-a5.png
|   │   457EE6ed-DdD0-f4.png
|   |   ...
|
└───Shapes (Not yet implemented)
|   │   D4BfB3e4-bAdd-a5.svg
|   │   457EE6ed-DdD0-f4.svg
|   |   ...
|
└───.git (Not yet implemented)
    │   // git repo files


Pictures, Thumbnails and others are stored with randomized file names 
to prevent collisions. Said files can be re-used in multiple places 
while only storing one file to keep file size low

The structure of content.json

This file, content.json, contains all the text-based data of the presentation. The current file format goes like so:

{
    "current-slide": 5,
    "preview-slide": 1,
    "aspect-ratio": 2,
    "slides": []
}

SlideObjects
{
    "background-color": "css-color/gradient"
    "background-pattern": "gresource-link"
    "transition": 0  // GtkStackTransition emnum code
    "notes": "StringBase64"
    "items": []
    "thumbnail": "D4BfB3e4-bAdd-a5.png" // Basename of file at Thumbnails
    // "preview": "StringBase64" - Deprecated. May contain thumbnail image
}

CanvasItem Common

{
    "x": -686
    "y": 906
    "w": 1893
    "h": 545
    "type": "TYPEString"
}

// Other CanvasItem-types inherit the common data, and add the following

TextItem
{
    "type": "text"
    "text": "" // Deprecated, should be empty. Used to store the text as plain-text
    "text-data": "StringBase64" // The text in base64
    "font": "font-name" // Name of the font
    "color": "css-color"
    "font-size": 50
    "font-style": "medium"
    "justification": 0
}

ColorItem
{
    "type": "color"
    "border-radius": 20 // The border radius, as a percentage
    "background_color": "css-color/gradient"
}

ImageItem
{
   "type": "image"
   "archived-image": "D4BfB3e4-bAdd-a5.png" // Basename of file at Pictures
   // Deprecated items. Should be converted to "archive-image"
   "image-data": "Stringbase64" // Image in base64. Should convert and save to /Picture
   "image": "FilePath" // String with path to file. Should import a copy to /Pictures
}
Clone this wiki locally