fsprojects / FsReveal

FsReveal parses markdown and F# script file and generates reveal.js slides.
http://fsprojects.github.io/FsReveal
258 stars 100 forks source link

Use optional parameters and allow speechifying FSI evaluator #51

Closed tpetricek closed 9 years ago

tpetricek commented 9 years ago

In my LambdaDays talk, I used evaluation of F# snippets to create simple diagrams as inline F# snippets - see the code. The way this works is that the snippet returns a value of a custom type and then the FSI evaluator turns it into HTML.

To do this, I need to pass custom IFsiEvaluator to FsReveal (the evaluator is configured with formatters).

This PR makes it possible to pass custom evaluator. The current API does not make it possible to add optional parameters, so sadly this probably has to be a breaking change. This PR changes the API to use tuples style parameters and it makes some of them optional.

If people have better ideas on how to handle configuration, then please suggest alternative ways for specifying the parameters - but I guess it would be good to find some mechanism that will avoid breaking changes if we want to add more options in the future.

forki commented 9 years ago

Personally I'm fine with the breaking change. We still break a lot ;-) As a general idea I try to minimize the code in build.fsx of the master branch and move more and more over into the dll.

forki commented 9 years ago

argh shouldn't have merged that fast. 11 broken tests...

forki commented 9 years ago

image

tpetricek commented 9 years ago

Ah, I see... I enabled evaluator for MD files, which was previously disabled.

tpetricek commented 9 years ago

I reverted the change - will have a look at what's wrong and send a fixed PR.

forki commented 9 years ago

:+1: