GithubHelp home page GithubHelp logo

phoet / partially_useful Goto Github PK

View Code? Open in Web Editor NEW
23.0 4.0 5.0 46 KB

:bookmark_tabs: :eyes: Helps identifying partials in verbose HTML source code.

Home Page: https://github.com/phoet/partially_useful

License: Other

Ruby 96.49% HTML 3.51%
rails partials ruby view

partially_useful's Introduction

PartiallyUseful

Build Status

HTML source code is very verbose and can be a pain in the ass to find a specific part on big pages.

Finding the origin of a piece of HTML in the Rails app/views directory can be tedious and error prone.

Adding this gem to your Rails application adds HTML comments at development time, so it's easy to find the right partials.

<!-- start rendering 'some_partial' with locals '[:all, :assigned, :locals]'-->
<div class="hello">
    <div class="world">
      [...]
    </div>
</div>
<!-- end rendering 'some_partial' with locals '[:all, :assigned, :locals]'-->

Installation

Add this line to your application's Gemfile:

gem 'partially_useful', group: 'development'

Usage

The plugin is enabled by default, but you can disable it in your Rails configuration:

# config/environments/development.rb
config.partially_useful = false

Caveats

HTML comments might subtly break your application when partials are used out of the usual HTML rendering context (JS, CSS etc).

If you run into any problems, make sure to disable the gem and restart your Rails server.

Supported Ruby and Rails versions

Version 6.0.x has support for Rails 6.0.x. Version 5.1.0 has support for Rails 5.x and Ruby 2.x. Older Rails and Ruby versions are supported by the 0.x releases.

Contributing

  1. Fork it ( https://github.com/phoet/partially_useful/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

License

See LICENSE.md.

Changelog

See CHANGELOG.md.

partially_useful's People

Contributors

brixen avatar edouard-chin avatar kirs avatar phoet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

partially_useful's Issues

Clarification about the minimum Ruby version

Hi,

I've been using something way more manual than this for a long time and I like what you've done here. It's very useful. Thanks

You seem to use Module#prepend on ActionView::PartialRenderer which has been introduced by Ruby 2.0.
If I'm not wrong about this, it might be a good idea to state this requirement explicitly in the README and in the gemspec.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.