fsharp / TryFSharp

MIT License
26 stars 15 forks source link

Fable REPL

Building locally

To develop the REPL locally, run the WatchApp FAKE target and then open localhost:8080 in your browser.

How to add a sample

To add a sample, you need to add an .fs file to the public/samples/Samples.fsproj project (and a corresponding .html file if necessary), then update public/samples/samples.json. This file is used to generate the samples menu in the browser. This commit is a good example of adding a sample (pun intended).

If you just want to update on the existing samples, you can do it directly using Github UI and send a PR automatically.

You can add three types of entries:

Category

{
    "type": "category",
    "label": "Learn Fable",
    "children": [
    ]
}

SubCategory

{
    "type": "sub-category",
    "label": "Interop",
    "children": [
    ]
}

MenuItem

{
    "type": "menu-item",
    "label": "Basic canvas",
    "fsharpCode": "basic-canvas/basic_canvas.fs",
    "htmlCode": "basic-canvas/basic_canvas.html"
}

All the urls for fsharpCode, htmlCode are relative to the public/samples folder.