https://github.com/mario-deluna/code-gifs
Generate a GIF from a code snippet
https://github.com/mario-deluna/code-gifs
Last synced: about 1 month ago
JSON representation
Generate a GIF from a code snippet
- Host: GitHub
- URL: https://github.com/mario-deluna/code-gifs
- Owner: mario-deluna
- Created: 2024-04-07T23:28:37.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-04-08T09:29:54.000Z (about 1 year ago)
- Last Synced: 2025-03-19T19:50:00.770Z (about 1 month ago)
- Language: PHP
- Homepage:
- Size: 14.6 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Code Gifs
Generate a GIF from a code snippet using [Tempest Highlight](https://github.com/tempestphp/highlight) & [PHP-GLFW](https://github.com/mario-deluna/php-glfw).
This is the source code for the following [blog post](https://station.clancats.com/creating-animated-code-snippets-with-tempest-highlighting-and-php-glfw/).

## Installation
Note that this requires PHP > 8.1 and the [PHP-GLFW](https://github.com/mario-deluna/php-glfw) extension.
```bash
git clone [email protected]:mario-deluna/code-gifs.git
cd code-gifs
composer install
```## Usage
There is a file in the project root called `input.txt` that contains the code snippet to be rendered. Modify this to your needs, and then run the following to preview the animation:
```bash
php bin/start.php
```And run the following to produce an `mp4` and `gif` file:
```bash
php bin/render.php
```Note, rendering to an `mp4` and/or `gif` requires `ffmpeg` to be installed.