Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more samples to the web site #162

Closed
tpetricek opened this issue May 25, 2016 · 2 comments
Closed

Add more samples to the web site #162

tpetricek opened this issue May 25, 2016 · 2 comments

Comments

@tpetricek
Copy link
Collaborator

tpetricek commented May 25, 2016

There is a couple of nice samples in the samples folder that are not currently on the web page. Adding a sample to the web page should be fairly easy and it is a fantastic way to learn Fable and contribute at the same time.

I recently added the D3 map and the commit is a good example of what needs to be done (it also does a few bug fixes you can ignore).

  • the d3map.fsx file is a good example of how to write docs (there are a few required things at the top)
  • in docs.fsx, you need to add the folder to the samples

And that is pretty much it - generally, follow what one of the other examples does. After modifying docs.fsx you can run:

./build.sh GenerateDocs
./build.sh BrowseDocs

The first will generate all docs (it compiles all samples, so do this just once). The second one starts local server and updates the samples when you change them. (On windows, use build.cmd)

@alfonsogarciacaro
Copy link
Member

I had to make a couple of changes to make it work on my machine but after that I just added the three.js tutorial and is like magic! Thanks a lot for your hard work, Tomas!

@alfonsogarciacaro
Copy link
Member

alfonsogarciacaro commented Jun 15, 2016

Just to complete Tomas' explanation:

  • The HTML for the sample will be generated automatically, but you can still keep some parts in the HTML head or body by wrapping the elements as can be seen here and here.
  • The first lines of the fsx script should also contain info for the generation of the HTML: the title, the tagline (or subtitle), the CSS inline style of the container that'll hold the running sample, paths to resolve dependencies (optional) and an intro which comes right below the title.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants