How to edit the discourse files? A development box?

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

9 Likes

I will look at it, thanks :slight_smile:

1 Like

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

Then:
./launcher rebuild app

Then
ls -ls

I get this - where do I find the files?

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
ls
5 Likes

I was now able to follow this guide:

I would like to edit and see if I was able to add some changes to: https://github.com/discourse/onebox/blob/master/lib/onebox/engine/amazon_onebox.rb

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:

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

2 Likes

Didnt I do so in this step in the tutorial?

git clone GitHub - discourse/discourse: A platform for community discussion. Free, open, simple. ~/discourse

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.

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.

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

This topic was automatically closed after 2296 days. New replies are no longer allowed.