{"id":26907122,"url":"https://github.com/usetrmnl/trmnlp","last_synced_at":"2025-04-01T11:37:46.585Z","repository":{"id":271150591,"uuid":"912549253","full_name":"usetrmnl/trmnlp","owner":"usetrmnl","description":"a local dev server for building TRMNL plugins","archived":false,"fork":false,"pushed_at":"2025-03-25T18:38:32.000Z","size":1999,"stargazers_count":41,"open_issues_count":3,"forks_count":2,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-03-25T18:40:50.030Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/usetrmnl.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-05T21:57:24.000Z","updated_at":"2025-03-25T18:38:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"395b9926-1b09-4a2e-a922-d5b6ada1a32f","html_url":"https://github.com/usetrmnl/trmnlp","commit_stats":null,"previous_names":["schrockwell/trmnl_preview","usetrmnl/trmnlp"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usetrmnl%2Ftrmnlp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usetrmnl%2Ftrmnlp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usetrmnl%2Ftrmnlp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usetrmnl%2Ftrmnlp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/usetrmnl","download_url":"https://codeload.github.com/usetrmnl/trmnlp/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246634958,"owners_count":20809324,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2025-04-01T11:37:45.828Z","updated_at":"2025-04-01T11:37:46.560Z","avatar_url":"https://github.com/usetrmnl.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"# trmnlp\n\nA basic self-hosted web server to ease the development and sharing of [TRMNL](https://usetrmnl.com/) plugins.\n\n[Liquid](https://shopify.github.io/liquid/) templates are rendered leveraging the [TRMNL Design System](https://usetrmnl.com/framework). They may be generated as HTML (faster, and a good approximation of the final result) or as BMP images (slower, but more accurate).\n\nThe server watches the filesystem for changes to the Liquid templates, seamlessly updating the preview without the need to refresh.\n\n![Screenshot](docs/preview.png)\n\n## Creating a Plugin\n\nThis is the structure of a plugin repository.\n\n```\nviews/\n    full.liquid\n    half_horizontal.liquid\n    half_vertical.liquid\n    quadrant.liquid\nconfig.toml\nstatic.json # optional; for static strategy\n```\n\nThe [trmnl-hello](https://github.com/schrockwell/trmnl-hello) repository is provided as a jumping-off point for creating new plugins. Simply fork the repo, clone it, and start hacking.\n\n## Running the Server (Docker)\n\n```sh\ndocker run \\\n    -p 4567:4567 \\\n    -v /path/to/plugin/on/host:/plugin \\\n    schrockwell/trmnlp\n```\n\n## Running the Server (Local Ruby)\n\nPrerequisites:\n\n- Ruby 3.x\n- For BMP rendering (optional):\n  - Firefox\n  - ImageMagick\n\nIn the plugin repository:\n\n```sh\ngem install trmnl_preview\ntrmnlp serve                # Starts the server\n```\n\n## Usage Notes\n\nWhen the strategy is \"polling\", the specified URL will be fetched once, when the server starts.\n\nWhen the strategy is \"webhook\", payloads can be POSTed to the `/webhook` endpoint. They are saved to `tmp/data.json` for future renders.\n\nWhen the strategy is \"static\", the data is read from `static.json`.\n\n## `config.toml` Reference\n\n```toml\n# \"polling\" =\u003e fetches remote data from polling_urls\n# \"webhook\" =\u003e listens for POST data at /webhook\n# \"static\"  =\u003e reads from static.json\nstrategy = \"polling\"\n\n# (polling strategy) URLs to poll\npolling_urls = [\"https://example.com/data.json\"]\n\n# (polling strategy) HTTP verb to poll the URL (default: \"GET\")\npolling_verb = \"GET\"\n\n# (polling strategy) body payload, useful for GraphQL (default: \"\")\npolling_body = \"{ stats { mean median mode } }\"\n\n# enable dark mode (string value \"yes\" or \"no\", default: \"no\")\ndark_mode = \"no\"\n\n# remove padding (string values \"yes\" or \"no\", default: \"no\")\nno_screen_padding = \"no\"\n\n# (static strategy) The local file to read (default: \"static.json\")\nstatic_path = \"static.json\"\n\n# automatically re-render the view when Liquid templates change (default: true)\nlive_render = true\n\n# additional file globs to watch for changes (default: [])\nwatch_paths = [\"src/**/*\"]\n\n# (polling strategy) HTTP headers\n[polling_headers]\nAuthorization = \"bearer 123\"\nContent-Type = \"application/json\"\nAccept = \"applcation/json\"\n\n# values for any custom fields - can be interpolated into polling_{urls,body,headers}\n[custom_fields]\nunits = \"metric\"\napi_key=\"{{ env.API_KEY }}\" # interpolated from local environment variable\n\n# override default values in the {{ trmnl }} namespace\n[trmnl.user]\nname = \"Peter Quill\"\n\n[trmnl.plugin_settings]\ninstance_name = \"Kevin Bacon Facts\"\n```\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/schrockwell/trmnl_preview.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fusetrmnl%2Ftrmnlp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fusetrmnl%2Ftrmnlp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fusetrmnl%2Ftrmnlp/lists"}