Project for Formal Languages and Compiler Course @ UniBz
This project will allow you to generate an HTML snippet out of an exported Figma JSON file.
Create a template on Figma and exploit the API to export the data formatted in JSON with the following command:
curl -sH 'Authorization: Bearer <TOKEN>'
'https://api.figma.com/v1/files/...'
| python -m json.tool
Find more information on the Figma API doc
Suggestion: keep all your exported files in the files/ folder.
To generate a HTML code snippet, run a statement like this:
make all JSON="files/example"
You can now use the snippet in the body of a full structured HTML file.
This attribute specifies the filename of the json you want to generate HTML from.
The generated file will have the same same name. The extension will be .html
Note: do not specify extension of the file in the attribute value, i.e. .json
Get a copy of the repository:
git clone git@github.com:GiadaPa/Formal-Languages-and-Compilers.gitor alternatively:
git clone https://github.com/GiadaPa/Formal-Languages-and-Compilers.gitChange directory:
cd Formal-Languages-and-Compilers/src/The JSON object specifications, exported by the Figma API, have been changed, since the beginning of the project. For time reasons, the compiler was not updated accordingly.
You can find an example export .json file in the files/ folder.