diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 2c5d0ec8..2bab7438 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -11,7 +11,7 @@ * Statistics: DescriptiveStatistics support for larger datasets. * MKL: native providers must not require MFC to compile. * Sorting helpers support sub-range sorting, use insertion sort on very small sets. -* Build: extend usage of FAKE, automate docs, api and NuGet package generation. +* Build: extend usage of FAKE, automate docs, api, Zip and NuGet package generation. * Portable: replace PCL profile 136 with profile 344, support for WP8.1 * Xamarin: prepare for better Xamarin Android/iOS support and for adding to the Xamarin store (free). * Misc code style fixes. diff --git a/docs/tools/build-docs.fsx b/docs/tools/build-docs.fsx index f275e8d7..2193902d 100644 --- a/docs/tools/build-docs.fsx +++ b/docs/tools/build-docs.fsx @@ -46,6 +46,7 @@ let root = "file://" + (__SOURCE_DIRECTORY__ @@ "../../out/docs") #endif // Paths with template/source/output locations +let top = __SOURCE_DIRECTORY__ @@ "../../" let bin = __SOURCE_DIRECTORY__ @@ "../../out/lib/Net40" let content = __SOURCE_DIRECTORY__ @@ "../content" let output = __SOURCE_DIRECTORY__ @@ "../../out/docs" @@ -56,34 +57,45 @@ let docTemplate = formatting @@ "templates/docpage.cshtml" // Where to look for *.csproj templates (in this order) let layoutRoots = - [ templates; formatting @@ "templates" - formatting @@ "templates/reference" ] + [ templates + formatting @@ "templates" + formatting @@ "templates/reference" ] + +let extraDocs = + [ "RELEASENOTES.md", "ReleaseNotes.md" + "LICENSE.md", "License.md" ] // Copy static files and CSS + JS from F# Formatting -let copyFiles () = - CopyRecursive files output true |> Log "Copying file: " - ensureDirectory (output @@ "content") - CopyRecursive (formatting @@ "styles") (output @@ "content") true - |> Log "Copying styles and scripts: " +let copyFiles() = + CopyRecursive files output true |> Log "Copying file: " + ensureDirectory (output @@ "content") + CopyRecursive (formatting @@ "styles") (output @@ "content") true |> Log "Copying styles and scripts: " // Build API reference from XML comments -let buildReference () = - CleanDir (output @@ "reference") - for lib in referenceBinaries do - MetadataFormat.Generate - ( bin @@ lib, output @@ "reference", layoutRoots, - parameters = ("root", root)::info, - sourceRepo = "https://github.com/mathnet/mathnet-numerics/tree/master/src", - sourceFolder = @"..\..\src", publicOnly = true) +let buildReference() = + CleanDir(output @@ "reference") + for lib in referenceBinaries do + MetadataFormat.Generate + (bin @@ lib, output @@ "reference", layoutRoots, parameters = ("root", root) :: info, + sourceRepo = "https://github.com/mathnet/mathnet-numerics/tree/master/src", sourceFolder = @"..\..\src", + publicOnly = true) // Build documentation from `fsx` and `md` files in `docs/content` -let buildDocumentation () = - let subdirs = Directory.EnumerateDirectories(content, "*", SearchOption.AllDirectories) - for dir in Seq.append [content] subdirs do - let sub = if dir.Length > content.Length then dir.Substring(content.Length + 1) else "." - Literate.ProcessDirectory - ( dir, docTemplate, output @@ sub, replacements = ("root", root)::info, - layoutRoots = layoutRoots, references=false, lineNumbers=true ) +let buildDocumentation() = + for (fileName, docName) in extraDocs do CopyFile (content @@ docName) (top @@ fileName) + let subdirs = Directory.EnumerateDirectories(content, "*", SearchOption.AllDirectories) + for dir in Seq.append [ content ] subdirs do + let sub = if dir.Length > content.Length then dir.Substring(content.Length + 1) else "." + Literate.ProcessDirectory + (dir, docTemplate, output @@ sub, replacements = ("root", root) :: info, layoutRoots = layoutRoots, + references = false, lineNumbers = true) + for (_, docName) in extraDocs do DeleteFile (content @@ docName) + +// Generate +copyFiles() +buildDocumentation() +//buildReference() + // Generate copyFiles() diff --git a/docs/tools/templates/template.cshtml b/docs/tools/templates/template.cshtml index d86194fd..4da45ab3 100644 --- a/docs/tools/templates/template.cshtml +++ b/docs/tools/templates/template.cshtml @@ -45,9 +45,9 @@