Markdown Api
QnA Maker stores answer text as markdown. There are many flavors of markdown. In order to make sure the answer text is returned and displayed correctly, use this reference.
What is Markdown? Markdown is a way to style text on the web. You control the display of the document; formatting words as bold or italic, adding images, and creating lists are just a few of the things we can do with Markdown. Mostly, Markdown is just regular text with a. It is a Javascript based diagramming and charting tool that renders Markdown-inspired text definitions to create and modify diagrams dynamically. If you are familiar with Markdown you should have no. Dillinger is an online cloud based HTML5 filled Markdown Editor. Sync with Dropbox, Github, Google Drive or OneDrive. Convert HTML to Markdown. 100% Open Source!
Var md = require ('markdown-it'); var result = md.renderInline('markdown-it rulezz!' ); Init with presets and options (.) presets define combinations of active rules and options. Can be 'commonmark', 'zero' or 'default' (if skipped). See API docs for more details. The Markdown Guide API provides a subset of documentation from the Markdown Guide in JSON format. We hope that software developers and organizations use this API to programmatically consume our documentation and display it in applications and on websites.
Use the CommonMark tutorial to validate your Markdown. The tutorial has a Try it feature for quick copy/paste validation.
Github Markdown Api
When to use rich-text editing versus markdown
Rich-text editing of answers allows you, as the author, to use a formatting toolbar to quickly select and format text.
Markdown is a better tool when you need to autogenerate content to create knowledge bases to be imported as part of a CI/CD pipeline or for batch testing.
Supported markdown format
Following is the list of markdown formats that you can use in QnA Maker's answer text.
Purpose | Format | Example markdown | Rendering as displayed in Chat bot |
---|---|---|---|
A new line between 2 sentences. | nn | How can I create a bot with nn QnA Maker? | |
Headers from h1 to h6, the number of # denotes which header. 1 # is the h1. | n# text n## text n### text n####text n#####text | ## Creating a bot n ..text.. n### Important newsn ..text.. n### Related Informationn ..text.. n# my h1 n## my h2n### my h3 n#### my h4 n##### my h5 | |
Italics | *text* | How do I create a bot with *QnA Maker*? | |
Strong (bold) | **text** | How do I create a bot with **QnA Maker**? | |
URL for link | [text](https://www.my.com) | How do I create a bot with [QnA Maker](https://www.qnamaker.ai)? | |
*URL for public image | ![text](https://www.my.com/image.png) | How can I create a bot with ![QnAMaker](https://review.docs.microsoft.com/azure/cognitive-services/qnamaker/media/qnamaker-how-to-key-management/qnamaker-resource-list.png) | |
Strikethrough | ~~text~~ | some ~~questoins~~ questions need to be asked | |
Bold and italics | ***text*** | How can I create a ***QnA Maker*** bot? | |
Bold URL for link | [**text**](https://www.my.com) | How do I create a bot with [**QnA Maker**](https://www.qnamaker.ai)? | |
Italics URL for link | [*text*](https://www.my.com) | How do I create a bot with [*QnA Maker*](https://www.qnamaker.ai)? | |
Escape markdown symbols | *text* | How do I create a bot with *QnA Maker*? | |
Ordered list | n 1. item1 n 1. item2 | This is an ordered list: n 1. List item 1 n 1. List item 2 The preceding example uses automatic numbering built into markdown. This is an ordered list: n 1. List item 1 n 2. List item 2 The preceding example uses explicit numbering. | |
Unordered list | n * item1 n * item2 or n - item1 n - item2 | This is an unordered list: n * List item 1 n * List item 2 | |
Nested lists | n * Parent1 nt * Child1 nt * Child2 n * Parent2 n * Parent1 nt 1. Child1 nt * Child2 n 1. Parent2 You can nest ordered and unordered lists together. The tab, t , indicates the indentation level of the child element. | This is an unordered list: n * List item 1 nt * Child1 nt * Child2 n * List item 2 This is an ordered nested list: n 1. Parent1 nt 1. Child1 nt 1. Child2 n 1. Parent2 |
*QnA Maker doesn't process the image in any way. It is the client application's role to render the image. Latest catalina os.
If you want to add content using update/replace knowledge base APIs and the content/file contains html tags, you can preserve the HTML in your file by ensuring that opening and closing of the tags are converted in the encoded format.
Markdown Api Doc
Preserve HTML | Representation in the API request | Representation in KB |
---|---|---|
Yes | <br> | <br> |
Yes | <h3>header</h3> | <h3>header</h3> |
Additionally, CR LF(rn) are converted to n in the KB. LF(n) is kept as is. If you want to escape any escape sequence like a t or n you can use backslash, for example: 'rn' and 't'
Next steps
Review batch testing file formats.