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
writerTextWriterWhere the text goes. It is not closed.
optionsXlsxMarkdownOptionsHow 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
writeris null.- InvalidOperationException
The sheet is not a worksheet.
- ResourceLimitExceededException
The range covers more cells than MaxCells.
- InvalidDocumentException
The sheet's part is malformed.