Table of Contents

Method ToMarkdown

Namespace
DocWright.Spreadsheet
Assembly
DocWright.Spreadsheet.dll

ToMarkdown(TextWriter, XlsxMarkdownOptions?)

Writes the sheet as a Markdown table (the pipe table of GitHub Flavored Markdown).

public void ToMarkdown(TextWriter writer, XlsxMarkdownOptions? options = null)

Parameters

writer TextWriter

Where the text goes. It is not closed.

options XlsxMarkdownOptions

How to write, or null for the defaults: the first row is the heading.

Remarks

Each cell is the text it shows (DisplayText). A vertical bar and a backslash are written with a backslash in front, and a line break inside a cell as <br>, since a table row is one line; FromMarkdownTable(TextReader) reads all three back. Other Markdown in a cell's text is left as it is. Lines end in a line feed. A sheet that holds nothing writes nothing.

Exceptions

ArgumentNullException

writer is null.

InvalidOperationException

The sheet is not a worksheet.

ResourceLimitExceededException

The range covers more cells than MaxCells.

InvalidDocumentException

The sheet's part is malformed.