C# Class Docnet.Utils

Exibir arquivo Open project: FransBouma/DocNet

Public Methods

Method Description
ConvertMarkdownToHtml ( string toConvert, string destinationDocumentPath, string siteRoot, string sourceDocumentFilename, string>.List createdAnchorCollector ) : string

Converts the markdown to HTML.

CreateFoldersIfRequired ( string fullPath ) : void

Creates the folders in the path specified if they don't exist, recursively

DirectoryCopy ( string sourceFolderName, string destinationFolderName, bool copySubFolders ) : void

Copies directories and files, eventually recursively. From MSDN.

IncludeProcessor ( String content, string includeFolder ) : string

Process the input for @@include tags and embeds the included content into the output.

MakeAbsolutePath ( string rootPath, string toMakeAbsolute ) : string

Makes toMakeAbsolute an absolute path, if it's not already a rooted path. If it's not a rooted path it's assumed it's relative to rootPath and is combined with that.

MakeRelativePath ( string fromPath, string toPath ) : string

Creates a relative path to get from fromPath to toPath. If one of them is empty, the emptystring is returned. If there's no common path, toPath is returned.

Only works with file paths, which is ok, as it's used to create the {{Path}} macro.

MakeRelativePathForUri ( string fromPath, string toPath ) : string

As MakeRelativePath but it also converts '\' to '/'.

Only works with file paths, which is ok, as it's used to create the {{Path}} macro.

Method Details

ConvertMarkdownToHtml() public static method

Converts the markdown to HTML.
public static ConvertMarkdownToHtml ( string toConvert, string destinationDocumentPath, string siteRoot, string sourceDocumentFilename, string>.List createdAnchorCollector ) : string
toConvert string The markdown string to convert.
destinationDocumentPath string The document path (without the document filename).
siteRoot string The site root.
sourceDocumentFilename string the filename of the source markdown file
createdAnchorCollector string>.List The created anchor collector, for ToC sublinks for H2 headers.
return string

CreateFoldersIfRequired() public static method

Creates the folders in the path specified if they don't exist, recursively
public static CreateFoldersIfRequired ( string fullPath ) : void
fullPath string The full path.
return void

DirectoryCopy() public static method

Copies directories and files, eventually recursively. From MSDN.
public static DirectoryCopy ( string sourceFolderName, string destinationFolderName, bool copySubFolders ) : void
sourceFolderName string Name of the source dir.
destinationFolderName string Name of the dest dir.
copySubFolders bool if set to true it will recursively copy files/folders.
return void

IncludeProcessor() public static method

Process the input for @@include tags and embeds the included content into the output.
public static IncludeProcessor ( String content, string includeFolder ) : string
content String content to be scanned for include tags
includeFolder string Directory containing the include files (absolute folder)
return string

MakeAbsolutePath() public static method

Makes toMakeAbsolute an absolute path, if it's not already a rooted path. If it's not a rooted path it's assumed it's relative to rootPath and is combined with that.
public static MakeAbsolutePath ( string rootPath, string toMakeAbsolute ) : string
rootPath string The root path.
toMakeAbsolute string To make absolute.
return string

MakeRelativePath() public static method

Creates a relative path to get from fromPath to toPath. If one of them is empty, the emptystring is returned. If there's no common path, toPath is returned.
Only works with file paths, which is ok, as it's used to create the {{Path}} macro.
public static MakeRelativePath ( string fromPath, string toPath ) : string
fromPath string From path.
toPath string To path.
return string

MakeRelativePathForUri() public static method

As MakeRelativePath but it also converts '\' to '/'.
Only works with file paths, which is ok, as it's used to create the {{Path}} macro.
public static MakeRelativePathForUri ( string fromPath, string toPath ) : string
fromPath string From path.
toPath string To path.
return string