C# Класс Docnet.Utils

Показать файл Открыть проект

Открытые методы

Метод Описание
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.

Описание методов

ConvertMarkdownToHtml() публичный статический Метод

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.
Результат string

CreateFoldersIfRequired() публичный статический Метод

Creates the folders in the path specified if they don't exist, recursively
public static CreateFoldersIfRequired ( string fullPath ) : void
fullPath string The full path.
Результат void

DirectoryCopy() публичный статический Метод

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.
Результат void

IncludeProcessor() публичный статический Метод

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)
Результат string

MakeAbsolutePath() публичный статический Метод

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.
Результат string

MakeRelativePath() публичный статический Метод

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.
Результат string

MakeRelativePathForUri() публичный статический Метод

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.
Результат string