anchor.diff: -
   #r @"paket:
   nuget Fake.Core.Target
   nuget Fake.Core.Process
  
positive.code: open Fake.Core
  open Fake.Core.TargetOperators
  open Fake.DotNet
  open Fake.IO.Globbing
  open Fake.DotNet.NuGet
  open Fake.DotNet.Testing
  open Fake.IO
  open Fake.IO.FileSystemOperators
  open Fake.IO.Globbing.Operators
  open Fake.Tools
  
  [<AutoOpen>]
  module TemporaryDocumentationHelpers =
  
      type LiterateArguments =
          { ToolPath : string
            Source : string
            OutputDirectory : string 
            Template : string
            ProjectParameters : (string * string) list
            LayoutRoots : string list 
            FsiEval : bool }
  
      let private run toolPath arguments = 
          Command.RawCommand
              (
                  toolPath,
                  arguments
              )
          |> CreateProcess.fromCommand
          |> CreateProcess.withFramework
          |> CreateProcess.ensureExitCode
          |> Proc.run
          |> ignore
  
  
      let createDocs p =
          let toolPath = 
              match ProcessUtils.tryFindLocalTool "" "fsformatting.exe"  [(Directory.GetCurrentDirectory() @@ "/lib")] with
              |Some tool -> tool
              | _ -> failwith "FSFormatting executable not found"
          //let toolPath = Tools.findToolInSubPath "fsformatting.exe" (Directory.GetCurrentDirectory() @@ "lib/Formatting")
  
          let defaultLiterateArguments =
              { ToolPath = toolPath
                Source = ""
                OutputDirectory = ""
                Template = ""
                ProjectParameters = []
                LayoutRoots = [] 
                FsiEval = false }
  
          let arguments = (p:LiterateArguments->LiterateArguments) defaultLiterateArguments
          let layoutroots =
              if arguments.LayoutRoots.IsEmpty then []
              else [ "--layoutRoots" ] @ arguments.LayoutRoots
          let source = arguments.Source
          let template = arguments.Template
          let outputDir = arguments.OutputDirectory
          let fsiEval = if arguments.FsiEval then [ "--fsieval" ] else []
  
          let command = 
              arguments.ProjectParameters
              |> Seq.map (fun (k, v) -> [ k; v ])
              |> Seq.concat
              |> Seq.append 
                     (["literate"; "--processdirectory" ] @ layoutroots @ [ "--inputdirectory"; source; "--templatefile"; template; 
                        "--outputDirectory"; outputDir] @ fsiEval @ [ "--replacements" ])
              |> Arguments.OfArgs
          run arguments.ToolPath command
          printfn "Successfully generated docs for %s" source
  
  let project = "FSharp.Plotly"
  
  let summary = "A F# interactive charting library using plotly.js"
  
negative.code:   ==> "CopyBinaries"
    ==> "RunTests"
    ==> "BuildPreReleasePackages"
    ==> "publishPrereleaseNugetPackages"
  
  Target.runOrDefaultWithArguments "All"
  