Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Markdown is a popular format used to markup text and its further converting to HTML, PDF, DOCX, or other formats. Many developers choose this format for writing documentation, preparing articles for publication on blogs, describing projects, and so on.
Markdown is so popular because it is easy to work with this format, as well as it can be quite simply converted to other formats. For this reason, Aspose.Words provides the ability to convert a document in any supported load format to Markdown and vice versa – Aspose.Words also supports most popular save formats.
Now the functionality for working with the Markdown format is being actively developed to provide you with more opportunities for convenient and comfortable work with documents.
To convert a document to Markdown, you just need to load a document in any supported format or create a new one programmatically. Then you need to save the document to Markdown format.
The following code example shows how to convert DOCX to Markdown:
You can also specify the physical folder in which you want to save images when exporting a document to Markdown format. By default, Aspose.Words saves images in the same folder where the document file is saved, but you can override this behavior using the images_folder property.
Specifying a folder via images_folder is also useful if you save a document to a stream and Aspose.Words does not have a folder for saving images.
If the specified images_folder does not exist, it will be created automatically.
The following code example shows how to specify a folder for images when saving a document to a stream:
Aspose.Words provides the ability to use the MarkdownSaveOptions class to work with advanced options when saving a document to Markdown format. Most properties are inheriting or overloading properties that already exist within other aspose.words.saving classes. In addition to them, a number of properties that are specific for Markdown format have also been added. For example, the table_content_alignment property to control the alignment of content in tables, or images_folder to control where images are saved upon converting a document to Markdown format.
Aspose.Words currently supports the following Markdown features, which mostly follow the CommonMark
specification in the Aspose.Words API and are represented as appropriate styles or direct formatting:
Font
style nameHorizontalRule
shapeThe following example shows how to create a document with some styles and save it to Markdown:
The result of this code example is shown below.
There are several nuances and interesting cases, having learned which you can work with Markdown files more flexibly and conveniently. For example, there is the ability to use:
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.