Switching from erb to slim

(Robby O'Connor) #1

I was just curious why erb is used and not slim or haml as they are DRYer than ERB – and additionally there is a tool that can convert from erb2slim rather easily.

(Kane York) #2

There isn’t much use of .erb files anyways, most of the html is in Handlebars files. So it’s not really an issue.

(Sam Saffron) #3

I, for one, really dislike HAML these days, was on the HAML train for quite a while… and then you start hitting edge cases and wanted to cut yourself.

Besides, HAML has the same issue YAML has which is huge amounts of punishment dolloped out when


(Robby O'Connor) #4

haml sucks, I get that – why not slim?

(Sam Saffron) #5

cause slim is just haml by another name?

(Robby O'Connor) #6

Not necessarily…slim has syntax that doesn’t make me barf…true it’s sensitive to spacing…but configure your editor correctly…and you’re golden :slight_smile:

(mountain) #7

Not a lot of folks know to do that. When there’s a need to have a specific prior set up for an editor, then it’s more difficult for users to move to Discourse. The easier the transition, the better. :+1:

(Robby O'Connor) #8

So I am guessing (I’d give this a lil more time) that this has basically been killed and if I went ahead and did a PR, it’d be closed without merging?

(Robby O'Connor) #9

I was looking for a way to contribute to discourse – figured first I’d convince you to switch to my tools…

(Jeff Atwood) #10

si fueris Rōmae, Rōmānō vīvitō mōre; si fueris alibī, vīvitō sicut ibi

(Sam Saffron) #11

We have :mount_fuji: of work that is non-controversial you could start on, “Let’s all switch to ‘my’ way of doing things” is never going to land well no matter which project you are looking to contribute to


It is jam packed with suggestions!

(Robby O'Connor) #12

It could go either way actually…sometimes it might go well…other times…not so well…but in this case it’s clear it went the latter :slight_smile:

(Robin Ward) #13

My first prototype of Discourse used Haml actually, but @sam argued that it would be another thing for devs to learn, so he converted it to erb.

Can’t say I really disagree with that - and for the very small amount of server side templates we have (seriously it’s gotta be like 5 total), I feel the benefits of using Haml are even worth it.

(Robby O'Connor) #14

I’d convert to slim…not haml if I did it…but I wanna know it’d be
accepted before I did it…

(Robin Ward) #15

Yes I know, but the reason we don’t use Haml is the same reason we are not interested in Slim.

To be 100% clear we would not accept that PR.

(Jacob Chapel) #16

There are very little templates. The real templates are Handlebars.

Better to contribute in a way that benefits Discourse and not only yourself.

(Robby O'Connor) #17

I can get behind that.