FSharp.Formatting


Literate Type

This type provides three simple methods for calling the literate programming tool. The ConvertMarkdownFile and ConvertScriptFile methods process a single Markdown document and F# script, respectively. The ConvertDirectory method handles an entire directory tree (looking for *.fsx and *.md files).

Static members

Static member Description

Literate.ConvertMarkdownFile(input, ?template, ?output, ?outputKind, ?formatAgent, ?prefix, ?fscOptions, ?lineNumbers, ?references, ?substitutions, ?generateAnchors, ?rootInputFolder, ?crefResolver)

Full Usage: Literate.ConvertMarkdownFile(input, ?template, ?output, ?outputKind, ?formatAgent, ?prefix, ?fscOptions, ?lineNumbers, ?references, ?substitutions, ?generateAnchors, ?rootInputFolder, ?crefResolver)

Parameters:
    input : string
    ?template : string
    ?output : string
    ?outputKind : OutputKind
    ?formatAgent : CodeFormatAgent
    ?prefix : string
    ?fscOptions : string
    ?lineNumbers : bool
    ?references : bool
    ?substitutions : Substitutions
    ?generateAnchors : bool
    ?rootInputFolder : string
    ?crefResolver : string -> (string * string) option

Convert a markdown file into HTML or another output kind

input : string
?template : string
?output : string
?outputKind : OutputKind
?formatAgent : CodeFormatAgent
?prefix : string
?fscOptions : string
?lineNumbers : bool
?references : bool
?substitutions : Substitutions
?generateAnchors : bool
?rootInputFolder : string
?crefResolver : string -> (string * string) option

Literate.ConvertScriptFile(input, ?template, ?output, ?outputKind, ?formatAgent, ?prefix, ?fscOptions, ?lineNumbers, ?references, ?fsiEvaluator, ?substitutions, ?generateAnchors, ?rootInputFolder, ?crefResolver)

Full Usage: Literate.ConvertScriptFile(input, ?template, ?output, ?outputKind, ?formatAgent, ?prefix, ?fscOptions, ?lineNumbers, ?references, ?fsiEvaluator, ?substitutions, ?generateAnchors, ?rootInputFolder, ?crefResolver)

Parameters:
    input : string
    ?template : string
    ?output : string
    ?outputKind : OutputKind
    ?formatAgent : CodeFormatAgent
    ?prefix : string
    ?fscOptions : string
    ?lineNumbers : bool
    ?references : bool
    ?fsiEvaluator : IFsiEvaluator
    ?substitutions : Substitutions
    ?generateAnchors : bool
    ?rootInputFolder : string
    ?crefResolver : string -> (string * string) option

Convert a script file into HTML or another output kind

input : string
?template : string
?output : string
?outputKind : OutputKind
?formatAgent : CodeFormatAgent
?prefix : string
?fscOptions : string
?lineNumbers : bool
?references : bool
?fsiEvaluator : IFsiEvaluator
?substitutions : Substitutions
?generateAnchors : bool
?rootInputFolder : string
?crefResolver : string -> (string * string) option
Example

     Literate.ConvertScriptFile("script.fsx", template)

Literate.ParseAndCheckScriptFile(path, ?formatAgent, ?fscOptions, ?definedSymbols, ?references, ?fsiEvaluator, ?parseOptions, ?rootInputFolder)

Full Usage: Literate.ParseAndCheckScriptFile(path, ?formatAgent, ?fscOptions, ?definedSymbols, ?references, ?fsiEvaluator, ?parseOptions, ?rootInputFolder)

Parameters:
Returns: LiterateDocument

Parse F# Script file to LiterateDocument

path : string
?formatAgent : CodeFormatAgent
?fscOptions : string
?definedSymbols : string list
?references : bool
?fsiEvaluator : IFsiEvaluator
?parseOptions : MarkdownParseOptions
?rootInputFolder : string
Returns: LiterateDocument

Literate.ParseMarkdownFile(path, ?formatAgent, ?fscOptions, ?definedSymbols, ?references, ?fsiEvaluator, ?parseOptions, ?rootInputFolder)

Full Usage: Literate.ParseMarkdownFile(path, ?formatAgent, ?fscOptions, ?definedSymbols, ?references, ?fsiEvaluator, ?parseOptions, ?rootInputFolder)

Parameters:
    path : string -
    ?formatAgent : CodeFormatAgent -
    ?fscOptions : string -
    ?definedSymbols : string list -
    ?references : bool -
    ?fsiEvaluator : IFsiEvaluator -
    ?parseOptions : MarkdownParseOptions - Defaults to MarkdownParseOptions.AllowYamlFrontMatter
    ?rootInputFolder : string -

Returns: LiterateDocument

Parse Markdown document to LiterateDocument

path : string

?formatAgent : CodeFormatAgent

?fscOptions : string

?definedSymbols : string list

?references : bool

?fsiEvaluator : IFsiEvaluator

?parseOptions : MarkdownParseOptions

Defaults to MarkdownParseOptions.AllowYamlFrontMatter

?rootInputFolder : string

Returns: LiterateDocument

Literate.ParseMarkdownString(content, ?path, ?formatAgent, ?fscOptions, ?definedSymbols, ?references, ?fsiEvaluator, ?parseOptions, ?rootInputFolder)

Full Usage: Literate.ParseMarkdownString(content, ?path, ?formatAgent, ?fscOptions, ?definedSymbols, ?references, ?fsiEvaluator, ?parseOptions, ?rootInputFolder)

Parameters:
    content : string -
    ?path : string - optional file path for debugging purposes
    ?formatAgent : CodeFormatAgent -
    ?fscOptions : string -
    ?definedSymbols : string list -
    ?references : bool -
    ?fsiEvaluator : IFsiEvaluator -
    ?parseOptions : MarkdownParseOptions - Defaults to MarkdownParseOptions.AllowYamlFrontMatter
    ?rootInputFolder : string -

Returns: LiterateDocument

Parse string as a markdown document

content : string

?path : string

optional file path for debugging purposes

?formatAgent : CodeFormatAgent

?fscOptions : string

?definedSymbols : string list

?references : bool

?fsiEvaluator : IFsiEvaluator

?parseOptions : MarkdownParseOptions

Defaults to MarkdownParseOptions.AllowYamlFrontMatter

?rootInputFolder : string

Returns: LiterateDocument

Literate.ParseScriptString(content, ?path, ?formatAgent, ?fscOptions, ?definedSymbols, ?references, ?fsiEvaluator, ?parseOptions, ?rootInputFolder)

Full Usage: Literate.ParseScriptString(content, ?path, ?formatAgent, ?fscOptions, ?definedSymbols, ?references, ?fsiEvaluator, ?parseOptions, ?rootInputFolder)

Parameters:
Returns: LiterateDocument

Parse string as F# Script to LiterateDocument

content : string
?path : string
?formatAgent : CodeFormatAgent
?fscOptions : string
?definedSymbols : string list
?references : bool
?fsiEvaluator : IFsiEvaluator
?parseOptions : MarkdownParseOptions
?rootInputFolder : string
Returns: LiterateDocument

Literate.ToFsx(doc, ?substitutions, ?crefResolver)

Full Usage: Literate.ToFsx(doc, ?substitutions, ?crefResolver)

Parameters:
Returns: string

Formate the literate document as an .fsx script

doc : LiterateDocument
?substitutions : Substitutions
?crefResolver : string -> (string * string) option
Returns: string

Literate.ToHtml(doc, ?prefix, ?lineNumbers, ?generateAnchors, ?tokenKindToCss, ?substitutions, ?crefResolver)

Full Usage: Literate.ToHtml(doc, ?prefix, ?lineNumbers, ?generateAnchors, ?tokenKindToCss, ?substitutions, ?crefResolver)

Parameters:
    doc : LiterateDocument
    ?prefix : string
    ?lineNumbers : bool
    ?generateAnchors : bool
    ?tokenKindToCss : TokenKind -> string
    ?substitutions : (ParamKey * string) list
    ?crefResolver : string -> (string * string) option

Returns: string

Format the literate document as HTML without using a template

doc : LiterateDocument
?prefix : string
?lineNumbers : bool
?generateAnchors : bool
?tokenKindToCss : TokenKind -> string
?substitutions : (ParamKey * string) list
?crefResolver : string -> (string * string) option
Returns: string

Literate.ToLatex(doc, ?prefix, ?lineNumbers, ?generateAnchors, ?substitutions, ?crefResolver)

Full Usage: Literate.ToLatex(doc, ?prefix, ?lineNumbers, ?generateAnchors, ?substitutions, ?crefResolver)

Parameters:
    doc : LiterateDocument
    ?prefix : string
    ?lineNumbers : bool
    ?generateAnchors : bool
    ?substitutions : (ParamKey * string) list
    ?crefResolver : string -> (string * string) option

Returns: string

Format the literate document as Latex without using a template

doc : LiterateDocument
?prefix : string
?lineNumbers : bool
?generateAnchors : bool
?substitutions : (ParamKey * string) list
?crefResolver : string -> (string * string) option
Returns: string

Literate.ToPynb(doc, ?substitutions, ?crefResolver)

Full Usage: Literate.ToPynb(doc, ?substitutions, ?crefResolver)

Parameters:
Returns: string

Formate the literate document as an iPython notebook

doc : LiterateDocument
?substitutions : Substitutions
?crefResolver : string -> (string * string) option
Returns: string

Literate.TransformAndOutputDocument(doc, output, ?template, ?outputKind, ?prefix, ?lineNumbers, ?generateAnchors, ?substitutions, ?crefResolver)

Full Usage: Literate.TransformAndOutputDocument(doc, output, ?template, ?outputKind, ?prefix, ?lineNumbers, ?generateAnchors, ?substitutions, ?crefResolver)

Parameters:
    doc : LiterateDocument
    output : string
    ?template : string
    ?outputKind : OutputKind
    ?prefix : string
    ?lineNumbers : bool
    ?generateAnchors : bool
    ?substitutions : Substitutions
    ?crefResolver : string -> (string * string) option

doc : LiterateDocument
output : string
?template : string
?outputKind : OutputKind
?prefix : string
?lineNumbers : bool
?generateAnchors : bool
?substitutions : Substitutions
?crefResolver : string -> (string * string) option

Literate.WriteHtml(doc, writer, ?prefix, ?lineNumbers, ?generateAnchors, ?tokenKindToCss, ?substitutions, ?crefResolver)

Full Usage: Literate.WriteHtml(doc, writer, ?prefix, ?lineNumbers, ?generateAnchors, ?tokenKindToCss, ?substitutions, ?crefResolver)

Parameters:
    doc : LiterateDocument
    writer : TextWriter
    ?prefix : string
    ?lineNumbers : bool
    ?generateAnchors : bool
    ?tokenKindToCss : TokenKind -> string
    ?substitutions : (ParamKey * string) list
    ?crefResolver : string -> (string * string) option

Write the literate document as HTML without using a template

doc : LiterateDocument
writer : TextWriter
?prefix : string
?lineNumbers : bool
?generateAnchors : bool
?tokenKindToCss : TokenKind -> string
?substitutions : (ParamKey * string) list
?crefResolver : string -> (string * string) option

Literate.WriteLatex(doc, writer, ?prefix, ?lineNumbers, ?generateAnchors, ?substitutions, ?crefResolver)

Full Usage: Literate.WriteLatex(doc, writer, ?prefix, ?lineNumbers, ?generateAnchors, ?substitutions, ?crefResolver)

Parameters:
    doc : LiterateDocument
    writer : TextWriter
    ?prefix : string
    ?lineNumbers : bool
    ?generateAnchors : bool
    ?substitutions : (ParamKey * string) list
    ?crefResolver : string -> (string * string) option

Write the literate document as Latex without using a template

doc : LiterateDocument
writer : TextWriter
?prefix : string
?lineNumbers : bool
?generateAnchors : bool
?substitutions : (ParamKey * string) list
?crefResolver : string -> (string * string) option