As a website content expert who deeply understands the operation of AnQin CMS, I am well aware of the importance of content creation efficiency and presentation quality to user experience.The advantages of Anqi CMS in content management are largely due to its excellent support for Markdown syntax, which brings us great convenience and flexibility.
The Anqi CMS integrates the Markdown editor deeply, committed to providing content creators with an efficient, flexible, and feature-rich writing environment.This integration enables us to quickly build structured content using a concise markup language, while ensuring professional and readable page effects on the frontend.
Enable Markdown Editor
The first step in content creation using Markdown in AnQi CMS is to activate its built-in Markdown editor.Website operators or content administrators can easily enable this feature by accessing the backend management interface.Global Settings -> Content Settings.On this page, you can find the corresponding options to toggle the Markdown editor's on/off status.Once the editor is enabled, content creators can directly use Markdown syntax for formatting in the content editing areas of modules such as articles, products, pages, and tags.
Core Markdown syntax elements
The Markdown editor of AnQi CMS supports a wide range of basic Markdown syntax elements, making content creation intuitive and efficient. Users can easily use headings (#), bold (*"),)、italic()、list(- or 1.)、link()、image()、code block(”)以及引用(>)等常用标记来组织和美化内容。这种对标准Markdown语法的支持,确保了内容在不同平台间具备良好的一致性和可移植性,同时也提升了编辑效率。鉴于系统文档中提及可通过引入github-markdown-css`to apply the default styles, which means AnQiCMS aims to provide a visual experience similar to GitHub's Markdown style during frontend rendering, covering most commonly used functions of standard Markdown.
Enhanced Markdown features: Mathematical formulas and flowcharts
In addition to basic syntax, Anqi CMS also provides support for advanced Markdown features, especially the integration of mathematical formulas and flowcharts.This is an extremely useful feature for websites that need to display complex scientific expressions, technical documents, or business processes.
For the presentation of mathematical formulas, Anqi CMS uses the third-party library MathJax. To correctly display mathematical formulas written in Markdown on the front-end page, you need to add the relevant code in the header of the template file, for example,base.htmlIn the file, introduce the CDN resources of MathJax.Once introduced, MathJax can automatically parse LaTeX syntax in Markdown content and render it as clear and professional mathematical expressions.
Similarly, for the drawing of visual content such as flowcharts, sequence diagrams, etc., AnqiCMS integrates Mermaid.Through Mermaid, users can directly describe graphics in text form within Markdown content and have them automatically rendered as graphical displays on the front-end page.base.htmlInclude the CDN resources and initialization script of Mermaid in the public header files to ensure that Mermaid can correctly identify and render the Markdown code blocks during page loading.
Template-level rendering control
The Anqi CMS provides fine control over the flexibility of content display, even when the Markdown editor is enabled. In template tags such asarchiveDetail/categoryDetail/pageDetailandtagDetailChinese, content field (such asContent) can be manually controlled by addingrenderparameters to convert Markdown to HTML.render=truewill force the conversion, andrender=falseIt will prevent the conversion.This means that website operators can decide whether to render Markdown content as HTML based on specific page design or content requirements, thus achieving a more customized content display effect.For scenarios that require the original Markdown text to be displayed exactly, or for special cases that require custom HTML rendering logic, this feature provides the necessary flexibility.
Common Questions and Answers (FAQ)
1. How to enable Markdown editor in AnQi CMS?You can enable the Markdown editor feature by navigating to the 'Global Settings' in the Anqi CMS backend management interface and then selecting the 'Content Settings' option.On this page, you can find the corresponding switches to enable or disable the Markdown editor.
2. What advanced Markdown features does AnQi CMS support, and how can they be displayed on the front-end page?[en] Safe CMS supports writing mathematical formulas and flowcharts using Markdown. To display this content correctly on the front-end page, you need to edit the website template files (usually:base.html) of<head>The content includes CDN resources for MathJax to render mathematical formulas, as well as CDN resources and initialization scripts for Mermaid to render flowcharts.
3. Can I control whether Markdown content is rendered as HTML when displaying content with template tags?You can. When you use such asarchiveDetail/categoryDetailUse tags to display content fields (such asContent), you can addrenderparameters for fine control. Setrender=truewill force Markdown content to be rendered as HTML, while settingrender=falseThen the original Markdown text will be retained without any conversion.