Skip to content

Commit

Permalink
Documentation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustavo Guerra committed Nov 1, 2014
1 parent 0d65e17 commit 0c286aa
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 8 deletions.
2 changes: 1 addition & 1 deletion build.cmd
Expand Up @@ -4,7 +4,7 @@ if errorlevel 1 (
exit /b %errorlevel%
)

.paket\paket.exe restore -v
.paket\paket.exe restore
if errorlevel 1 (
exit /b %errorlevel%
)
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Expand Up @@ -5,7 +5,7 @@ if [ $exit_code -ne 0 ]; then
exit $exit_code
fi

mono .paket/paket.exe restore -v
mono .paket/paket.exe restore
exit_code=$?
if [ $exit_code -ne 0 ]; then
exit $exit_code
Expand Down
2 changes: 1 addition & 1 deletion docs/tools/generate.fsx
Expand Up @@ -139,5 +139,5 @@ let buildDocumentation () =

// Generate
copyFiles()
buildReference()
buildDocumentation()
buildReference()
5 changes: 4 additions & 1 deletion src/Csv/CsvExtensions.fs
Expand Up @@ -10,6 +10,7 @@ open FSharp.Data
open FSharp.Data.Runtime

[<Extension>]
/// Extension methods on strings for conversions to other types
type StringExtensions =

[<Extension>]
Expand Down Expand Up @@ -62,6 +63,8 @@ type StringExtensions =
| _ -> failwithf "Not a guid: %s" x

[<CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
/// Provides the dynamic operator for getting column values by name from CSV rows
module CsvExtensions =
/// Get column of a CsvRow

/// Get the value of a column by name from a CSV row
let (?) (csvRow:CsvRow) (columnName:string) = csvRow.[columnName]
8 changes: 8 additions & 0 deletions src/Html/HtmlOperations.fs
Expand Up @@ -13,6 +13,7 @@ module private Utils =
// --------------------------------------------------------------------------------------

[<CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
/// Operations on HTML attributes
module HtmlAttribute =

/// Gets the name of the given attribute
Expand All @@ -28,6 +29,7 @@ module HtmlAttribute =
// --------------------------------------------------------------------------------------

[<Extension>]
/// Extension methods on HTML attributes
type HtmlAttributeExtensions =

/// Gets the name of the current attribute
Expand All @@ -43,6 +45,7 @@ type HtmlAttributeExtensions =
// --------------------------------------------------------------------------------------

[<CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
/// Operations on HTML nodes
module HtmlNode =

/// Gets the given nodes name
Expand Down Expand Up @@ -238,6 +241,7 @@ module HtmlNode =
// --------------------------------------------------------------------------------------

[<Extension>]
/// Extension methods on HTML nodes
type HtmlNodeExtensions =

/// Gets the given nodes name
Expand Down Expand Up @@ -573,6 +577,7 @@ type HtmlNodeExtensions =
// --------------------------------------------------------------------------------------

[<CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
// Operations on HTML documents
module HtmlDocument =

/// Returns the doctype of the document
Expand Down Expand Up @@ -645,6 +650,7 @@ module HtmlDocument =
| body:: _ -> Some body

[<Extension>]
/// Extension methods on HTML documents
type HtmlDocumentExtensions =

/// Returns all of the root elements of the current document
Expand Down Expand Up @@ -801,7 +807,9 @@ type HtmlDocumentExtensions =
// --------------------------------------------------------------------------------------

[<CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
/// Provides the dynamic operator for getting attribute values from HTML elements
module HtmlExtensions =

/// Gets the value of an attribute from an HTML element
let (?) (node : HtmlNode) name =
HtmlNode.attributeValue name node
3 changes: 3 additions & 0 deletions src/Html/HtmlParser.fs
Expand Up @@ -11,6 +11,7 @@ open FSharp.Data.Runtime

// --------------------------------------------------------------------------------------

/// Represents an HTML attribute. The name is always normalized to lowercase
type HtmlAttribute =

private | HtmlAttribute of name:string * value:string
Expand All @@ -24,6 +25,7 @@ type HtmlAttribute =
HtmlAttribute(name.ToLowerInvariant(), value)

[<StructuredFormatDisplay("{_Print}")>]
/// Represents an HTML node. The names of elements are always normalized to lowercase
type HtmlNode =

private | HtmlElement of name:string * attributes:HtmlAttribute list * elements:HtmlNode list
Expand Down Expand Up @@ -132,6 +134,7 @@ type HtmlNode =
member x._Print = x.ToString()

[<StructuredFormatDisplay("{_Print}")>]
/// Represents an HTML document
type HtmlDocument =
private | HtmlDocument of docType:string * elements:HtmlNode list

Expand Down
14 changes: 11 additions & 3 deletions src/Html/HtmlRuntime.fs
Expand Up @@ -15,6 +15,7 @@ open FSharp.Data.Runtime.StructuralTypes

// --------------------------------------------------------------------------------------

/// Representation of an HTML table cell
type HtmlTableCell =
| Cell of bool * string
| Empty
Expand All @@ -27,6 +28,7 @@ type HtmlTableCell =
| Empty -> ""
| Cell(_, d) -> d

/// Representation of an HTML table cell
type HtmlTable =
{ Name : string
HeaderNamesAndUnits : (string * Type option)[] option // always set at designtime, never at runtime
Expand All @@ -50,16 +52,19 @@ type HtmlTable =
wr.WriteLine()
sb.ToString()

/// Representation of an HTML list
type HtmlList =
{ Name : string
Values : string[]
Html : HtmlNode }

/// Representation of an HTML definition list
type HtmlDefinitionList =
{ Name : string
Definitions : HtmlList list
Html : HtmlNode }

/// Representation of an HTML table, list, or definition list
type HtmlObject =
| Table of HtmlTable
| List of HtmlList
Expand Down Expand Up @@ -273,6 +278,7 @@ module HtmlRuntime =
@ (doc |> getLists |> List.map List)
@ (doc |> getDefinitionLists |> List.map DefinitionList)

/// Underlying representation of the root types generated by HtmlProvider
type TypedHtmlDocument internal (doc:HtmlDocument, htmlObjects:Map<string,HtmlObject>) =

member __.Html = doc
Expand All @@ -297,6 +303,7 @@ type TypedHtmlDocument internal (doc:HtmlDocument, htmlObjects:Map<string,HtmlOb
member __.GetObject(id:string) =
htmlObjects |> Map.find id

/// Underlying representation of table types generated by HtmlProvider
type HtmlTable<'rowType> internal (name:string, headers:string[] option, values:'rowType[], html:HtmlNode) =

member __.Name = name
Expand All @@ -318,22 +325,23 @@ type HtmlTable<'rowType> internal (name:string, headers:string[] option, values:
HtmlTable<_>(table.Name, headers, Array.map rowConverter.Invoke rows, table.Html)
| _ -> failwithf "Element %s is not a table" id

type HtmlList<'itemType> internal (name:string, values:'itemType[], html) =
/// Underlying representation of list types generated by HtmlProvider
type HtmlList<'ItemType> internal (name:string, values:'ItemType[], html) =

member __.Name = name
member __.Values = values
member __.Html = html

[<EditorBrowsableAttribute(EditorBrowsableState.Never)>]
[<CompilerMessageAttribute("This method is intended for use in generated code only.", 10001, IsHidden=true, IsError=false)>]
static member Create(rowConverter:Func<string,'itemType>, doc:TypedHtmlDocument, id:string) =
static member Create(rowConverter:Func<string,'ItemType>, doc:TypedHtmlDocument, id:string) =
match doc.GetObject id with
| List list -> HtmlList<_>(list.Name, Array.map rowConverter.Invoke list.Values, list.Html)
| _ -> failwithf "Element %s is not a list" id

[<EditorBrowsableAttribute(EditorBrowsableState.Never)>]
[<CompilerMessageAttribute("This method is intended for use in generated code only.", 10001, IsHidden=true, IsError=false)>]
static member CreateNested(rowConverter:Func<string,'itemType>, doc:TypedHtmlDocument, id:string, index:int) =
static member CreateNested(rowConverter:Func<string,'ItemType>, doc:TypedHtmlDocument, id:string, index:int) =
let list =
match doc.GetObject id with
| List list-> list
Expand Down
5 changes: 4 additions & 1 deletion src/Json/JsonExtensions.fs
Expand Up @@ -12,6 +12,7 @@ open FSharp.Data.Runtime
open Microsoft.FSharp.Core

[<Extension>]
/// Extension methods on JSON values
type JsonExtensions =

/// Get a sequence of key-value pairs representing the properties of an object
Expand Down Expand Up @@ -135,8 +136,10 @@ type JsonExtensions =
| None -> JsonExtensions.AsArray(x) |> Array.map (fun e -> JsonExtensions.InnerText(e)) |> String.Concat

[<CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
/// Provides the dynamic operator for getting a property of a JSON object
module JsonExtensions =
/// Get property of a JSON object (assuming that the value is an object)

/// Get a property of a JSON object
let (?) (jsonObject:JsonValue) propertyName = jsonObject.GetProperty(propertyName)

type JsonValue with
Expand Down
1 change: 1 addition & 0 deletions src/Net/Http.fs
Expand Up @@ -274,6 +274,7 @@ module HttpContentTypes =

type private HeaderEnum = System.Net.HttpRequestHeader

/// Constants for common HTTP encodings
module HttpEncodings =

let PostDefaultEncoding = Encoding.GetEncoding("ISO-8859-1") // http://stackoverflow.com/questions/708915/detecting-the-character-encoding-of-an-http-post-request/708942#708942
Expand Down

0 comments on commit 0c286aa

Please sign in to comment.