JonyEpsilon / gorilla-repl

A rich REPL for Clojure in the notebook style.
http://gorilla-repl.org
MIT License
888 stars 104 forks source link

how to update welcome page #289

Open bogdartysh opened 4 years ago

bogdartysh commented 4 years ago

Is there a way to customize welcome page ? thus I'll load needed code and print customized welcome message?

MawiraIke commented 4 years ago

Did you mean editing the main html page that loads when running gorilla-repl?

I have found some tricks.

  1. Edit a worksheet. Worksheets are the objects displayed at the main file that are like text boxes. Gorilla Repl uses KnockoutJs models and view models. You can edit a worksheet's segment property to edit the data displayed in a worksheet. The segment property is a list of segments, ko.observableArray() which can be manipulated with normal Javascripts .push and .pop methods e.g here to add a free segment or here to add a code segment. Duplicate the method to see the effect.
  2. To print to console, add your console function inside this. This will get called once this javascript is loaded, which happens on every page reload.
  3. The other way is editing the HTML directly at from this file

Hope this helps.