Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mario-deluna/code-gifs
Generate a GIF from a code snippet
https://github.com/mario-deluna/code-gifs
Last synced: 2 months 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 (9 months ago)
- Default Branch: master
- Last Pushed: 2024-04-08T09:29:54.000Z (9 months ago)
- Last Synced: 2024-10-15T21:16:51.417Z (3 months 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/).
![output](https://github.com/mario-deluna/code-gifs/assets/956212/225809ce-d92d-4910-ac71-d9594109825f)
## Installation
Note that this requires PHP > 8.1 and the [PHP-GLFW](https://github.com/mario-deluna/php-glfw) extension.
```bash
git clone git@github.com: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.