All Projects → thoughtbot → brady

thoughtbot / brady

Licence: MIT License
Template Helpers for phoenix applications

Programming Languages

elixir
2628 projects
shell
77523 projects

Projects that are alternatives of or similar to brady

page object
Page Objects for Hound / Elixir
Stars: ✭ 19 (-42.42%)
Mutual labels:  elixir-phoenix
estimator-elixir
Elixir side-project: Collaboratively estimate Jira stories (for remote teams)
Stars: ✭ 44 (+33.33%)
Mutual labels:  elixir-phoenix
inertia phoenix
Inertiajs Adapter for Elixir Phoenix
Stars: ✭ 60 (+81.82%)
Mutual labels:  elixir-phoenix
leafblower
Play Cards Against Humanity online with friends!
Stars: ✭ 29 (-12.12%)
Mutual labels:  elixir-phoenix
phx raws
Raw websocket server on top of Phoenix.
Stars: ✭ 27 (-18.18%)
Mutual labels:  elixir-phoenix
igthorn
Cryptocurrency trading platform
Stars: ✭ 86 (+160.61%)
Mutual labels:  elixir-phoenix
freshcom-api
Deprecated
Stars: ✭ 43 (+30.3%)
Mutual labels:  elixir-phoenix
live view black jack
BlackJack https://polite-angelic-beaver.gigalixirapp.com/
Stars: ✭ 58 (+75.76%)
Mutual labels:  elixir-phoenix
autoform
🤖📝 AutoForm is the simplest way to automatically generate fast, beautiful and standards/WCAG compliant HTML forms based on an Ecto Schema in a Phoenix Web Application to *significantly* speed up Web App Development. 🚀
Stars: ✭ 18 (-45.45%)
Mutual labels:  elixir-phoenix
revista
☂️ Reference Elixir umbrella project deployed to AWS ECS with Docker and Terraform.
Stars: ✭ 18 (-45.45%)
Mutual labels:  elixir-phoenix
audioslides.io
Use Amazon Polly, Google Slides and FFMpeg to create videos that can be updated at anytime by anyone. This project is written in Elixir.
Stars: ✭ 19 (-42.42%)
Mutual labels:  elixir-phoenix
NLW-Together-Elixir
Wabanex - Gerencie e acompanhe seus treinos na academia! Evento NLW Together organizado pela @Rocketseat 🚀
Stars: ✭ 15 (-54.55%)
Mutual labels:  elixir-phoenix
mindwendel
Create a challenge. Ready? Brainstorm. mindwendel helps you to easily brainstorm and upvote ideas and thoughts within your team.
Stars: ✭ 22 (-33.33%)
Mutual labels:  elixir-phoenix
suomi.dev
Like Hacker News, but for Finns!
Stars: ✭ 27 (-18.18%)
Mutual labels:  elixir-phoenix
vscode-eex-snippets
Elixir EEx and HTML (EEx) code snippets.
Stars: ✭ 23 (-30.3%)
Mutual labels:  elixir-phoenix
live dj
💿 Join or create video playlists to share a real-time experience with others! 🎧
Stars: ✭ 19 (-42.42%)
Mutual labels:  elixir-phoenix
vim-ide-elixir
Highly opininated setup of vim plugins for Elixir development
Stars: ✭ 28 (-15.15%)
Mutual labels:  elixir-phoenix
plug rails cookie session store
Rails compatible Plug session store
Stars: ✭ 93 (+181.82%)
Mutual labels:  elixir-phoenix
wassup
Personal assistant to help you save your personal memories and emotions together, securely
Stars: ✭ 58 (+75.76%)
Mutual labels:  elixir-phoenix
pryin
PryIn is an Application Performance Monitoring platform for your Elixir/Phoenix application.
Stars: ✭ 25 (-24.24%)
Mutual labels:  elixir-phoenix

Brady

Brady is part of the thoughtbot Elixir family of projects.

Brady provides helper functions for use within Phoenix templates.

Usage

Installation

Add brady to your list of dependencies in mix.exs:

  def deps do
    [
      {:brady, "~> 0.0.10"},
    ]
  end

And configure it in config.exs:

  config :brady, otp_app: :my_app

Body Class

The body_class function can be used like:

body class="<%= Brady.body_class @conn %>"

This will produce a string including the controller name and controller-action name. For example, The WidgetsController#show action would produce:

widgets widgets-show

Data URI

To inline an image, you may use the Brady.data_uri/1 function. Pass in the path relative to priv/static and Brady will read the file, base64 encode it, and return the data uri that is compatible to use within an <img> tag.

For example:

<%= img_tag(Brady.data_uri("images/placeholder.gif"), alt: "Celery Man" %>

It's not recommended to inline images that are more than a few kilobytes in size. By default, Brady will emit a warning when inlining an image more than 2kb. You can configure this yourself with Mix config:

  config :brady,
    otp_app: :my_app,
    inline_threshold: 10_240

Inline SVG

The inline_svg function works by passing in your SVG file name and, optionally, any CSS attributes you'd like to apply to the SVG.

<%= Brady.inline_svg("foo", class: "bar") %>

This will embed the html safe raw SVG in your markup.

{:safe, ~s(<svg class="foo" data-role="bar" height="100" width="100"><desc>This is a test svg</desc><circle cx="50" cy="50" r="40" stroke="black" stroke-width="3" fill="red"></circle></svg>)}

By default, it looks for files in priv/static/svg/#{file_name}.svg but you can configure this in your config.exs

  config :brady,
    otp_app: :my_app,
    svg_path: "web/static/images"

Contributing

See the CONTRIBUTING document. Thank you, contributors!

License

Brady is Copyright (c) 2015 thoughtbot, inc. It is free software, and may be redistributed under the terms specified in the LICENSE file.

About

thoughtbot

Brady is maintained and funded by thoughtbot, inc. The names and logos for thoughtbot are trademarks of thoughtbot, inc.

We love open source software, Elixir, and Phoenix. See our other Elixir projects, or hire our Elixir Phoenix development team to design, develop, and grow your product.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].