{"id":28487273,"url":"https://github.com/beam-community/brady","last_synced_at":"2025-12-11T23:51:29.394Z","repository":{"id":55332265,"uuid":"54055014","full_name":"beam-community/brady","owner":"beam-community","description":"Template Helpers for phoenix applications","archived":false,"fork":false,"pushed_at":"2021-09-24T16:04:42.000Z","size":538,"stargazers_count":35,"open_issues_count":1,"forks_count":7,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-07-01T07:50:16.146Z","etag":null,"topics":["elixir","elixir-phoenix","html"],"latest_commit_sha":null,"homepage":"","language":"Elixir","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/beam-community.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-16T18:03:31.000Z","updated_at":"2024-10-01T19:42:17.000Z","dependencies_parsed_at":"2022-08-16T07:40:42.651Z","dependency_job_id":null,"html_url":"https://github.com/beam-community/brady","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/beam-community/brady","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beam-community%2Fbrady","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beam-community%2Fbrady/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beam-community%2Fbrady/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beam-community%2Fbrady/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/beam-community","download_url":"https://codeload.github.com/beam-community/brady/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beam-community%2Fbrady/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263033183,"owners_count":23403112,"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":["elixir","elixir-phoenix","html"],"created_at":"2025-06-08T04:15:05.772Z","updated_at":"2025-12-11T23:51:29.364Z","avatar_url":"https://github.com/beam-community.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Brady\n\n**Brady is part of the [thoughtbot Elixir family][elixir-phoenix] of projects.**\n\nBrady provides helper functions for use within Phoenix templates.\n\n## Usage\n\n### Installation\n\nAdd brady to your list of dependencies in `mix.exs`:\n\n```elixir\n  def deps do\n    [\n      {:brady, \"~\u003e 0.0.10\"},\n    ]\n  end\n```\n\nAnd configure it in `config.exs`:\n\n```elixir\n  config :brady, otp_app: :my_app\n```\n\n### Body Class\n\nThe body_class function can be used like:\n\n`body class=\"\u003c%= Brady.body_class @conn %\u003e\"`\n\nThis will produce a string including the controller name and controller-action\nname. For example, The WidgetsController#show action would produce:\n\n`widgets widgets-show`\n\n### Data URI\n\nTo inline an image, you may use the `Brady.data_uri/1` function. Pass in the\npath relative to `priv/static` and Brady will read the file, base64 encode it, and\nreturn the data uri that is compatible to use within an `\u003cimg\u003e` tag.\n\nFor example:\n\n`\u003c%= img_tag(Brady.data_uri(\"images/placeholder.gif\"), alt: \"Celery Man\" %\u003e`\n\nIt's not recommended to inline images that are more than a few kilobytes in\nsize. By default, Brady will emit a warning when inlining an image more than\n2kb. You can configure this yourself with Mix config:\n\n```elixir\n  config :brady,\n    otp_app: :my_app,\n    inline_threshold: 10_240\n```\n\n### Inline SVG\n\nThe inline_svg function works by passing in your SVG file name and, optionally,\nany CSS attributes you'd like to apply to the SVG.\n\n`\u003c%= Brady.inline_svg(\"foo\", class: \"bar\") %\u003e`\n\nThis will embed the html safe raw SVG in your markup.\n\n`{:safe, ~s(\u003csvg class=\"foo\" data-role=\"bar\" height=\"100\" width=\"100\"\u003e\u003cdesc\u003eThis is a test svg\u003c/desc\u003e\u003ccircle cx=\"50\" cy=\"50\" r=\"40\" stroke=\"black\" stroke-width=\"3\" fill=\"red\"\u003e\u003c/circle\u003e\u003c/svg\u003e)}`\n\nBy default, it looks for files in `priv/static/svg/#{file_name}.svg` but you can\nconfigure this in your config.exs\n\n```elixir\n  config :brady,\n    otp_app: :my_app,\n    svg_path: \"web/static/images\"\n```\n\n## Contributing\n\nSee the [CONTRIBUTING] document.\nThank you, [contributors]!\n\n  [CONTRIBUTING]: CONTRIBUTING.md\n  [contributors]: https://github.com/thoughtbot/brady/graphs/contributors\n\n## License\n\nBrady is Copyright (c) 2015 thoughtbot, inc.\nIt is free software, and may be redistributed\nunder the terms specified in the [LICENSE] file.\n\n  [LICENSE]: /LICENSE\n\n## About\n\n![thoughtbot](http://presskit.thoughtbot.com/images/thoughtbot-logo-for-readmes.svg)\n\nBrady is maintained and funded by thoughtbot, inc.\nThe names and logos for thoughtbot are trademarks of thoughtbot, inc.\n\nWe love open source software, Elixir, and Phoenix. See [our other Elixir\nprojects][elixir-phoenix], or [hire our Elixir Phoenix development team][hire]\nto design, develop, and grow your product.\n\n  [elixir-phoenix]: https://thoughtbot.com/services/elixir-phoenix?utm_source=github\n  [hire]: https://thoughtbot.com?utm_source=github\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeam-community%2Fbrady","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeam-community%2Fbrady","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeam-community%2Fbrady/lists"}