Header menu logo 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, ?prefix, ?fscOptions, ?lineNumbers, ?references, ?substitutions, ?generateAnchors, ?imageSaver, ?rootInputFolder, ?crefResolver, ?mdlinkResolver, ?onError, ?filesWithFrontMatter)

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

Parameters:
    input : string
    ?template : string
    ?output : string
    ?outputKind : OutputKind
    ?prefix : string
    ?fscOptions : string
    ?lineNumbers : bool
    ?references : bool
    ?substitutions : (ParamKey * string) list
    ?generateAnchors : bool
    ?imageSaver : string -> string
    ?rootInputFolder : string
    ?crefResolver : string -> (string * string) option
    ?mdlinkResolver : string -> string option
    ?onError : string -> unit
    ?filesWithFrontMatter : FrontMatterFile array

Convert a markdown file into HTML or another output kind

input : string
?template : string
?output : string
?outputKind : OutputKind
?prefix : string
?fscOptions : string
?lineNumbers : bool
?references : bool
?substitutions : (ParamKey * string) list
?generateAnchors : bool
?imageSaver : string -> string
?rootInputFolder : string
?crefResolver : string -> (string * string) option
?mdlinkResolver : string -> string option
?onError : string -> unit
?filesWithFrontMatter : FrontMatterFile array

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

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

Parameters:
    input : string
    ?template : string
    ?output : string
    ?outputKind : OutputKind
    ?prefix : string
    ?fscOptions : string
    ?lineNumbers : bool
    ?references : bool
    ?fsiEvaluator : IFsiEvaluator
    ?substitutions : (ParamKey * string) list
    ?generateAnchors : bool
    ?imageSaver : string -> string
    ?rootInputFolder : string
    ?crefResolver : string -> (string * string) option
    ?mdlinkResolver : string -> string option
    ?onError : string -> unit
    ?filesWithFrontMatter : FrontMatterFile array

Convert a script file into HTML or another output kind

input : string
?template : string
?output : string
?outputKind : OutputKind
?prefix : string
?fscOptions : string
?lineNumbers : bool
?references : bool
?fsiEvaluator : IFsiEvaluator
?substitutions : (ParamKey * string) list
?generateAnchors : bool
?imageSaver : string -> string
?rootInputFolder : string
?crefResolver : string -> (string * string) option
?mdlinkResolver : string -> string option
?onError : string -> unit
?filesWithFrontMatter : FrontMatterFile array
Example

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

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

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

Parameters:
    path : string
    ?fscOptions : string
    ?definedSymbols : string list
    ?references : bool
    ?fsiEvaluator : IFsiEvaluator
    ?parseOptions : MarkdownParseOptions
    ?rootInputFolder : string
    ?onError : string -> unit

Returns: LiterateDocument

Parse F# Script file to LiterateDocument

path : string
?fscOptions : string
?definedSymbols : string list
?references : bool
?fsiEvaluator : IFsiEvaluator
?parseOptions : MarkdownParseOptions
?rootInputFolder : string
?onError : string -> unit
Returns: LiterateDocument

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

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

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

Returns: LiterateDocument

Parse Markdown document to LiterateDocument

path : string

?fscOptions : string

?definedSymbols : string list

?references : bool

?fsiEvaluator : IFsiEvaluator

?parseOptions : MarkdownParseOptions

Defaults to MarkdownParseOptions.AllowYamlFrontMatter

?rootInputFolder : string

?onError : string -> unit

Returns: LiterateDocument

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

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

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

Returns: LiterateDocument

Parse string as a markdown document

content : string

?path : string

optional file path for debugging purposes

?fscOptions : string

?definedSymbols : string list

?references : bool

?fsiEvaluator : IFsiEvaluator

?parseOptions : MarkdownParseOptions

Defaults to MarkdownParseOptions.AllowYamlFrontMatter

?rootInputFolder : string

?onError : string -> unit

Returns: LiterateDocument

Literate.ParsePynbString(content, ?path, ?definedSymbols, ?references, ?parseOptions, ?rootInputFolder, ?onError)

Full Usage: Literate.ParsePynbString(content, ?path, ?definedSymbols, ?references, ?parseOptions, ?rootInputFolder, ?onError)

Parameters:
    content : string -
    ?path : string - optional file path for debugging purposes
    ?definedSymbols : string list -
    ?references : bool -
    ?parseOptions : MarkdownParseOptions - Defaults to MarkdownParseOptions.AllowYamlFrontMatter
    ?rootInputFolder : string -
    ?onError : string -> unit -

Returns: LiterateDocument

Parse pynb string as literate document

content : string

?path : string

optional file path for debugging purposes

?definedSymbols : string list

?references : bool

?parseOptions : MarkdownParseOptions

Defaults to MarkdownParseOptions.AllowYamlFrontMatter

?rootInputFolder : string

?onError : string -> unit

Returns: LiterateDocument

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

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

Parameters:
    content : string
    ?path : string
    ?fscOptions : string
    ?definedSymbols : string list
    ?references : bool
    ?fsiEvaluator : IFsiEvaluator
    ?parseOptions : MarkdownParseOptions
    ?rootInputFolder : string
    ?onError : string -> unit

Returns: LiterateDocument

Parse string as F# Script to LiterateDocument

content : string
?path : string
?fscOptions : string
?definedSymbols : string list
?references : bool
?fsiEvaluator : IFsiEvaluator
?parseOptions : MarkdownParseOptions
?rootInputFolder : string
?onError : string -> unit
Returns: LiterateDocument

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

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

Parameters:
    doc : LiterateDocument
    ?substitutions : (ParamKey * string) list
    ?crefResolver : string -> (string * string) option
    ?mdlinkResolver : string -> string option

Returns: string

Formate the literate document as an .fsx script

doc : LiterateDocument
?substitutions : (ParamKey * string) list
?crefResolver : string -> (string * string) option
?mdlinkResolver : string -> string option
Returns: string

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

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

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

Returns: string

Format the literate document as HTML without using a template

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

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

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

Parameters:
    doc : LiterateDocument
    ?prefix : string
    ?lineNumbers : bool
    ?generateAnchors : bool
    ?substitutions : (ParamKey * string) list
    ?crefResolver : string -> (string * string) option
    ?mdlinkResolver : 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
?mdlinkResolver : string -> string option
Returns: string

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

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

Parameters:
    doc : LiterateDocument
    ?substitutions : (ParamKey * string) list
    ?crefResolver : string -> (string * string) option
    ?mdlinkResolver : string -> string option

Returns: string

Formate the literate document as an iPython notebook

doc : LiterateDocument
?substitutions : (ParamKey * string) list
?crefResolver : string -> (string * string) option
?mdlinkResolver : string -> string option
Returns: string

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

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

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

Write the literate document as HTML without using a template

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

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

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

Parameters:
    doc : LiterateDocument
    writer : TextWriter
    ?prefix : string
    ?lineNumbers : bool
    ?generateAnchors : bool
    ?substitutions : (ParamKey * string) list
    ?crefResolver : string -> (string * string) option
    ?mdlinkResolver : 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
?mdlinkResolver : string -> string option

Type something to start searching.