{"id":40487724,"url":"https://github.com/torchlight-api/torchlight-jigsaw","last_synced_at":"2026-01-20T18:48:48.849Z","repository":{"id":43934768,"uuid":"369929480","full_name":"torchlight-api/torchlight-jigsaw","owner":"torchlight-api","description":"A Jigsaw client for Torchlight - the syntax highlighting API.","archived":false,"fork":false,"pushed_at":"2022-07-21T17:27:31.000Z","size":50,"stargazers_count":15,"open_issues_count":2,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-26T16:51:02.426Z","etag":null,"topics":["code-highlighter","jigsaw","laravel","markdown","static-site-generator","syntax-highlighter","syntax-highlighting"],"latest_commit_sha":null,"homepage":"https://torchlight.dev","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/torchlight-api.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-23T00:13:51.000Z","updated_at":"2024-06-07T14:50:52.000Z","dependencies_parsed_at":"2022-08-12T10:52:02.497Z","dependency_job_id":null,"html_url":"https://github.com/torchlight-api/torchlight-jigsaw","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/torchlight-api/torchlight-jigsaw","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/torchlight-api%2Ftorchlight-jigsaw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/torchlight-api%2Ftorchlight-jigsaw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/torchlight-api%2Ftorchlight-jigsaw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/torchlight-api%2Ftorchlight-jigsaw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/torchlight-api","download_url":"https://codeload.github.com/torchlight-api/torchlight-jigsaw/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/torchlight-api%2Ftorchlight-jigsaw/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28609208,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T16:10:39.856Z","status":"ssl_error","status_checked_at":"2026-01-20T16:10:39.493Z","response_time":117,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-highlighter","jigsaw","laravel","markdown","static-site-generator","syntax-highlighter","syntax-highlighting"],"created_at":"2026-01-20T18:48:48.756Z","updated_at":"2026-01-20T18:48:48.840Z","avatar_url":"https://github.com/torchlight-api.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Torchlight Client for Jigsaw\n\n[![Tests](https://github.com/torchlight-api/torchlight-jigsaw/actions/workflows/tests.yml/badge.svg)](https://github.com/torchlight-api/torchlight-jigsaw/actions/workflows/tests.yml) [![Latest Stable Version](https://poser.pugx.org/torchlight/torchlight-jigsaw/v)](//packagist.org/packages/torchlight/torchlight-jigsaw) [![Total Downloads](https://poser.pugx.org/torchlight/torchlight-jigsaw/downloads)](//packagist.org/packages/torchlight/torchlight-jigsaw)  [![License](https://poser.pugx.org/torchlight/torchlight-jigsaw/license)](//packagist.org/packages/torchlight/torchlight-jigsaw)\n\nA [Torchlight](https://torchlight.dev) syntax highlighting extension for the static site builder [Jigsaw](https://jigsaw.tighten.co/).\n\nTorchlight is a VS Code-compatible syntax highlighter that requires no JavaScript, supports every language, every VS Code theme, line highlighting, git diffing, and more.\n\n\u003e 📚 The full docs can be found at [torchlight.dev/docs/clients/jigsaw](https://torchlight.dev/docs/clients/jigsaw).\n\n## Installation\n\nTo install, require the package from composer:\n\n```\ncomposer require torchlight/torchlight-jigsaw\n```\n\nAfter the package is downloaded, add the following line to your `bootstrap.php`\n\n```php\nTorchlight\\Jigsaw\\TorchlightExtension::make($container, $events)-\u003eboot();\n```\n\nThis will boot the extension so that it can register its bindings, events, and commands.\n\nNow your `bootstrap.php` might look something like this:\n\n```php\n\u003c?php\n\nuse App\\Listeners\\GenerateSitemap;\nuse TightenCo\\Jigsaw\\Jigsaw;\n\n/** @var $container \\Illuminate\\Container\\Container */\n/** @var $events \\TightenCo\\Jigsaw\\Events\\EventBus */\n\n/**\n * You can run custom code at different stages of the build process by\n * listening to the 'beforeBuild', 'afterCollections', and 'afterBuild' events.\n *\n * For example:\n *\n * $events-\u003ebeforeBuild(function (Jigsaw $jigsaw) {\n *     // Your code here\n * });\n */\n\n$events-\u003eafterBuild(GenerateSitemap::class);\n\nTorchlight\\Jigsaw\\TorchlightExtension::make($container, $events)-\u003eboot();\n```\n\n## Configuration\n\nTo configure your Torchlight integration, you can start by publishing the configuration file:\n\n```\n./vendor/bin/jigsaw torchlight:install\n```\n\nOnce run, you should see a new file `torchlight.php` in the root of your project, with contents that look like this:\n\n```php\nreturn [\n    // Which theme you want to use. You can find all of the themes at\n    // https://torchlight.dev/themes, or you can provide your own.\n    'theme' =\u003e 'material-theme-palenight',\n\n    // Your API token from torchlight.dev.\n    'token' =\u003e '',\n\n    // If you want to register the blade directives, set this to true.\n    'blade_components' =\u003e true,\n\n    // The Host of the API.\n    'host' =\u003e 'https://api.torchlight.dev',\n\n    // If you want to specify the cache path, you can do so here. Note\n    // that you should *not* use the same path that Jigsaw uses,\n    // which is `cache` at the root level of your app.\n    'cache_path' =\u003e 'torchlight_cache',\n];\n```\n\n### Theme\n\nYou can change the theme of all your code blocks by adjusting the `theme` key in your configuration.\n\n### Token\n\nThis is your API token from [torchlight.dev](https://torchlight.dev). (Torchlight is completely free for personal and open source projects.)\n\n### Blade Components\n\nBy default Torchlight works with both Markdown files as well as Blade files, using a [custom Laravel component](https://laravel.com/docs/master/blade#components). If you'd like to disable the registration of the component for whatever reason, you can turn this to false.\n\n### Host\n\nYou can change the host where your API requests are sent. Not sure why you'd ever want to do that, but you can!\n\n### Cache\n\nTorchlight requires a separate cache path, distinct from the Jigsaw cache. Jigsaw cleans out its cache from time to time, whereas Torchlight depends on individual TTLs, courtesy of the Laravel cache driver.\n\n\u003e You may want to add your configured cache path (`/torchlight_cache/`) to your `.gitignore` file so the cache files aren't persisted to your git history.\n\n\n## Usage\n\n### Markdown\nTo use Torchlight in your Jigsaw markdown files, you don't need to do anything else beside using fenced code blocks like you have been.\n\n~~~markdown\nThis is my great markdown file! I'm going to show some code now:\n\n```php\necho \"here is my code\"\n```\n\nWasn't that good code?\n~~~\n\nTorchlight will handle highlighting that block of code. \n\nIf you want to add additional classes or an ID, you can use the syntax that is supported by Jigsaw's [underlying markdown parser](https://github.com/michelf/php-markdown).\n\n~~~markdown\nThis is my great markdown file! I'm going to show some code now:\n\n```php {#some-html-id.mt-4.mb-8}\necho \"here is my code\"\n```\n\nWasn't that good code?\n~~~\n\nThe resulting `code` element will have an id of `some-html-id` and classes of `mt-4 mb-8`, along with any classes that Torchlight applies.\n\n### Blade\n\nIf you want to use Torchlight in your `.blade.php` files, you can use the custom blade component `x-torchlight-code`.\n\n```blade\n\u003cpre\u003e\u003cx-torchlight-code language='php'\u003e\n    echo \"hello world\";\n\u003c/x-torchlight-code\u003e\u003c/pre\u003e\n```\n\nYou can add any classes or other attributes, and they will be preserved:\n\n```blade\n\u003cpre\u003e\u003cx-torchlight-code id='hello-world' class='mt-4 mb-8' language='php'\u003e\n    echo \"hello world\";\n\u003c/x-torchlight-code\u003e\u003c/pre\u003e\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftorchlight-api%2Ftorchlight-jigsaw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftorchlight-api%2Ftorchlight-jigsaw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftorchlight-api%2Ftorchlight-jigsaw/lists"}