{"id":15379924,"url":"https://github.com/marvinhagemeister/elixir-code-frame","last_synced_at":"2025-07-26T20:02:01.155Z","repository":{"id":57484359,"uuid":"111329743","full_name":"marvinhagemeister/elixir-code-frame","owner":"marvinhagemeister","description":"Make beautiful errors by showing where they are in the code","archived":false,"fork":false,"pushed_at":"2017-11-20T20:52:29.000Z","size":43,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-20T06:48:54.628Z","etag":null,"topics":["code-fragment","elixir","error","formatting"],"latest_commit_sha":null,"homepage":"","language":"Elixir","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/marvinhagemeister.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2017-11-19T20:31:56.000Z","updated_at":"2018-11-07T11:29:28.000Z","dependencies_parsed_at":"2022-08-26T14:22:36.908Z","dependency_job_id":null,"html_url":"https://github.com/marvinhagemeister/elixir-code-frame","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/marvinhagemeister/elixir-code-frame","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marvinhagemeister%2Felixir-code-frame","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marvinhagemeister%2Felixir-code-frame/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marvinhagemeister%2Felixir-code-frame/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marvinhagemeister%2Felixir-code-frame/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marvinhagemeister","download_url":"https://codeload.github.com/marvinhagemeister/elixir-code-frame/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marvinhagemeister%2Felixir-code-frame/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266303301,"owners_count":23908342,"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","status":"online","status_checked_at":"2025-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"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-fragment","elixir","error","formatting"],"created_at":"2024-10-01T14:20:24.169Z","updated_at":"2025-07-26T20:02:01.070Z","avatar_url":"https://github.com/marvinhagemeister.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CodeFrame\n\nBuild code frames that point to a specific location. Inspired by [@babel/code-frame](https://github.com/babel/babel/tree/master/packages/babel-code-frame). This is\nmainly useful for error locations (syntax errors, etc).\n\nScreenshot of colorized output:\n\n![Picture of the code frame](./screenshot.png)\n\n## Installation\n\nThe package can be installed by adding `code_frame` to your list of\n dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [{:code_frame, \"~\u003e 0.1.0\"}]\nend\n```\n\nDon't forget to run `mix deps.get` to fetch the new dependencies.\n\n## Usage\n\nBuilding a custom codeframe is pretty straightforward. Just pass the string and\nspecify the line you want to draw attention to and thats it.\n\n```elixir\ndefmodule Foo do\n  import CodeFrame\n\n  def main() do\n    my_string = \"foo\\nbar\\nbaz\"\n    \n    frame = build(my_string, 1)\n    \n    IO.puts(frame)\n  end\nend\n```\n\n`build()` has the following options:\n\n| Option | Description |\n|---|---|\n| `lines_before: integer` | Number of lines to show **before** the highlighted one. |\n| `lines_after: integer` | Number of lines to show **after** the highlighted one. |\n| `colors: boolean` | Force enabling/disabling of colorized output. |\n\n## License\n\n`MIT`, see [License file](./LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarvinhagemeister%2Felixir-code-frame","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarvinhagemeister%2Felixir-code-frame","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarvinhagemeister%2Felixir-code-frame/lists"}