AnQiCMS's Markdown editor brings great convenience and powerful expressiveness to content creation.It is not just a text input box, but also an intelligent tool that can structure and visualize complex information, aiming to help users build high-quality content more efficiently and intuitively.

On the basis of Markdown syntax support, AnQiCMS follows mainstream standards and provides comprehensive functions, allowing users to focus on the content itself and not pay too much attention to formatting details. You can easily use the octothorpe#Create heading levels using asterisks*or hyphen-Define ordered or unordered lists, you can also use asterisks*or underscores_to markBoldOr *italic* text. Inserting hyperlinks and images is also very simple, just follow the intuitive syntax of Markdown.In addition, for users who need to display code snippets, the editor supports using backticks` ``来创建行内代码,或者利用三反引号`to create a code block, make sure the code is clear and readable.

It is particularly noteworthy that the AnQiCMS Markdown editor supportsGitHub Flavored Markdown (GFM)Standard good support, further expands the expression of content. This means you can easily create complex tables, through the pipe character|and hyphen-You can draw neat rows and columns; you can also add checkboxesTask listto conveniently track pending items; use double wave lines~~It's easy to mark text with strikethrough. These extended features make your content structure more rich and information communication more efficient.

In addition to the basic grammar and GFM extension, AnQiCMS's Markdown editor also provides two powerful advanced features, allowing you to say goodbye to boredom and embrace visualization:

Say goodbye to boredom, embrace visualization: Markdown extension feature

  1. Support for mathematical formulas (based on MathJax)For content that needs to display professional mathematical formulas in science and education, AnQiCMS's Markdown editor provides powerfula mathematical formulaSupport. With the MathJax library, you can directly enter LaTeX or MathML syntax in the content to express complex mathematical expressions, chemical equations, or physical formulas.For example, when you need to input a quadratic equation formula, you can use it directly$$E=mc^2$$Such LaTeX syntax allows the system to render beautiful mathematical symbols. This greatly simplifies the process of entering and displaying formulas, making your professional content more readable.

  2. Process flow and chart support (based on Mermaid)In addition to mathematical formulas,Process flows and various chartsIt is also a tool for expressing complex concepts. AnQiCMS integrates Mermaid chart syntax, allowing you to generate exquisite flowcharts, sequence diagrams, Gantt charts, and more without the need for external drawing tools, directly with code.For example, by using simple text descriptions, you can draw a clear user login flowchart or a project task Gantt chart.This "code-to-chart" approach not only improves content creation efficiency, but also makes chart modification and version management more convenient.

Content rendering and front-end display mechanism

Understood the power of Markdown syntax, next is how the content is presented on the website front end.When you enable the Markdown editor in the AnQiCMS background, the system will automatically convert it to standard HTML after the content is published, so that it can be displayed normally in the browser.This is a seamless process, usually requiring no manual intervention.

However, for dynamic rendering extensions such as MathJax mathematical formulas and Mermaid charts, they need to rely on front-end JavaScript libraries to complete the final display.Therefore, it is not enough to simply enter the corresponding syntax in the editor; you also need to make simple configurations in your website template file, introducing the CDN resources of these external libraries.For example, the MathJax and Mermaid libraries mentioned in the document need to match the corresponding<script>Tags added to the template's<head>or<body>Area. If these scripts fail to load correctly, the formulas and charts will not display properly, and you may only see the original text code.

It is worth noting that AnQiCMS also provides flexible rendering control. For example, in template tags, such as usingarchiveDetailWhen retrieving document content, you can addrender=trueParameters to explicitly indicate that the system should render Markdown content as HTML, or byrender=falseParameters skip rendering and directly display the original Markdown text. This provides template developers with more fine-grained control capabilities to meet different display needs.

In summary, AnQiCMS's Markdown editor, with deep support for basic Markdown syntax, GitHub Flavored Markdown, and extensions like MathJax and Mermaid, provides users with a comprehensive and expressive creation platform.Whether it is daily articles, technical documents, or teaching content, it can be presented in a more efficient and intuitive way, greatly enhancing the quality of content and user experience.


Frequently Asked Questions (FAQ)

  1. How to enable Markdown editor in AnQiCMS backend?You can navigate to "Global Settings" -> "Content Settings" in the AnQiCMS backend, where you can find the option to enable Markdown editor.After checking and saving the settings, you can use Markdown syntax to create content when publishing or editing articles.

  2. Why are my mathematical formulas or flowcharts not displayed on the front-end page but only the code?This is usually because the JavaScript libraries MathJax and Mermaid used for rendering formulas and charts are not correctly loaded on your front-end page. You need to follow the instructions in the AnQiCMS help document to add the CDN reference code for MathJax and Mermaid (<script>Label) Add to your website template file.<head>In the area. Make sure these scripts can be accessed and executed by the browser to convert Markdown formulas and chart code into visual content.

  3. Can the HTML content generated by the Markdown editor be displayed as raw Markdown text in the template instead of rendered HTML?Yes, AnQiCMS provides this flexibility. In your template file, when using sucharchiveDetailtags to call content, you can add parameters inrender=falseFor example{% archiveDetail articleContent with name="Content" render=false %}This is how you can get and display the original Markdown text without rendering.