{"id":17866511,"url":"https://github.com/LightQuantumArchive/template-eyre","last_synced_at":"2025-03-21T07:31:47.532Z","repository":{"id":36963915,"uuid":"446205129","full_name":"LightQuantumArchive/template-eyre","owner":"LightQuantumArchive","description":"An error reporter for panics and `eyre::Report` with handlebars template support.","archived":false,"fork":false,"pushed_at":"2025-03-17T07:51:58.000Z","size":644,"stargazers_count":0,"open_issues_count":4,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-17T19:22:02.809Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/LightQuantumArchive.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2022-01-09T21:18:58.000Z","updated_at":"2025-01-13T23:00:29.000Z","dependencies_parsed_at":"2024-01-01T08:45:57.489Z","dependency_job_id":"ca6d63ca-aa4e-4ace-a42d-85b84f9222ed","html_url":"https://github.com/LightQuantumArchive/template-eyre","commit_stats":{"total_commits":87,"total_committers":2,"mean_commits":43.5,"dds":"0.22988505747126442","last_synced_commit":"c60a82d00aa2839e3c12d1a598502862d09faa28"},"previous_names":["lightquantumarchive/template-eyre"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LightQuantumArchive%2Ftemplate-eyre","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LightQuantumArchive%2Ftemplate-eyre/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LightQuantumArchive%2Ftemplate-eyre/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LightQuantumArchive%2Ftemplate-eyre/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LightQuantumArchive","download_url":"https://codeload.github.com/LightQuantumArchive/template-eyre/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244758066,"owners_count":20505573,"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":"2024-10-28T09:37:20.836Z","updated_at":"2025-03-21T07:31:47.244Z","avatar_url":"https://github.com/LightQuantumArchive.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# template-eyre\n\nAn error reporter for panics and `eyre::Report` with handlebars template support.\n\nEver used [eyre](https://github.com/yaahc/eyre) and finding existing handlers too boring or complex?\nThis crate enables you to customize your error report and add custom fields\nin seconds.\n\n## Features\n- [x] Handlebars powered error reports\n- [x] Color support\n- [x] Custom indent support\n- [x] Sensible bundled handlers\n- [ ] Backtrace support\n- [ ] Panic handler\n- [x] Custom fields support\n\n## Write your own template\n\nThis crate includes two templates `Hook::simple` and `Hook::colored_simple`,\nbut you can always create your own templates easily!\n\nFirst, get started by reading the [handlebars guide](https://handlebarsjs.com/guide/).\nHandlebars is a simple template language, so this won't be hard.\n\nNext, start writing your own template! You may gain some idea from [builtin templates](src/templates/).\n\nNotice that this crate provides you with [some handy helpers](#additional-helpers).\nAlso, the `handlebars` crate this crate depends on also has some [custom helpers](https://docs.rs/handlebars/latest/handlebars/#built-in-helpers).\n\n## Example\n\nA minimal handler can be built with a template like this:\n\n```handlebars\nOh no, this program crashed!\n\n{{style \"red\" error}}\n{{*set multi=(gt (len sources) 1)}}\n{{#each sources}}\n    {{#if @first}}\n        {{~style \"dim\" \"Caused by:\"}}\n    {{/if}}\n    {{~indent (_if @root.multi @index null) (style \"yellow\" this)}}\n{{/each}}\n\n{{style \"cyan\" \"Please report this issue to ...\"}}\n```\n\nand you get a flavored error report:\n\n![snapshot](https://raw.githubusercontent.com/PhotonQuantum/template-eyre/master/snapshot.png)\n\n## Additional helpers\n\n### `style` helper\n\nColor the output. Styles should be written at its \"dotted\" form.\n \nSee [console's document](https://docs.rs/console/latest/console/struct.Style.html#implementations) for details.\n\nE.g., `{{style \"black.bold.on_red\" error}}`\n\n### `indent` helper\n\nIndent a block.\n\nThis helper has three forms:\n\n- `indent content` - Indent the content by four spaces.\n- `indent \u003cnumber\u003e content` - Insert a number before the first line with the same indentation level as backtraces.\n- `indent \u003cstring\u003e content` - Insert given string before every line.\n\nE.g., `{{indent @index this}}`\n\n### inline `_if` helper\n\nInline version of `if` helper.\n\nE.g., `{{_if success \"Yay!\" \"Oops!\"}}`\n\n### `set` decorator\n\nSet local variables.\n\nE.g., `{{*set flag=true}}`\n\n### `concat` helper\n\nConcatenate strings.\n\nE.g., `{{concat \"a\" \"b\"}}`\n\n## License\nThis project is licensed under [MIT License](LICENSE.txt).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLightQuantumArchive%2Ftemplate-eyre","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLightQuantumArchive%2Ftemplate-eyre","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLightQuantumArchive%2Ftemplate-eyre/lists"}