k0kubun / hamlit

High Performance Haml Implementation
https://rubygems.org/gems/hamlit
Other
980 stars 60 forks source link

data-trace #142

Closed sfcgeorge closed 5 years ago

sfcgeorge commented 5 years ago

This is a really useful feature of HAML where in development it adds data-trace to each HTML element with the path to the partial it came from. It's useful in large codebases or for new devs to find where things are defined. Right click, Inspect, find the element, copy the path :)

http://haml.info/docs/yardoc/Haml/Options.html#trace-instance_method

Haml::Template.options[:trace] = true

k0kubun commented 5 years ago

I didn't know the feature, but it seems nice. What I knew is https://github.com/r7kamura/view_source_map, which might be more helpful if you mix .haml with .erb. If you think data-trace is more helpful than the plugin or you're not using Rails, I'm okay with supporting it in Hamlit too.

k0kubun commented 5 years ago

Let me close this due to the inactivity. Please feel free to reopen this if you really wish to use the feature.

sfcgeorge commented 5 years ago

Just tried view_source_map, that's ideal actually, thank you for sharing 😄