Skip to content
← Back to Community
How to choose which file displays when embedding?
Profile icon
rrcobb

I have a repl with a Markdown readme - I want the readme to display when I embed the repl, instead of the default file.

Is there a way to configure this?

Voters
Profile icon
ANIL25
Profile icon
OlegAvdeev2
Profile icon
ArcPG
Profile icon
rrcobb
Comments
hotnewtop
Profile icon
Nashorn1

How can i configure my repl.it embed to open an html file other than index.html? I have to demo multiple different html demos and want to share a diff repl

Profile icon
AdCharity

I mean here's a thought. Connect the project to github/commit the stuff and rename index.js as something else. Make the Markdown readme the first file so it will display first. Then, use a replit file and configure it to run the renamed index.js file.

Profile icon
rrcobb

@AdCharity thanks for the reply! Quick clarification - what do you mean by 'first file'? I don't see a way of ordering the files in repl.it (or on github). As far as I can tell, it's alphabetical

Profile icon
AdCharity

@rrcobb problem is I have no clue (I'm pretty sure repl defaults to index -> alphabetical)

Profile icon
rrcobb

@AdCharity okay, I haven't been able to get it work this way, but it might be there's no way to do it. Thanks anyway!

Profile icon
AdCharity

@rrcobb kk Give me an example project you want to send over I want to try that really quick (don't worry I'm not stealing your code)

Profile icon
rrcobb
Profile icon
rrcobb

When I load the page, the .replit file opens - I want the README or index.js to open instead

Profile icon
SixBeeps

Repl.it will always run the main file, so how I'd do it is in your HTML page you want to embed the Repl into, put the readme there instead and make a new embed to the rest of the code whenever they're done reading it.

Profile icon
rrcobb

@SixBeeps thanks for the idea!

It's actally a node.js repl, so it doesn't have an html page. I'm also using the .replit config file to decide what happens when I click the 'Run' button, and now that's the file that shows up when I embed the repl or refresh.

Profile icon
SixBeeps

@rrcobb Oh, interesting.
There's a library written in Node.js called Marked that parses markdown into the resulting webpage, so maybe give that a try?

Profile icon
rrcobb

@SixBeeps I don't think that'll work for me - I mostly want to be able to configure which file shows up by default in the embed (instead of the .replit file)

Profile icon
SixBeeps

@rrcobb Oh yeah no that's not possible.