tpetricek/FSharp.Formatting — pull request #209 by matthid (2014-10-07 11:26:24+00:00)
Title: Razor engine update and improved mono support.

Same as #207 but with an additional fix:

>- Removed RazorEngine from paket and use RazorEngine.N paket, fixes #203.
>- add assemblyReferences optional parameter to specify the references for the templates (while compiling):
> * For RazorEngine I used the following code to make it work cross platform:
>```
> let references =
> if isMono then
>	// Workaround compiler errors in Razor-ViewEngine
>	let d = RazorEngine.Compilation.Resolver.UseCurrentAssembliesReferenceResolver()
>	let loadedList = d.GetReferences () |> Seq.cache
>	//// We replace the list and add required items manually as mcs doesn't like duplicates...
>	let getItem name =
>	loadedList |> Seq.find (fun l -> l.Contains name)
>	[ (getItem "FSharp.Core").Replace("4.3.0.0", "4.3.1.0") // (if isMono then "/usr/lib64/mono/gac/FSharp.Core/4.3.1.0__b03f5f7f11d50a3a/FSharp.Core.dll" else "FSharp.Core")
>	Path.GetFullPath "./lib/FSharp.Compiler.Service/FSharp.Compiler.Service.dll"
>	Path.GetFullPath "./build/net40/System.Web.Razor.dll"
>	Path.GetFullPath "./build/net40/RazorEngine.dll"
>	Path.GetFullPath "./lib/FSharp.Formatting/FSharp.Literate.dll"
>	Path.GetFullPath "./lib/FSharp.Formatting/FSharp.CodeFormat.dll"
>	Path.GetFullPath "./lib/FSharp.Formatting/FSharp.MetadataFormat.dll" ]
>	|> Some
> else None
>```
> See https://github.com/matthid/RazorEngine/blob/develop/generateDocs.fsx#L48-64 and https://github.com/matthid/RazorEngine/blob/develop/generateDocs.fsx#L98.
>
>Currently I see no other good solution for making it work cross platform without delegating the problem to the user, if somebody can see another solution please open an issue on my RazorEngine fork...
>Besides that it has the additional advantage that now users can use their own types/code in custom templates by just adding a reference to their custom assembly.
>
>Note this also fixes the problem mentioned at the end of #202.
>
>The last commit fixes that ProcessDirectory doesn't process the directory recursively as indicated by the recursive inner function definition.