Class FileSaver

Reusable functions to save various files to disk with prompts and save UI operations.

System.Object
  MarkdownMonster.Utilities.FileSaver
public class FileSaver : object

Class Members

MemberDescription

Constructor

GetMarkdownSaveFilename

Gets a Markdown Save file name

public static string GetMarkdownSaveFilename(string filename,     string folder)

OpenMarkdownDocumentFromUrl

Tries to retrieve Markdown Content from the specified URL. Attempts to fix up URLs for things like master/main and various combinations of README.md

public MarkdownDocument OpenMarkdownDocumentFromUrl(ref string url)

ParseMarkdownSafeTitle

Attempts to parse a title from a Markdown document by looking at YAML title header or the first # markdown tag

public static string ParseMarkdownSafeTitle(string markdown)

ParseMarkdownTitle

Attempts to parse a title from a Markdown document by looking at YAML title header or the first # markdown tag

public static string ParseMarkdownTitle(string markdown)

ParseMarkdownUrl

Tries to fix up Markdown files for common doc and server platforms like Github, Gists, BitBucket and a few others

public static string ParseMarkdownUrl(string url)

SaveBitmapAndLinkInEditor

Saves a bitmap image to file using a standard mechanism that prompts for a filename (unless you pass one in), optionally compresses the file and by default embeds a link at cursor position.

Overrides let you remove some of these tasks.

The method returns the embedded image path - a relative path if possible.

public static Task SaveBitmapAndLinkInEditor(Bitmap bitmap,     MarkdownDocumentEditor editor,     string imageFilename,     bool noImageCompression,     bool noEditorEmbedding)

SaveMarkdownDocumentToFile

Saves a Markdown Document to file with Save UI.

public static Task SaveMarkdownDocumentToFile(MarkdownDocument doc,     bool saveAsEncrypted)

SaveMarkdownFileFromUrl

Saves a markdown document captured from a URL to a file prompting for a filename to save to

public static Task SaveMarkdownFileFromUrl(string url)

Requirements

Namespace: MarkdownMonster.Utilities
Assembly: markdownmonster.exe

© West Wind Technologies, 1996-2021 • Updated: 11/23/21
Comment or report problem with topic