TheWebTech / CrankShaft

A framework for building modern websites on the HubSpot Platform.
https://thewebtech.github.io/CrankShaft
MIT License
46 stars 17 forks source link

Add Debug Variable Macro #63

Closed TheWebTech closed 5 years ago

TheWebTech commented 5 years ago

Idea is - a macro that you pass a variable into. When you do that it pretty prints the variable, but only if hsDebug=true. This is a utility that can be used to debug your code without risking that code being seen live.

This would go in theme-macros.css

If you have additional ideas for this go for it!

adesignl commented 5 years ago

{% macro debugger( var ) %}{% if request.query_dict.hsDebug == true %}

  {{ var|pprint }}
{% endif %} {% endmacro %}On May 14, 2019 9:20 AM, John Fuller wrote:{% macro debugger( var ) %}
  {{ var|pprint }}
{% endmacro %} —You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or mute the thread.
johnsfuller commented 5 years ago

haha I deleted comment after I realized I forgot the debug request. Cheers

TheWebTech commented 5 years ago

lol aside from your email reply stuff ending up in the post, this seems like this might be perfect.

Someone add it to theme-macros.css! 👍