An efficient and customizable content management system, AnQi CMS has always been committed to providing modern and convenient solutions for content creation and display.For many content creators, Markdown has become an indispensable tool for daily writing with its concise and efficient features.Does the Anqi CMS support Markdown formatted text and render it as HTML to display normally on the front-end page?The answer is affirmative, the AnQi CMS provides comprehensive support for Markdown, and has a high degree of integration, making it very smooth to use.
Firstly, to make the security CMS recognize and process Markdown formatted content, you need to simply set it up in the backend. Just enter the system'sGlobal Settings,foundContent SettingsOption, and then enable Markdown editor here.Once this option is activated, the system will parse the content you enter using Markdown syntax.
Once the Markdown editor is enabled, you can enjoy the convenience it brings in multiple core content types. This includes but is not limited to:
- Article Details (Archive)In writing blog posts, news articles, or product introductions, Markdown can be used for formatting.
- Category: Add detailed introduction for content categories, which also supports Markdown format.
- Page:Create independent pages such as "About Us" and "Contact Us", Markdown can help you quickly build the page structure.
- Tag content (Tag)To add rich descriptions to tags (Tag), making them more informative.
The Markdown rendering mechanism of Anqi CMS is both intelligent and flexible. When you enable the Markdown editor in the background and use sucharchiveDetail/categoryDetail/pageDetail/tagDetailWhen outputting tags, the system will automatically parse and render Markdown text into standard HTML format without the need for additional manual conversion steps.This means that when users visit the page on the front end, they see beautifully formatted and well-structured HTML content.
However, the AnQi CMS also provides high flexibility, allowing you to perform fine-grained control in template files. For example, in content output tags,archiveDetailofContentfields, you can explicitlyrenderParameter to control whether to convert Markdown to HTML. For example,{% archiveDetail articleContent with name="Content" render=true %}{{articleContent|safe}}will force theContentThe Markdown content of the field is rendered as HTML. And if you set it torender=falseIf so, the system will not render and will directly output the original Markdown text.This manual control option provides great convenience for users who need to display original Markdown code in specific scenarios or integrate custom frontend rendering libraries.|safeFilter.
It is even more exciting that, AnQi CMS not only supports Markdown in basic text formatting, but also extends to supportMathematical formulaandFlowchartThe rendering.If you include mathematical expressions or Mermaid syntax flowcharts in your Markdown content, AnQi CMS can also recognize them.However, the implementation of this advanced feature on the front-end relies on third-party JavaScript libraries for rendering, such as MathJax for mathematical formulas, and Mermaid.js for flowcharts.base.htmlIn order to ensure that these advanced contents are displayed normally on the front-end page, the corresponding CDN resource links need to be introduced.The system documentation provides detailed code examples to facilitate quick configuration by the user.
In summary, AnQi CMS provides a powerful and flexible Markdown writing environment for content creators.It simplifies the conversion process from Markdown to HTML, allowing you to focus on the essence of the content, while also meeting the diverse needs of content display through advanced features and control at the template level.
Common Questions (FAQ)
Markdown content is not rendered as HTML on the front end, how can I investigate?Firstly, make sure that you have enabled the Markdown editor in the "Global Settings" -> "Content Settings" of the Anqi CMS backend.其次,检查您的模板代码。
archiveDetailsuch as content output tags, and the content is not rendered automatically, please confirm whether you have addedrender=falseParameter, this will prevent the content from being automatically rendered. Remove or set it torender=true, and ensure that the content is output using|safeFilter.The Markdown feature of Anqi CMS supports which text input boxes?Markdown mainly supports the use of rich text editing areas such as "content" or "description" in content models (such as articles, products), categories, single pages, and tags.For some simple titles, keywords, etc. single-line text input boxes, Markdown syntax will not be parsed.You can determine whether the current input box supports Markdown by checking the style of the backend editor.
How do I customize the style of Markdown rendering?Markdown rendered content is essentially HTML, therefore you can write custom CSS styles to beautify them. For example, for Markdown generated
<h1>/<h2>/<ul>/<li>Define styles for tags.If you have used advanced features such as mathematical formulas or flowcharts, you can also refer to examples of introducing CDN resources in the system documentation, and may need to adjust the configuration of MathJax or Mermaid.js to match your website theme style.