Skip to content

Commit

Permalink
Merge pull request #1147 from ovatsus/UpgradeFSharpFormatting
Browse files Browse the repository at this point in the history
Upgrade to FSharp.Formatting 3.0
  • Loading branch information
Gustavo Guerra committed Apr 9, 2018
2 parents fe68f17 + 7e01228 commit dc7379c
Show file tree
Hide file tree
Showing 4 changed files with 290 additions and 26 deletions.
14 changes: 6 additions & 8 deletions docs/tools/generate.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,18 @@ let info =

#I "../../packages/test/FSharp.Charting/lib/net45"
#r "Fsharp.Charting.dll"
#r "System.Windows.Forms.DataVisualization.dll"
#r "System.Windows.Forms.DataVisualization"
#r "../../packages/FAKE/tools/FakeLib.dll"
#load "../../packages/test/FSharp.Formatting/FSharp.Formatting.fsx"

open System.IO
open Fake
open Fake.FileHelper
open FSharp.Charting
open System.Drawing.Imaging
open System.Windows.Forms
open FSharp.Literate
open FSharp.Markdown
open FSharp.MetadataFormat
open FSharp.Formatting.Razor

// When called from 'build.fsx', use the public project URL as <root>
// otherwise, use the current 'output' directory.
Expand Down Expand Up @@ -79,10 +78,10 @@ let copyFiles () =
// Build API reference from XML comments
let buildReference () =
CleanDir (output @@ "reference")
MetadataFormat.Generate
RazorMetadataFormat.Generate
( referenceBinaries |> List.map ((@@) bin),
output @@ "reference",
layoutRootsEn,
layoutRoots = layoutRootsEn,
parameters = ("root", root)::info,
sourceRepo = repo,
sourceFolder = __SOURCE_DIRECTORY__ @@ ".." @@ "../")
Expand All @@ -102,11 +101,10 @@ let createFsiEvaluator root output =
let id = imageCounter().ToString()
let file = "chart" + id + ".png"
ensureDirectory (output @@ "images")

// We need to reate host control, but it does not have to be visible
( use ctl = new ChartTypes.ChartControl(ch, Dock = DockStyle.Fill, Width=800, Height=300)
ch.CopyAsBitmap().Save(output @@ "images" @@ file, ImageFormat.Png) )
Some [ Paragraph [DirectImage ("Chart", (root + "/images/" + file, None))] ]
Some [ Paragraph([DirectImage ("Chart", (root + "/images/" + file), None, None)], None) ]

| _ -> None

Expand All @@ -126,7 +124,7 @@ let buildDocumentation () =
for dir in Seq.append [content] subdirs do
let sub = if dir.Length > content.Length then dir.Substring(content.Length + 1) else "."
let layoutRoots = if dir.Contains "ja" then layoutRootsJa else layoutRootsEn
Literate.ProcessDirectory
RazorLiterate.ProcessDirectory
( dir, docTemplate, output @@ sub, replacements = ("root", root)::info,
layoutRoots = layoutRoots, fsiEvaluator = fsiEvaluator, processRecursive = false )

Expand Down
3 changes: 2 additions & 1 deletion paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ nuget Microsoft.NETCore.App
group Test
frameworks: netcoreapp2.0, net461
source https://api.nuget.org/v3/index.json
source https://ci.appveyor.com/nuget/fsharp-formatting
redirects: on

nuget FSharp.Core
Expand All @@ -31,7 +32,7 @@ group Test
nuget FsUnit
nuget FsCheck
nuget FSharp.Charting
nuget FSharp.Formatting
nuget FSharp.Formatting prerelease
nuget Nancy.Hosting.Self

# This is for TPSDK testing against FSharp.Core for F# 3.1. The TPSDK testing helpers like these to be placed in package groups
Expand Down
Loading

0 comments on commit dc7379c

Please sign in to comment.