From b314bff12740a596186a796f6471b9c9c3da5bbc Mon Sep 17 00:00:00 2001 From: Shannon Date: Fri, 24 Jan 2014 18:23:37 +1100 Subject: [PATCH] Creates powershell file to do the build, this detects if you have sandcastle installed first, also overwrites the default TOC.css file with a custom slightly nicer version for the output. --- .gitignore | 2 +- build/ApiDocs/TOC.css | 170 +++++++++++++++++++ build/{ => ApiDocs}/csharp-api-docs.shfbproj | 10 +- build/BuildBelle.bat | 32 ---- build/BuildDocs.ps1 | 27 +++ 5 files changed, 203 insertions(+), 38 deletions(-) create mode 100644 build/ApiDocs/TOC.css rename build/{ => ApiDocs}/csharp-api-docs.shfbproj (97%) delete mode 100644 build/BuildBelle.bat create mode 100644 build/BuildDocs.ps1 diff --git a/.gitignore b/.gitignore index d35f5d2927..ce1b7b9114 100644 --- a/.gitignore +++ b/.gitignore @@ -107,4 +107,4 @@ src/Umbraco.Web.UI/[Cc]onfig/appSettings.config src/Umbraco.Web.UI/[Cc]onfig/connectionStrings.config src/Umbraco.Web.UI/umbraco/plugins/* src/Umbraco.Web.UI/umbraco/js/init.js -build/Help/* +build/ApiDocs/Output/* diff --git a/build/ApiDocs/TOC.css b/build/ApiDocs/TOC.css new file mode 100644 index 0000000000..9c32aba214 --- /dev/null +++ b/build/ApiDocs/TOC.css @@ -0,0 +1,170 @@ +/* File : TOC.css +// Author : Eric Woodruff (Eric@EWoodruff.us) +// Updated : 09/07/2007 +// +// Stylesheet for the table of content +*/ + +* +{ + margin: 0px 0px 0px 0px; + padding: 0px 0px 0px 0px; +} + +body +{ + font-family: Segoe UI, Arial, Verdana, Helvetica, sans-serif; + font-size: 0.9em; + background-color: white; + color: White; + overflow: hidden; +} + +input +{ + padding:5px; + margin: 3px 0px 3px 0px +} + +img +{ + border: 0; + margin-left: 5px; + margin-right: 2px; +} + +img.TreeNodeImg +{ + cursor: pointer; +} + +img.TOCLink +{ + cursor: pointer; + margin-left: 0; + margin-right: 0; +} + +a.SelectedNode, a.UnselectedNode +{ + color: #333; + text-decoration: none; + padding: 1px 3px 1px 3px; + white-space: nowrap; +} + +a.SelectedNode +{ + background-color: #ffffff; + border: solid 1px #999999; + padding: 0px 2px 0px 2px; +} + +a.UnselectedNode:hover, a.SelectedNode:hover +{ + background-color: #cccccc; + border: solid 1px #999999; + padding: 0px 2px 0px 2px; +} + +.Visible +{ + display: block; + margin-left: 2em; +} + +.Hidden +{ + display: none; +} + +.Tree +{ + background-color: #fff; + color: #333; + width: 300px; + overflow: auto; +} + +.TreeNode, .TreeItem +{ + white-space: nowrap; + margin: 2px 2px 2px 2px; +} + +.TOCDiv +{ + position: relative; + float: left; + width: 300px; + height: 100%; +} + +.TOCSizer +{ + clear: none; + float: left; + width: 10px; + height: 100%; + background-image: url("Splitter.gif"); + background-position:center center; + background-repeat:no-repeat; + position: relative; + cursor: w-resize; + border-left: solid 1px #CCC; +} + +.TopicContent +{ + position: relative; + float: right; + background-color: white; + height: 100%; +} + +.SearchOpts +{ + padding: 5px 5px 10px 5px; + color: black; + width: 300px; + border-bottom: solid lightgrey 1px; + height: 110px !important; +} + +.NavOpts +{ + padding: 5px 5px 6px 5px; + color: black; + width: 300px; + border-bottom: solid lightgrey 1px; +} + +.NavOpts img { + display:inline-block; + margin: 0px 5px 0px 5px; +} + +.IndexOpts +{ + padding: 5px 5px 6px 5px; + color: black; + width: 300px; + border-bottom: solid lightgrey 1px; +} + +.IndexItem +{ + white-space: nowrap; + margin: 2px 2px 2px 2px; +} + +.IndexSubItem +{ + white-space: nowrap; + margin: 2px 2px 2px 12px; +} + +.PaddedText +{ + margin: 10px 10px 10px 10px; +} diff --git a/build/csharp-api-docs.shfbproj b/build/ApiDocs/csharp-api-docs.shfbproj similarity index 97% rename from build/csharp-api-docs.shfbproj rename to build/ApiDocs/csharp-api-docs.shfbproj index fdfa7e5f44..f635f2e2ee 100644 --- a/build/csharp-api-docs.shfbproj +++ b/build/ApiDocs/csharp-api-docs.shfbproj @@ -16,7 +16,7 @@ Documentation .NET Framework 4.5 - .\Help\ + .\Output\ UmbracoClassLibrary en-US OnlyErrors @@ -38,10 +38,10 @@ Attributes, InheritedMembers, InheritedFrameworkMembers, Protected, SealedProtected - - - - + + + + None None False diff --git a/build/BuildBelle.bat b/build/BuildBelle.bat deleted file mode 100644 index bb9cfedb5b..0000000000 --- a/build/BuildBelle.bat +++ /dev/null @@ -1,32 +0,0 @@ -@ECHO OFF -ECHO Installing Npm NuGet Package - -SET nuGetFolder=%CD%\..\src\packages\ -ECHO Configured packages folder: %nuGetFolder% -ECHO Current folder: %CD% - -%CD%\..\src\.nuget\NuGet.exe install Npm.js -OutputDirectory %nuGetFolder% - -for /f "delims=" %%A in ('dir %nuGetFolder%node.js.* /b') do set "nodePath=%nuGetFolder%%%A\" -for /f "delims=" %%A in ('dir %nuGetFolder%npm.js.* /b') do set "npmPath=%nuGetFolder%%%A\tools\" - -ECHO Temporarily adding Npm and Node to path -SET oldPath=%PATH% - -path=%npmPath%;%nodePath%;%PATH% - -SET buildFolder=%CD% - -ECHO Change directory to %CD%\..\src\Umbraco.Web.UI.Client\ -CD %CD%\..\src\Umbraco.Web.UI.Client\ - -ECHO Do npm install and the grunt build of Belle -call npm install -call npm install -g grunt-cli -call grunt build - -ECHO Reset path to what it was before -path=%oldPath% - -ECHO Move back to the build folder -CD %buildFolder% \ No newline at end of file diff --git a/build/BuildDocs.ps1 b/build/BuildDocs.ps1 new file mode 100644 index 0000000000..6f46a43fde --- /dev/null +++ b/build/BuildDocs.ps1 @@ -0,0 +1,27 @@ +##We cannot continue if sandcastle is not installed determined by env variable: SHFBROOT + +if (-not (Test-Path Env:\SHFBROOT)) +{ + throw "The docs cannot be build, install Sandcastle help file builder" +} + +$PSScriptFilePath = (Get-Item $MyInvocation.MyCommand.Path).FullName +$BuildRoot = Split-Path -Path $PSScriptFilePath -Parent +$OutputPath = Join-Path -Path $BuildRoot -ChildPath "ApiDocs\Output" +$ProjFile = Join-Path -Path $BuildRoot -ChildPath "ApiDocs\csharp-api-docs.shfbproj" + +"Building docs with project file: $ProjFile" + +$MSBuild = "$Env:SYSTEMROOT\Microsoft.NET\Framework\v4.0.30319\msbuild.exe" + +# build it! +& $MSBuild "$ProjFile" + +# remove files left over +Remove-Item $BuildRoot\* -include csharp-api-docs.shfbproj_* + +# copy our custom styles in +Copy-Item $BuildRoot\ApiDocs\TOC.css $OutputPath\TOC.css + +"" +"Done!" \ No newline at end of file