ZachBray/FunScript — pull request #28 by tpetricek (2012-12-24 02:27:26+00:00)
Title: Documentation tools (incomplete!)

This is not really a complete pull request yet, but I thought I'd share this in case you had the time to take a look before I finish this and clean it up a bit.

The pull request uses the [FSharp.Formatting](https://github.com/tpetricek/FSharp.Formatting) package to generate nice documentation from (one of the) samples in `Examples` directory. Here is how it works:

* You can use special comments (as described in the [documentation for FSharp.Formatting](http://tpetricek.github.com/FSharp.Formatting/demo.html)) to write F# source code with additional description using Markdown. See the `Examples\Tutorial\Page.fs` file for an example.

* Then you build everything (and run the `Tutorial` project to generate JavaScript).

* After that, you can run the `generateDocs` function in `Examples\Documentation\Tools\build.fsx`. This needs to be cleaned up, but it takes the `Page.fs` file, generates HTML with nice F# snippets and formatted documentation *and* it also embeds the generated JavaScript and a (specially marked) part of `index.html` from the sample.

* If everything goes well, you should find newly generated `Examples\Documentation\Output\tutorial.html` file with nice documentation and live demo!

I also had to change some relative paths in the examples (so that they work when opened using the `FunScript.Examples.sln` solution in the `Examples` directory). I'm not entirely sure what is the best solution here, so feel free to undo the changes.