How to edit the discourse files? A development box?

(Frederik) #1

I would like to play with the files in discourse - Im not a coder, but I have some tweeks I would like to see if Im able to add. The best way to learn is when you have something you will achieve :slight_smile:

I have a little knowledge from php. There you can change a file and see the result of the changes immedealy.

In my discourse server Im not able to finde the .rb files I would like to find. Is that because I need a dev box?

This ruby universe seems to have a steep learning curve… :S


Best place to start is here

(Frederik) #3

I will look at it, thanks :slight_smile:

(Frederik) #4

But it is still not clear to me: Can I on a live setup/site - browse the .rp files via my SSH connection - edit them and see if my changes work?

If I in shell do

cd /var/discourse

./launcher rebuild app

ls -ls

I get this - where do I find the files?

(Jay Pfaffman) #5

You need to set up a development environment to edit files and see changes. In production, lots of stuff is cached, so changes don’t show up.

If you want to see the files

cd /var/discourse 
. /launcher enter app 
cd src

(Frederik) #6

I was now able to follow this guide:

I would like to edit and see if I was able to add some changes to:

But Im not able to find the file on my mac?

Damn it have a steep learning curve this thing…

Wish me back to the old apache days… :thinking:

(Arpit Jalan) #7

To edit onebox files, you need to clone source code for onebox gem.

(Frederik) #8

Didnt I do so in this step in the tutorial?

git clone ~/discourse

(Arpit Jalan) #9

That was for cloning discourse core repo. If you want to hack on onebox gem, you will need to clone the source code for that gem as well.

(Frederik) #10

Okay, then I dont know anything…

What is the difference of a dev box and a running site then?

I thought setting up a dev box I would be able to edit files…

Seems now I need to follow another tutorial…?

This is only for very technical users, like in very - :blush: I give up


You have the core files and then you have various modules that discourse rely on - some developed by discourse and some not. Onebox is one of those modules.

Change max chars in Onebox - enlarge your Onebox?
(Frederik) #12

ahh, now I understand.

But what I need to edit is the file that renders the amazon data like this:

Its give me the same output at my dev box on my mac. I thought it was the file mention above…

What files is it then… :S